EMULTOR BUG

Common bugs/problems with the Android SDK the Emulator and the ADT-Plugin.

EMULTOR BUG

Postby vinny82 » Tue Nov 23, 2010 1:56 pm

Hi

I am not sure , i am testing a location based app on emulator. For google docs, i come to know that there are three method to emulate location on emulator, through eclipse, ddms and telnet.

But i am not getting any success after presing send button in eclipse or ddms or sending coordinates through geofix command in telnet.

I have searched whole internet and modified eclipse.ini file with english locale.

here is the code

i have given access_fine_location permission in manifest.

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  public class WhereAmI extends Activity
  2. {
  3.         @Override
  4.         public void onCreate(Bundle savedInstanceState)
  5.         {
  6.                 super.onCreate(savedInstanceState);
  7.                 setContentView(R.layout.main);
  8.                 LocationManager locationManager;
  9.                 String context = Context.LOCATION_SERVICE;
  10.                 locationManager = (LocationManager)getSystemService(context);
  11.                 String provider = LocationManager.GPS_PROVIDER;
  12.                 Location location =locationManager.getLastKnownLocation(provider);
  13.                 updateWithNewLocation(location);
  14.         }
  15.        
  16.         private void updateWithNewLocation(Location location)
  17.         {
  18.                 String latLongString;
  19.                 TextView myLocationText;
  20.                 myLocationText = (TextView)findViewById(R.id.myLocationText);
  21.                 if (location != null)
  22.                 {
  23.                         double lat = location.getLatitude();
  24.                         double lng = location.getLongitude();
  25.                         latLongString = "Lat:" + lat + "\nLong:" + lng;
  26.                 }
  27.                 else
  28.                 {
  29.                         latLongString = "No location found";
  30.                 }
  31.                 myLocationText.setText("Your Current Position is:\n" +latLongString);
  32.         }
  33. }
Parsed in 0.033 seconds, using GeSHi 1.0.8.4


Please help..

Regards
Vinny
vinny82
Once Poster
Once Poster
 
Posts: 1
Joined: Tue Nov 09, 2010 6:11 pm

Top

Return to SDK/ADT/Emulator Problems

Who is online

Users browsing this forum: No registered users and 3 guests