One of the core benefits of Java, or to be more accurate, of the JVM (Java Virtual Machine), is the garbage collector (GC). We can create new objects without worrying about freeing them up from memory. The garbage collector will take care of allocating and freeing up the memory for us.

That is not correct! We should be concerned because we can prevent the garbage collector from freeing the memory if we don’t have a solid understanding of how it works.

Without a solid understanding of how the GC works, you could end up with memory leaks in your app…

What is PowerPreference?

A Powerful library to control and simplify the usage of shared preference in android which provides utility on top of Android’s normal SharedPreference class.

How does it work?

So simple if you want to access preference file there is two option.

  1. Default preference file.
Preference preference = PowerPreference.getDefaultFile();
  1. Specific preference file by name.
Preference preference = PowerPreference.getFileByName("name");

There is no need to pass context the library uses a provider to catch the context when the application is start.

With the announcement of Android Oreo, Google focuses on giving the users an extensive suite of customization, they have taken a step further with two new capabilities: notification channels and notification dots. Everything was running great on the app until I started getting bad feedback.

Last week I got some negative reviews and feedback about a strange issue, the users complained that the app makes the phone restart.

Follow a standard coding style in android, it will be easier for you and also for others to understand your code easily.

I encourage you to fork this guide and change the rules to fit your team’s style guide. Below, you may list some amendments to the style guide.


Classes & Interfaces

Written in UpperCamelCase


interface onClickListener


interface OnClickListener


Written in lowerCamelCase


public void SetValue(){


public void setValue(){


Written in lowerCamelCase.

public int publicField;
private int privateField;
private static SingletonClass singleton;
  • Static final fields should be written in uppercase, with an underscore separating words
public static final int THE_ANSWER = 42;


If you still using the Hungarian Notation in your filed naming convention take a look at this…

Ali Asadi

Android Engineer |

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