Hi, > i am a student and i have a project with android which need to detect the > coordinate GPS.But during 2 months,i tried to develop any code and nothing > did not work. > when i run this code below ,i have always NO LOCATION.This means that > emulator android dont receive the coordinate from DDMS. > I use Android emulator.Please help me to specifie the directory from > emulator into java eclipse.I dont know how to do. > > In general,i dont know why the emulator android dont receive the coordinate > from the emulator controls into ddms. > > Other thing, can you help me to define my on gps provider into emulator > other than the default gps provider.
If the problems is on the emulator android,can you give me how to solve this? > > > Please i need your help.Thank you advance > > > public class androidtracabilite extends Activity > { > /** Called when the activity is first created. */ > > private LocationManager locationManager; > private WifiManager wifimanager; > private LocationProvider locationprovider; > private ConnectivityManager connectivitymanager; > private ScanResult scanresult; > > private Miseajour miseajour; > > public androidtracabilite() > { > miseajour=new Miseajour(); > > > } > @Override > > public void onCreate(Bundle tracabilite) > { > super.onCreate(tracabilite); > setContentView(R.layout.main); > String location_context = Context.LOCATION_SERVICE; > locationManager > =(LocationManager)getSystemService(location_context); > > > > // testwifi(); > testProviders(); > > } > > public Location testProviders() > { > Location location=new Location("mobil"); > TextView tv = (TextView)findViewById(R.id.myTextView); > StringBuilder sb = new StringBuilder("Enabled Providers:"); > Criteria critere=new Criteria(); > List <String> providers= new ArrayList<String>(10); > providers =(ArrayList<String>)locationManager.getProviders(true); > > for (String provider : providers) > { > locationManager.requestLocationUpdates(provider,0,0,miseajour); > location=locationManager.getLastKnownLocation(provider); > > sb.append("\n\n").append(provider).append(" : "); > if (location != null) > { > double lat = location.getLatitude(); > double lng = location.getLongitude(); > sb.append(lat).append(" ; ").append(lng); > } > else > sb.append("No location"); > > } > tv.setText(sb); > return(location); > }//fin de la fonction testprovider > }//fin de la classe > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---