Search This Blog

Wednesday 14 January 2015

Android Memory optimization tips and tricks

Android central process Zygote forked to allocate memory for every other process. Because of limited resource in mobile, memory optimization is necessary in android. Don't ask for more memory if you don't require it. Here are some tips which will help running your application smoothly

  • Enums often require more than twice as much memory as static constants. You should strictly avoid using enums on Android.
  • Every class in Java (including anonymous inner classes) uses about 500 bytes of code.  and every class instance has 12-16 bytes of RAM overhead.
  • Putting a single entry into a HashMap requires the allocation of an additional entry object that takes 32 bytes 
  • Use optimized container from android framework like  SparseArray, SparseBooleanArray, and LongSparseArray. generic HashMap use can be quite memory inefficient because it needs a separate entry object for every mapping so use  SparseArray.
  • Release memory as memory becomes tight 
  • onTrimMemory() callback of Activity help you finding way to release resource. Callbacks like TRIM_MEMORY_RUNNING_LOW, TRIM_MEMORY_RUNNING_MODERATE, TRIM_MEMORY_RUNNING_CRITICAL etc gives you way to release unused resource which eventually help improving performance of your app
  • Load views on demand using ViewStub read about ViewStub
  • Use multiple process in a single application. Name your background services as separate process like 

         <service android:name=".PlaybackService" android:process=":background" />

Thursday 1 January 2015

Happy new year, Meaning of newly born 2015 for android developer

This is my first article of newly born 2015. First of all i wish a very happy and safe 2015 to reader. Today i choose to right about my own judgement, suggestion and prediction for android developer. Never forgot to tell me at end of the article how much i went correct?

More tough competition to survive

Lot of big player had joined android success ride.Day by day, Google play is flooded with thousand of quality android application daily.Getting attention is going stiff unless you have not made something really great. For small and individual developer, this is more tough to survive now.We should thanks to Google search strategies on play store which indeed a help to developer. Success mantra is keep growing your creativity.

Android wear will be strong

Developing app for android wear will be a good option. Keeping vision in information technology is best way to survive.Android Wear was announced and launched in 2014. We saw some great devices from the usual suspects (Samsung, LG, Motorola)

Keep an eye on CyanogenMod and Tizen

CyanogenMod is highly customize android by some enthusiastic developer community. For techgeek it will be a great option to have in their device. CyanogenMod has potential and its hardly take days for android developer to make application for CyanogenMod. Keep posting your ideas for Tizen too.
Samsung had created user sector all over the world and you can't ignore Korean giants.

Give a chance to amazon developer console

Most of the android application run on amazon devices with no or less modification. Give it a chance, that will surely increase your earnings. Amazon provide you amazing test framework which will help you building quality application.

Don't tease ios Developer

Last but not leaset, Being human you should respect a human so as being developer you should respect developer. 2015 will not gonna downfall of apple. iPhone 6+ advance
booking shows craze of iPhone lover.
Android News and source code