Skip to main content

Posts

Java Singletons using enum type (The best method for making Singletons in Java)

Singleton is a class that suppose to have only one instance per JVM. Same instance of the singleton class is reused by multiple threads. Most often we use singletons to represent system configurations, window managers like resource since those instances should be common to all threads and objects within a JVM.
Recent posts

Spring Transaction Management over multiple threads

Spring framework provides a comprehensive API for database transaction management. Spring takes care of all underlying transaction management considerations and provides a consistent programming model for different transaction APIs such as Java Transaction API (JTA), JDBC, Hibernate, Java Persistence API (JPA), and Java Data Objects (JDO). There are 2 main types of transaction management in Spring. They are declarative transaction management which is a high level one and programmatic transaction management which is more advance but flexible. The Spring API works very well with almost all of the transaction management requirements as long as the transaction is on a single thread. The problem rises when we want to manage a transaction across multiple threads. Spring doesn't support transactions over multiple threads out of the box. Spring doesn't explicitly mention that in the documentation. But you will end up with run time errors or unexpected results if you try to do so.

Does it really worth adding a SSD to a laptop?

Nowadays, SSDs are becoming more popular. The reason behind this is the new applications are becoming more resource intensive and computers are getting slow with traditional hard disks. This mostly happens to the machines with Windows operating systems. Therefore most people are upgrading their machines with SSDs to achieve a higher performance. But the price of a SSD is relatively higher (more than 2 times) than a HDD. So most people face to the problem whether the extra performance we get is worth compared to the price of SSD with HDD. Some people say that SSDs are useless as they have a limited write cycle count. What is the truth behind think this? Should you upgrade your machine with a SSD?

How to play Sinhala subtitles(or any other custom fonts) using MX Player on any Android device

Do you know that you can play sinhala subtitles on your android device using MX player even though the device doesn't support sinhala rendering. Just a simple procedure.

Hide Images, Videos, Music on SD card from Android Gallery (Hide WhatsApp media from gallery)

In android devices all images, videos and sound tracks which are located on internal memory and SD card are automatically added to the music player and the gallery. There are many cases where you don't want to avoid adding these media files to gallery. For example you may want to hide media downloaded from Whatsapp.

Extend internal memory of any Android device (Root Needed)

Low internal memory is a very common problem between low end android devices. Today most of android devices have both more than enough processing power and RAM size. But the internal memory size is relatively low. Due to low internal memory, we can't install many apps and most of the times sync stops working. Two most popular solutions to low internal memory problem. Link2SD Drawback - Slow down the device vold.fstab method Risk of bricking the phone. Need the appropriate vold.fstab for the device. I'm going to tell you a different method. In this method the SD card is joined to the end of the internal memory. If the internal memory is not enough, then the SD card will be used instead of the internal memory.  I installed NFS Most Wanted and NFS No Limits on a Xpeia E3 Dual after extending the internal memory using this methods. (Xperia E3 Dual has a internal memory of 1.7 GB)

Root Sony Xperia E3 or E3 Dual

This guide is only valid for Sony Xperia E3 and Sony Xperia E3 Dual only. And this guide has been completely tested and succeeded with Sony Xperia E3 Dual (D2212).