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?
-
If you have updates to you question or in response to me, either post it in a comment to my answer or edit your question. Don't post "answers," that just clutters the system. – Chris Thompson Oct 10 '10 at 20:31
1 Answers
With 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.

- 1
- 1

- 35,167
- 12
- 80
- 109
-
Thnx but 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 – Haraldur Oct 09 '10 at 17:22
-
What do you mean "into an Android Emulator?" Do you have an emulator running on some remote server?? – Chris Thompson Oct 09 '10 at 18:14
-
@Haraldur, how is the computer at the specified IP set up? Is it a web server or just a program listening on a specific port? – Chris Thompson Oct 09 '10 at 18:16