Monday, August 30, 2010

[android-developers] Re: How Write a background service to get latitude and longitude

I had full intention on writing a blog post about this mostly in
response to this posting on Lifehacker

http://lifehacker.com/5611003/build-a-find-my-iphone-clone-for-android

In Android its a fairly simple piece of code that needs to run. The
basic application is this

1. Listen for an incoming SMS with a BroadcastReceiver and this Intent
<receiver android:name="SmsListener">
<intent-filter>
<action android:name="android.provider.Telephony.SMS_RECEIVED" />
</intent-filter>
</receiver>

2. Inside the BroadcastReceiver, start a service that initiates the
LocationListener

2a. I have the service trying the GPS provider until it gets a
response. Likely you should probably start with the network provider
and
then to the GPS provider depending on the accuracy you are looking
for. Also, you should be checking to see if the providers are enabled
and
running before you start your listener.

3. Once the Service gets an update, it crafts a return sms and sends
it out.

Pretty basic but for a stalking, I mean tracking application but
hopefully it can help you out.

Here is where the code is located;
http://code.google.com/p/androidsmsphonelocator/


Thanks,
John


On Aug 28, 7:45 am, Hotouch <hoto...@gmail.com> wrote:
> Hello Android Community,
>
> I am new to android development and i have started working on an
> android application to perform following tasks...
>
> This application is to monitor the sales team of a company...
>
> write a service to run in background and get the current latitude and
> longitude of android device after getting a specific SMS from any
> number and then upload the latitude and longitude to a PHP web server
> without any notification to the user.
>
> Your thoughts or any code will be a great help for me as this is my
> first project of this kind..

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment