Skip to main content

Posts

Showing posts from July, 2010

Custom Logger for Android

Now and then you must feel the need to have some more control over the way Android Application logs are getting displayed. Possible requirement scenarios; redirecting your Android logs into a File or you might want to control the logs those are getting displayed e.g. for production mode, you may want to block all logs to get better performance . I have written a custom Logger, which is a wrapper over android.util.Log . This will keep existing behavior of Log class as it is and add few handy features to get more control over your application logs- Storing Logs directly into File - at present all logs comes on the LogCat. You need to manually copy/past logs from LogCat to any file for further analysis. Another option is to get the Dump state when an application gets “ Forced Closed ”. But this wrapper will allow you an automatic solution. Imagine a scenario, your Phone is not connected with the LogCat and you need the tracing. This wrapper will be

Weekend at Yeouido (Han River Cruise)

Yeouido is one of the Han River Cruise boarding points. It has a wonderful river side park (Yeouido Park or Han River Public Park) an ideal place to spend your weekend. How to reach (from Suwon through Subway)- Line 1 ( Suwon to Singil ) Change to Line 9 from Singil Line 9 ( Singil to Yeouinaru ) What I can do in Yeouido- Han River Cruise Yeouido Park- you can rent bicycles to roam around. 63 Building (Wax Museum, Aquarium and Food court) From Yeouinero subway station take Exit 3 , and you get the wonderful Yeouido Park in front of you. Apart from the Cruise and the River side Park, you will also find a golden color building (Building 63) within walking distance. It houses a Wax Museum, Aquarium and a good food court. To get the best out of your cruise, it is always good to have the cruise in the evening (probably you should take 7:30PM one). You get to see the best possible nature around the bank of the ri

A day at Suwon World Cup Stadium

A nice, relaxing Sunday evening at Suwon World Cup Stadium (after a painful and irritating throat pain and a mild cold on Friday n Saturday). Watched a friendly match- Suwon Samsung Bluewings F.C. Vs. Japan based Urawa Red Diamonds . I guess I need not to mention, Suwon World Cup stadium , was one of the prime venues for World Cup 2002. It’s really amazing to watch the way Korean people cheer up their home team. Though there was a small bunch of supporter for the Japanese team as well. Unfortunately I was accompanied by a group of friends who were more interested in singing, having photo session and playing Antakshari (an Indian Musical Game) rather than what is going on in 90 mins . But I enjoyed their company very much :-) and it was a bit refreshing as both the sides failed to score any goal.   There were multiple attempts from both the sides, but finally they didn’t disturb the score line and kept it a perfect friendly match (no win-loss pa

Few Multi-Threading Implementations

Sequential Producer & Consumer In my first example, I will demonstrate an implementation to solve the famous producer and consumer problem. Producer should complete its production, before Consumer can consume it, as simple as that. In addition, both the operations should run on 2 separate threads. public class SequentialExecutor {       /**         * Shared         */       volatile int shared ;             /**         * Lock object, whose monitor will be shared by both the threads         */       Object lock = new Object ();             /**         * Producer         */       P p ;             /**         * Consumer         */       C c ;             public SequentialExecutor (){             p = new P();             c = new C();       }             public class P implements Runnable {             public void run(){                   while ( true ){                         synchronized ( lock ) {