![]() ![]() I have seen many posts here on using background services with handlers, pending intents, and other things to do similar stuff, but I really don't understand how to do it. ![]() So it means I'm clueless at this point, never having used Android before. ![]() However, when I tried starting a periodic tracking method from inside the StartTrack Activity, using requestLocationUpdates(String provider, long minTime, float minDistance, LocationListener listener) where minTime is the poll period from the server, it just did not work, and I'm not getting any errors. Similarly, the trip is closed server-side upon the close trip request. This part works, in that I can display the response on the phone, and my server registers the user's action. Once the trip is started from the phone, the server responds with a polling period for the phone to use as the interval between updates. Being a newbie, I am not sure how to set up a background service that sends the location updates once every (pre-determined) period (min 3 minutes, max 1 hr) until the user flags the end of the trip, or until a preset amount of time elapses. The thing is that it is easy to pass data, including coords and other items, to the server when a user starts a trip or ends it. I am running a Web service that allows users to record their trips (kind of like Google's MyTracks) as part of a larger app. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |