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() […]

Read More

Android ImageView has unwanted padding: layout troubleshooting

If you use ImageView in your android app layout and you get that unwanted padding around the image, here’s an Android XML attribute that helped me solved the layout issue:

Add android:adjustViewBounds=”true” attribute to your ImageView XML tag and you’ll probably see the unwanted padding go away. According to the ImageView docs: android:adjustViewBounds Set […]

Read More