Android Maps: Get current location coordinates with Google API Client Builder

To get your current location via Google Map in an Android app, this was how we do it:

Stop. Don’t use that! The method GoogleMap.getMyLocation() is deprecated. Instead, we need to use FusedLocationApi and the callback onLocationChanged().

Here’s an example code that works for me ( consider copying the contents of onResume() into onStart() ):

Code source: How to get current location of device on google maps api v2, getMyLocation() method is deprecated

Related Posts:

Posts that may be related to "Android Maps: Get current location coordinates with Google API Client Builder":

Catzie

A Filipino programmer with a variety of interests such as baking, singing, making up silly song/rap lyrics, K-pop, drawing, creating unique dessert flavors, obsessing about finding out how some things works, board games, anime, video games, and forgetting things that usually go in her long list of interests. Running small-time online dessert shops Cookies PH and Catzie's Cakery.

Leave a Reply

Your email address will not be published. Required fields are marked *