So i am making a android app, and i want it to be so if i call lets say 911 it sends my GPS coordinents to a certain IP, i know everything but how i make it so if i call 911 it sends the info and how i can make it send the info to the IP via 3g, can anyone help?
views:
42answers:
3With regards to detecting the call being made, check out this SO post. I imagine the number being dialed will be part of the intent that was broadcast.
From there, you will need to fire up the GPS and grab the coordinates which is easy to do and you can follow this SO post. The problem will be it may take some time to grab the coordinates, but that's another issue.
AFAIK, there's no wait to force it to send data over 3G vs Wi-Fi but based on what you say you want to do, I don't think it'll matter (if it does matter, update your post and I'll try to address it). Just use the standard HTTP or Socket classes you would use normally to make a connection to the server you need to send the data to.
If you want to upload information, the place you're uploading has to be prepared to accept your connection. I can't tell you how to upload it unless I know more about your server and how it's set up. For starters, check out the socket class and the HTTP client classes.
Can you tell me how i can send the info? So basicly how i can make it send my GPS coordinents to an IP, and into an Android Emulator?