Okay here it goes my app is sort of a GPS tracker app you can say.
If the user is travelling from source to destination, i want to get its GPS location say after 5-7 minutes until the user has reached the destination and also keep send text messages of that position to a specified number.
So my question how can i get user's location and send message after he has closed the application?
The user will fill in the source and destination in my activity and then click a button to send text message and the application closes.
I guess this can be solved with using service class of android...But i really didn't understood how can i use it?
Use
requestLocationUpdates()
ofLocationManager
class for getting GPS location in certain time interval. Look into this for your reference.See the following code snippet which would fetch user's current location in latitude and longitutude in every 1 min.
After getting the the
Latitude
andLongitude
useGeocoder
to get detailed address.EDIT:
Do all the above functionalitie in a class that
extends Service
so that it tracks user location eventhough the appln is closed.c below for sample,