How to decompile android APK app files

AndroidThis is a simple tutorial of extracting APK file of any app available in market and then decompiling it to Java source. This can be helpful for those who perform code review (for security vulnerabilities) on apps whose source code is not available  or to do some reverse engineering. You need to remember that Decompilation of APK file is possible, but it might be difficult to understand the code if it is obfuscated.

Fix Windows Phone 7 (WP7) gradients in emulator/phone.

While developing Apps for Windows Phone 7 using gradients you might notice they look fine and smooth in Visual Studio or Blend but not in emulator or on Windows Phone device. You can see quality decrease and horizontal streaks making the transition less subtle.

The reason for it is your App is using 16bits per pixel color depth settings. To force your app to use 32 bits per pixel you have to set the attribute BitsPerPixel value to 32 in the App Manifest File.

You can find the Windows Phone App Manifest file from Solution Explorer under properties and the file name is by default WMAppManifest.xml.

Are Internet Explorer, Safari and Mobile users more likely to click on AdSense ads?

Checking my site statistics on Google Analytics I noticed people using Internet Explorer or mobile devices (Android mostly) tend to have a significantly higher CTR (cost/revenue per 1,000 impressions) on AdSense ads compared to visitors using any other browser.

Programmatically refresh Android gallery after storing/deleting or updating a photo

When moving, deleting or renaming the images on Android’s SD Card, sometime the images are correctly removed but in the gallery still remain a preview of the removed image. When tapping on it, it is loaded as a black image. To resolve it, you need to run MediaScanner.

The craziest Javascript implementations

Javascript logo

Since its birth in 1994, Javascript has come a long way. Today it’s one of the most popular programming languages on the web because of high popularity of AJAX based web-applications. Also the rise of micro-frameworks such as jQuery (also Prototype, Moo Tools etc) which have reduced dramatically the complexity of code developers needed to write, it is well tested, has a ton of plug-ins, has a large development community and reduced development time.

Coolest Arduino projects

Arduino BoardArduino is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software. Due to it’s low price tag it has become extremely popular among artists, designers, hobbyists, and anyone interested in creating interactive objects or environments. Arduino hardware is programmed using a Wiring-based language (syntax and libraries), similar to C++ with some simplifications and modifications, and a processing-based integrated development environment.

DomPDF and buggy table colspan rendering

DomPDF (version 0.51, also version 0.6 beta 2) doesn’t display table rows properly when colspan is being used. There is no solution or bug fix for it from DOMPDF right now, cellmap­.cls.php which is responsible for table generation is buggy and calculating or rendering the table rows wrong.

Replace WordPress wp_list_categories “no categories”

By default, if you list WordPress subcategories and current category doesn’t have subcategories, it will say “no categories”.

You can change it from category-template.php on line 419, from

How to find highest z-index in the document with jQuery

I have created a small jQuery plugin to find the highest z-index of elements in the document.
Useful for making a new element appear absolutely at the top of all elements.

 function largestZindex(element) {
	var allObjects = $(element);
	var allObjectsArray = $.makeArray(allObjects);
	var zIndexArray = [0];
	var largestZindex = 0;
	for (var i = 0; i < allObjectsArray.length; i++) {
		  var zIndex = $(allObjectsArray[i]).css('z-index');
		  zIndexArray.push(zIndex);
	}
	var largestZindex = Math.max.apply(Math, zIndexArray);
	return largestZindex;
};

Why Android Market still sucks

Android MarketAndroid Market has been opened for customers and developers since October 2008. When Google launched the Market it was absolutely pathetic. Luckily ever since the Market has improved a lot. It is still not ideal today, but it’s still a vast improvement compared to the launch. Luckily unlike the iPhone, Android users are free to download apps from sources other than official Android Market.