Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android

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: https://developers.google.com/android/guides/permissions