Git Product home page Git Product logo

backgroundlocation's Introduction

** Please use the GitHub 'Issues' if you have problems and send pull requests. I no longer actively maintain the code, but many people are still using it **

Phonegap 3.0 Background Location App

Phonegap 3.0 app that can run in the background and sends current gps location to a server.

Developed using the new Phonegap 3.0 Command Line Interface, so the top level www directory is where all editing should take place, then just build for whichever platforms you wish to target.

We have developed and tested this app on iOS and Android. In theory it will work on all devices that Phonegap supports, such as Windows Phone, Blackberry, for a full list check http://phonegap.com/

We have tried to make the UI conform to iOS apple store standards. Our app is currently waiting for approval, we will update once it is approved/rejected.

Libraries Used

  • FastClick - removes 300ms lag in most mobile browsers. Gives native feel.
  • jQuery Mobile - For easy mobile UI and nav, don't use any/many features from it.
  • jQuery - make JavaScript life easier

Plugins Used

Network Information

cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information.git

GeoLocation

cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation.git

Splash Screen

cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen.git

Notifications

cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs.git

iOS

Allow update GPS in background

Once you have performed 'phonegap build ios', Open the resources subfolder in xcode, click the .plist file, add a new row, Type 'Required background modes', in the first index select 'App registers for location updates'.

Server Code

  • /Map/..: Map website to view users
  • /dbSetup.php: onetime use for creating tables with users and unique int passcodes
  • /submit.php: for accepting gps updates and adding them to database
  • /getMarkers.php code for getting latest GPS update for each user, returns json

Server Setup

  1. Open up phpmyadmin on your server and create a database and user.
  • Update config.php to reflect the database settings you created.
  • Upload all of the files to your server.
  • Visit dbSetup.php once to run it. This creates database tables and users with passcodes.
  • Check phpmyadmin to see some of the passcodes, try them on the app.

TODOs

  • App: Factor out server communication specific code into its own object.
  • Passcode security was not a top priority for this app, they are predictable and vulnerable. If passcode security is concern rewrite the passcode generation section.
  • Some developers claim that if PHP responds it should always be success, and ajax error should just be for 404's etc. Research and adjust code accordingly.

backgroundlocation's People

Contributors

davidrs avatar mrnickbreen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

backgroundlocation's Issues

Build successful, can't emulate.

image

Hi, i've build successfully, though when i used it via phonegap build service it did install but it didn't seem to do anything, it couldn't fetch internet / gps either

so i thought building it out manually, could it be that the newer version of phonegap has depreciated some of what you may have used? i really need a kind of app like this which could transmit the data over to the server and i'm keen to see it working.

I did try to setup a server, ran php scripts, it did make the databases and i've all the figured, but the app doesn't seem to work. What do you think?

Question

Is this really working in Background on an Android Device?

Does this run when the app is closed?

Hey Nick, wondering if this will run as a service even when the app is off. Trying to do passive geofencing that would prompt a user to open a particular app once a region has been entered, but not entirely sure if that's even possible.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.