Dear Andrian. Thank you for your feed-back. I keep on trying to understand List providers. It should provide me a list of GPS satelitte from where I can read the coordinates. Unfortunately, providers is empty and hence my HTC Hero force me to close it when running on the phone and reaches the line GeoPoint p = new GeoPoint((int) (location.getLatitude() * 1E6), (int) (location.getLongitude() * 1E6)); I have no problem in compilling the code.
Ideas are very welcome as well as code examples (I have inserted my code below) Thanks in advance. protected void onResume() { List providers; super.onResume(); locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); providers = locationManager.getProviders(true); if (!providers.isEmpty()) { location = locationManager.getLastKnownLocation((String) providers .get(0)); locationManager.requestLocationUpdates((String) providers.get(0), 15000, 1, this); } GeoPoint p = new GeoPoint((int) (location.getLatitude() * 1E6), (int) (location.getLongitude() * 1E6)); mc.animateTo(p); mc.setZoom(17); mapView.setSatellite(true); mapView.setStreetView(true); mapView.invalidate(); } On 29 Mar., 15:20, Adrian Vintu <adrianvi...@gmail.com> wrote: > List<String> providers; > > Normally you should get only some warning on this, but it depends on your > switches. > > If you use Eclipse, just hover over your error/warning and you will get > options on how to fix it. Also Ctrl+1 to get the options. > > BR, > Adrian Vintuhttp://adrianvintu.com > > > > On Mon, Mar 29, 2010 at 3:08 PM, ckloch <ckl...@gmail.com> wrote: > > In my effort to develop a small location finder app for HTC Hero with > > Android 1.5, I am using the code below that should work on Android > > 1.6. > > My problem is that includes the commandline to find the available GPS > > satelittes: List providers; > > > Eclipse tells me that I have to parameterize List, but not how. > > Please, help me to understand List providers and what I can do to get > > it working? > > Thank you in advance for your help. > > > protected void onResume() { > > List providers; > > super.onResume(); > > > locationManager = (LocationManager) > > getSystemService(Context.LOCATION_SERVICE); > > providers = locationManager.getProviders(true); > > > if (!providers.isEmpty()) { > > location = locationManager.getLastKnownLocation((String) > > providers > > .get(0)); > > locationManager.requestLocationUpdates((String) > > providers.get(0), > > 15000, 1, this); > > } > > GeoPoint p = new GeoPoint((int) (location.getLatitude() * > > 1E6), > > (int) (location.getLongitude() * 1E6)); > > mc.animateTo(p); > > mc.setZoom(17); > > mapView.setSatellite(true); > > mapView.setStreetView(true); > > mapView.invalidate(); > > > } > > > -- > > You received this message because you are subscribed to the Google > > Groups "Android Beginners" group. > > > NEW! Try asking and tagging your question on Stack Overflow at > >http://stackoverflow.com/questions/tagged/android > > > To unsubscribe from this group, send email to > > android-beginners+unsubscr...@googlegroups.com<android-beginners%2bunsubscr...@googlegroups.com> > > For more options, visit this group at > >http://groups.google.com/group/android-beginners?hl=en > > > To unsubscribe from this group, send email to android-beginners+ > > unsubscribegooglegroups.com or reply to this email with the words "REMOVE > > ME" as the subject.- Skjul tekst i anførselstegn - > > - Vis tekst i anførselstegn - -- You received this message because you are subscribed to the Google Groups "Android Beginners" group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en To unsubscribe, reply using "remove me" as the subject.