0

i am newbie to Android..i have latitude and longitude details in my program..i want to send them to web server via gps..and those details should be saved in a database and retrieve them whenever i require..plz explain me how to do..and if possible give me some sample code...

3 Answers3

1

You can't "send" something "via GPS". GPS is a "receive-only" thing.

http://en.wikipedia.org/wiki/Global_Positioning_System

If you like to send data to a web server, you can use the HTTP-protocol with Android, e.g. retrieve latitude and longitude (How to get Latitude and Longitude of the mobile device in android?) and then use HttpGet (or HttpPost):

http://developer.android.com/reference/org/apache/http/client/methods/HttpGet.html

Community
  • 1
  • 1
Select0r
  • 12,234
  • 11
  • 45
  • 68
1

Did you mean the mobile network or wireless instead of GPS ?

Anyway:

You from the sounds of it you need to get the GPS details into your program then pass them to your server. Have you designed your webserver yet or are you going to be submitting this to a site that already exists?

Dech
  • 1,582
  • 4
  • 17
  • 32
0

You're really asking for a lot, but lets see if we can point you in the right directions.

Here is a great example of reading GPS data from an Android device: LocationManager example

You must declare explicitly in Android that your app needs permission to access the Internet (and the GPS, for that matter). Android Securty and Permissions

There are also some specific ways of life in Android development. The official developer's guide is a good place to start. The Android Developer's Guide

Mike Yockey
  • 4,565
  • 22
  • 41