user2505059
user2505059

Reputation: 23

GPS Data Service

I am trying to program a service that sends GPS location data to a server at settable time intervals. Being fairly new to android, this is not turning out as easy as I was hoping and the internet doesn't really seem to be helping me either. The service should...

What is the best solution? What direction should I be heading in?

In terms of the LocationListener itself, what is here the best solution?

Thank you for your help.

Upvotes: 0

Views: 150

Answers (1)

verybadalloc
verybadalloc

Reputation: 5798

After 7 minutes of search, here are a few articles to help you out:

Start at boot

This is done using a BroadcastReceiver. Check out this answer for the exact way to implement it: Android -Starting Service at Boot Time

be able to read settings, that are anytime changeable from an activity/app and also apply these settings in real time without having to reboot the phone

EDIT As per the OP's comment, one can use PreferenceActivity to create a Settings page for an app. This article shows basic implementation of a PreferenceActivity, while this excellent question shows how to read these preferences from the SharedPreferences. And, yes SharedPreferencs will persist after a reboot (they don't persist after an app uninstall though).

be able to upload the data to the internet (httpRequest)

On how to make HTTPRequests in android: Make an HTTP request with android

Not cause my phone to crash (previous attempts caused my phone to crash)

This one really depends on you. But, hey, you can always search this site for all and every possible error you get.

In terms of the LocationListener itself, what is here the best solution?

Try this one (which has complete code example), and this one.

Upvotes: 2

Related Questions