I am using the location service in android’s simulator,
String provider = locationManager.getBestProvider(criteria, true);
Location location = locationManager.getLastKnownLocation(provider);
but I am getting null on provider and location in simulator and this causing my app to crash.
Can I debug my program in simulator or I need to use a real phone?
You can see this complete example about location http://marakana.com/forums/android/examples/42.html
You don’t need to use a real phone, emulator lets simulate that you get coordinates. You have to open DDMS perspective and in left hand you will find Emulator Control. In emulator control there is a panel for locations control, where you can introduce coordinates and send to the emulator