Justin Roberts
Justin Roberts
14,583 Points

Suggestion for using GoogleApiClient for location on Android 6.0+

So, I was trying to add location to the Stormy app using the GoogleApiClient and the fusedlocationapi and was having a lot of trouble getting it to work. I checked and the google client was connecting, but getlastlocation kept coming up null.

After scratching my head for a few hours I found out that with Android 6.0 and above you have to ask for permissions at run time in addition to the permissions you state in the manifest file. So, if you can't get location to work, check your Android version and if it is 6.0 or above here is a link that guides you through requesting permissions: