Shree
Shree

Reputation: 1

get location on android sdk

I am very new to android.I am using android 2.3.I want to know how to get location through gps or network provider on the android emulator.When I run my application on the emulator,it does not give me the name of the network provider but displays "network".I am creating an application which requires user's current location. can anyone please help me to do it and even how i can test if it works on emulator.

Upvotes: 0

Views: 690

Answers (1)

GSree
GSree

Reputation: 2898

Two parts

  1. Emulator will not give you a location. However, you can simulate a location. If you are using Eclipse, go to DDMS perspective and in the left side, you will see Emulator Controls. Scroll down to see Location Controls. You can enter location coords here.

  2. You need to download Google API for Android (This is different from Android API). Go to your Android SDK and AVD Manager (in Eclipse this is under Menu 'Window'). Select Available Packages --> Third party Add-Ons --> Google Inc and select the API versions you want. Run the GPS emulation using these emulator

Upvotes: 1

Related Questions