Skip to main content

Posts

Android APK Extractor

I have been working on Android since last couple of years and its really amazing to watch how SDK takes care of few brilliant stuff, like XML based resource mapping, Delvik class generator (.dex or .odex file). So, thought lets explore internals of APK file structured and create a APK parser . Somehow any Hex Dump fascinates me enough to explore its real meaning, crazy? this is how it is :-) I did google and found few solutions which require Android SDK AAPT (Android Asset Packaging Tool) to decode APK resource. So, I thought to create an alternate parser (independent of Android SDK) which developer community can use to extract content of APK. Android APK is a zip file, any ZIP parser/program can parse and extract its content. But this is the easy part, the tricky part is to convert resource files stored inside the APK (i.e. Manifest, Layouts, String.xml etc.) to plain text and convert Dex/ODex file to readable JAR. To speedup the run time processing of these resource files, AAPT e
Recent posts

Lessons Learned From My Weight Loss Journey (7 KG in a month)

  For last few years I was so much involved into building my Startup that I didn't realize my health is getting stretched and compromised . As you all know, running Startup is one of the toughest thing in the world and it demands a lot. In fact irrespective of your profession, busy professional life adds huge toll on our health. Unless you are careful, you'll not even realize that lifestyle balance is broken with excessive stress, irregular eating habit, junk foods, overeating and what not. Health is our biggest asset and as you grow older you realize it better. We can't change paste but we can very much control our future. So, decided enough is enough and lets loss excess weight, improve diets and Be Healthy! Thought to share this journey and learning to help others who may face similar challenges. I have crafted below method following multiple Blogs, Youtube channels (and adjusted as per my lifestyle feasibility) . I was 86+ KG when I started and reduced 7 KG in a month! 

Unit Testing and Code Coverage in Python

Unit Test is one of the most important part of development artifacts, which helps to automatically test whatever code we write. Coverage report measures quality of Unit Tests and points out unused/untested code. This tutorial will help to get started with Unit Testing and Coverage report in Python. For this tutorial we will use Eclipse PyDEV as Python IDE and its integrated Coverage plugin to generate Code Coverage report. Environment Setup: Install PyDEV Eclipse Plug-in. PyDEV comes with Code Coverage feature ( Show View - Code Coverage ) which integrates with python module " coverage " Install Coverage module:   # python -m pip install "coverage < 4.0.0" Coverage module higher than version 3.x doesn't work with PyDEV. Coverage report gets generated as binary file under- Workspace\.metadata\.plugins\org.python.pydev.debug\coverage\.coverage Sample Code:  Download sample code from GitHub . This includes a function (under /src ) to get ODD and

Android Looper and Toast from WorkerThread

Have you ever tried to launch Android Toast message from worker thread? Probably you are wondering why the heck it is giving this error- java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare() In this article we are going to explore reason behind the above exception and try to understand how Looper works in Android. At the end, I am going to explain one approach to run Toast from a worker thread, but before that we need to understand how Looper works. If you already know in/out of Looper, you can skip below section and directly move to the solution part. Looper is a very basic wrapper class which attach a MessageQueue to a Thread and manage this queue. MessageQueue is a structure to sequentialize simultaneous processing requests of a Thread.  In Android, message/request processing classes like Handler uses Looper to manage their respective MessageQueue. Looper = Thread + MessageQueue Android Looper Life Cycle: As you can see in the abo