Only way to learn something is to learn it by yourself.
Recently I have been playing with Canvas in android and it has been fun! 😀
As they say knowledge is knowing tomato is a fruit. Wisdom is not putting it in vegetable basket. And best way to persist new gained “wisdom” is to put it in use.
Practice Shapes is a fun app both for kids and grown-up kids (Yes. You!), to test their drawing skills. Though I know drawing on a mobile screen with your fingers is not your favorite thing, but still you will enjoy it! 😀
A polyglot developer will understand, there is always something you like about one language and you wish was available for another language too.
So, recently I started learning rails and found number_helper API very cool and fun to use. It gives you easy API to convert numbers into many formats like number_to_human which will convert 20000 to 20 Thousands or number_to_human_size that will convert 1024 to 1 KB.
That was it I wanted this stuff for Android too. It just makes processing numbers to fit the UI needs so damn easy.
Here is my attempt to port this rails module to Android.
It is always fun to play with new APIs and tools. GCM is not something I was getting my hands on for the first time but it changed completely since last time I did a project using this.
But the good news is it has changed for good. New service classes makes it easier to write GCM clients for Android, GCM default configuration makes writing test servers and apps to play with very less tedious. In fact my first reaction was this is GCM reincarnated.
If you ever tried to create an OCR app for Android you must have stumbled upon the OCR library by Google Tesseract. And then the problems began.
To use the library in your project you first need to build it. But building the library to be compatible with gradle, which is the new build system for Android projects is little not so easily stated anywhere in the library manual.
When I tried to build the library, it took me freaking 9 hours to figure all the how tos?
So, here I am helping you to save your precious hours. (Don’t waste these watching late night infomercials for god’s sake! ).
Here we go.
Step 1 :
The first step. Download the NDK. That is used to build the library.
Download it from here. It is around 300+ MB so keep your net plan nourished.
Step 2 :
Better way to go is to use a fork of Tesseract, Tess-Two. Tess-Two can be found on GitHub.
Execute following commands to build the library Tess-Two using NDK.
git clone git://github.com/rmtheis/tess-two tess
android update project --path .
We can live without building eyes-two for this time.
Building will take few minutes. After you have successfully built tess-two, give yourself a little treat. You are almost done.
Step 3 :
Now you are ready to use the library in your Android project.
Copy the tess-two folder (tess/tess-two), in the main folder of the application project.
Suppose name of your application is “MyApp” copy the folder at “MyApp/”.
Step 4 :
Now its time to play the trick. The library was build using ANT. But Android projects use Gradle these days. Interesting…
We need to add a “build.gradle” file at location “tess-two/”.