One of my colleagues recently mentioned that they saw a presentation that says:

If you are an Android developer and you do not use WeakReferences, you have a problem.

I personally think that, not only that is a wrong argument but it is also totally misleading. WeakReference should be the last resort to fix a memory leak.

Then today, I came across the post in Google Developers Experts publication by Enrique López Mañas

It is very good article that summarize how references work in Java with examples.

The article does not say that we have to use WeakReference but it…

I’ve been thinking about this for a long time. When you type a wrong task name in gradle, the stderr output tells you about it and gives an alternative candidate.

When this happens, I always type fuck and all I see is:

Well, no more. Finally I decided to write a custom rule for it.

Here you go:

Once you install the rule, it saves your life over and over.

Update: With the release of Google Play Services 8.3, the need for the Storage permission is completely dropped. You can safely remove the permission completely now. Here is the official documentation:

If you’re targeting version 8.3 or later of the Google Play services SDK, you no longer need theWRITE_EXTERNAL_STORAGE permission to use the Google Maps Android API.

For a long time, Google Maps Android SDK requires us to have WRITE_EXTERNAL_STORAGE permission. It was not the case when they first released the SDK. …

Warning! Resolving of “Implicit Intent”s in Android Marshmallow is not working as the same as before. This may break your app’s behavior.

Let me explain the expected behavior and why is not working:

I have recently been working on a small open source project called “Open Link With”. It will hopefully be in the Play Store soon.

My app gives you the ability to switch between other apps. When you share a link with me, I basically grab the link and query all the Activity’s that can handle that link. …

I have a very little open source application called HackDash. It just shows the open/close status of various Hackerspaces in the world in DashClock.

The implementation is really simple. It just uses SpaceAPI to get the directory of all Hackerspaces and uses their internal APIs to show the status of those Hackerspaces.

Apart from the support library and various helper libraries, I only use play-services-analytics from Google Play Services to integrate with Google Analytics.

Today I’ve just upgraded Play Services from version 7.8.0 to 8.1.0 and I realized that my application size increased from 1.7Mb to 1.9Mb. 200Kb for nothing…

SharedPreferences are great and the easiest way to persist user data on Android. It lets you to store/access primitive preference data in key-value pairs. It supports storing/accessing primitive data: boolean, float, int, long, String, and StringSet (not Array unfortunately).

Almost all Android applications use it. Although usage of the API is straightforward, it has its own problems. When your codebase grows, it becomes really easy to make mistakes because it is initialized and used with String literals.

I will first talk about traditional ways to access SharedPreferences APIs and discuss the problems with all the common approaches. …

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store