All Posts

Fetching location updates using Kotlin Flow

Fetching location updates using Kotlin Flow

Dealing with FusedLocationProviderClient, LocationRequest and LocationCallback classes when you need to fetch the current user location can be cumbersome. You don’t want to add this logic to the ViewModel because you will get stub exceptions when running unit tests (and generally, it’s bad practice). Do you add it to the activity/fragment, and then pass the data to the ViewModel? What happens if you need the location in another activity/fragment? This can get messy quick.

Welcome to the internet in rural Ireland

Welcome to the internet in rural Ireland

Living on a farm typically means living in an area poorly serviced by internet providers. In my case (or my parents to be precise), our house is located at the end of a private lane, 500 metres from a main road and about 1.5km from the local exchange. Our current internet connection is a ADSL2+ line supplied by Eir. Due to our distance from the local exchange, our download speed is limited to 17mbps and our upload speed limited to 765kbps.

Android Pie cleartext issue

After running my app on an API 28 (Pie) device, I noticed none of the API requests were failing. A quick look at the logs and I could see the issue: CLEARTEXT communication to `http://dev.myendpoint.com` not permitted by network security policy What does this mean? Well, the project I’m working on is in the early stages and as a result, the HTTPS endpoint hasn’t been setup yet by the backend guys.