To get your location with just network; set LocationSensor.ProviderName to network
To get your location with just gps; set LocationSensor.ProviderName to gps
and then set LocationSensor.Provider.Locked after you set gps
TheLocatonSensor is very versatile on some devices. If the gps can not get a satellite fix (it needs to 'find' and verify the data from at least three satellites), some devices will get the location automatically from network. They do that in various ways, the most common is that cell-phone towers are used to locate the Android. In that case, the location information is of lesser accuracy than obtained from the gps receiver in the Android. Well, usually. The LocatonSensor and the gps may not be able to get a satellite fix because the Android is indoors, shielded by tall buildings or is located perhaps under a tree after a rain.
If you are getting the No address available, but your device records correct latitude and longitude values,
I believe what you are experiencing is a Google issue and perhaps not an AI2 issue. http://developer.android.com/training/location/display-address.html In some locations, Google maps just can not render an address because 1) there is no such address in the local Google Maps provider database, 2) the device is using cell tower info and it cannot get a triangulation or 3) other reasons.
If you attempt to get an address in downtown Los Angelous or in the middle of the Gobi dessert, you may get no address available. In LA, you can go outside, walk a block and see clear sky instead of buildings and may suddenly discover your device reports an address.
I get a street location 90% of the time using the latest version of AI2, so I do not think it is an AI2 bug.
What are you missing? If you lock provider and request qps, you will never get a network location. If your device is in a location in which Google's system can not render an address, for whatever reason, you will get no address available. If you are in the middle of the Pacific Ocean, you will get no address available. If you can not get an address, it is also possible you may have previously denied permission for Google Maps to use your location (in your device settings).
Was this helpful? Build your apk, load your device and try using different locations. This might be difficult in some countries because the address might be blocked by the government, I think.
Future tutorial? I've written a lot of them already about geolocation, mapping etc. They just are not posted. MIT does not have the time, staff etc to post and maintain tutorials at the moment. They do not presently have a system working to consider what tutorials it wants posted. Be aware, I can not even modify my own tutorial (LocationSensor) as I have no access to the MIT system.
Regards,
Steve