Web App GPS Polling

So it looks like mobile phones these days are capable of providing gps data ;)

I'm building a django app with a mobile edition that I want to be location aware.

My question is, how does one access GPS data? Is there a standard, or do you have to custom code for android/iphone/other.

Ideally, I'd imagine it being provided in the HTTP request in the same way you get information such as the IP Address and User Agent.

Asked by: Stella678 | Posted: 25-01-2022

Answer 1

There's a really good blog post about this topic, covering a variety of methods @


Answered by: David491 | Posted: 26-02-2022

Answer 2

Question is quite old, but still users will be redirected here from google, so update:

As for now, the HTML5 geolocation is a standard

You can read Geolocation API specification on W3C and see the Where am I? app to check your desktop/mobile browser support.

HTML5 geolocation is available for Opera/Opera Mobile, Firefox (both desktop and mobile), IE for desktops (unfortunatelly, not mobile version for Windows Phone 7), Safari (both desktop and mobile), Chrome and Android Browser.

Answered by: Emma185 | Posted: 26-02-2022

Answer 3

Server side API will be common for all platforms (just standard HTTP requests).

GPS access is platform depend and typically You will have to write custom code for all platforms. However you can try use http://www.appcelerator.com/ - framework for crating mobile apps using Web based techniques (there is common appi for GPS access).

Answered by: Connie462 | Posted: 26-02-2022

Answer 4

Your code is going to be used on a mobile client, you know it is going to be a specific kind of phone. Yes you do need to code for a specific device as the API for iPhone is not the same as for Android. Android I don't know yet - for iPhone, you need to use Core Location - the CLLocation class is a good place to start reading in the developer docs once you have Xcode open, and the Locations sample code is a nice starting point that shows how to get a series of position fixes. Maybe you can get some kind of fix back from the server but I don't think you'll find it at all accurate - that is to say not incorrect but with a very large circle of uncertainty.

Answered by: Stella856 | Posted: 26-02-2022

Similar questions

android - Java long polling

I wrote a server with node.js but it gives the data when only receiver GET requests. I am writing a Java application to work with it. But what to use, how to do. Can you provide examples or something like I should use?

json - Android: Polling for every 2 sec

One feature of my application is to retrieve live data (JSON object) every 2 sec and display it (only while app is in foreground). I am executing an async task for every 2 sec. But this is making the app slow. I have searched for alternative, but i only got C2DM option. I can't use it because of server limitations. Could you please tell me an alternative or effective way for polling?

android - polling Log in service

Hi i created a service successfully public class Securityservice extends Service { @Override public IBinder onBind(Intent intent) { // TODO Auto-generated method stub return null; } @Override public void onCreate() { super.onCreate(); Log.d("Service","I Am Security Service Created"); } @Override public void onDestroy() { // TODO Auto...

android - Using polling in jeromq

I am learning to use zeromq polling in android . I am polling on a req socket and a sub socket in the android program(client). So that this client can receive both reply messages from the server and also published messages. My polling is not working. Both the req socket and the publish socket does not get polled in. If i don't use polling both the sockets receive the message. I tried searching online but c...

android - java client server update without polling

when building a server, one sometimes performs asynchronous tasks from client to server (which responds to client in asynchronous time), or the server needs to send the client a message now if the client is listening at all times (meaning polling) it takes a lot of resources which is problematic here is where I assume the operating system steps in and assumes the role of polling for the appropriate port, a...

android query on polling server

I'm creating an app in android that would basically connect to the server and receive data which would be further processed for certain further tasks of my app. Currently I've just developed a sample app that is using Async task and connecting to the server and display the contents. Now, as I've learned that Async can be run only once, it doesnt fullfil my purpose because I want the changes in data on the server to be refl...

android - How to keep polling a bound service?

I looked up on the internet, but couldn't find an example covering my scenario. What I am trying to do is: 1) To start and bind to a service as soon as my activity starts (done) 2) The service then binds itself to another service looking for a user input from a connected device, and saves a string a string to a variable (done) 3) ...

android - Long polling vs server events in context of mobile device and data usage

Trying to decide on which protocol to use in my Android application. Doing research I see that long polling is more resource-intensive on server side because of constant reconnects. But it happens every 2 minutes or so. With server events - connection happens once and events being constantly sent to client (Android) - hence data usage. I also read people having problems with server events on 3G networks, wh...

java - How can I achieve to get live events from a http server on an android app? without polling

I would like to think that polling for updates is not the most efficient way of doing this and latency would be high. So is there a better way of achieving this? Are there any http libraries for that?

java - RxJava polling + manual refresh

I have a list a want to refresh every minute. For example the user list here : https://github.com/android10/Android-CleanArchitecture/blob/master/domain/src/main/java/com/fernandocejas/android10/sample/domain/interactor/GetUserList....

Still can't find your answer? Check out these communities...

Android Google Support | Android Community | Android Community (Facebook) | Dev.io Android