Android Libraries & How Android Has Kept Me In Love

My love for Android is never ending. I've thought of putting a complete halt to all Android development over thrice in the last year*, and haven't been able to so far.
One major reason is the sort of things Android allows people to come up with! The endless number of libraries, both for UI, or development. Here's a list of super useful libraries you may not have heard of.

Android Annotations
I stumbled upon Android Annotations about an hour ago, and I'm hooked. It's an Android library that helps in making code smaller and easier to read. True. Android is based on Java, and we all know how Java, unlike Python likes things big and explicitly written.
Annotations are those '@' marks followed by a keyword you see above method or variables in several languages. ButterKnife uses them to inject views instead of writing long lines of the same code. Annotations are also used to mark methods like so - @Override.

Android Annotations takes this to a whole new level. In Android, you are forced to write long repetitive code, because of the way it is written. They've tried to eliminate all of this by allowing you to mark annotations wherever possible, and auto-generating code with the marked annotations. Have a look at the list of annotations possible - it's endless! RestAPIs, sharedPrefs, View/Res injection, Threading, Event Binding, f#*%! I can't wait to try this out! This completely changes the way you'd develop apps. I'll probably try writing a small app using Android Annotations, and comparing development speed and readability with normal code. That'll be fun :D - I'll put up my results here.

SugarORM
Oh sugar, you don't have to be so sweet. (Hahaha, song from Begin Again).
I strongly dislike the way databases are created in Android. They're plain tough. Plus - it increases the number of classes and you end up copying code from the last app you made every time you create a new app that requires a db.
Sugar however! Sugar makes life as simple as can be. It allows you to create a relational database - you declare the datatypes of each column as member variables of a class that extends SugarRecord. Create an empty constructor, a constructor of the table you'd like to create, add meta-data tags to the manifest, and voila! As a general practice, I create public static methods to query the database. This allows me to debug with ease - all database calls are made through one class. I'm going to write a blog post on how to use Sugar. The examples in the documentation suck, and is a kill for the library - it took me forever to understand how to query. But I've used it in all of my apps now - LifeHacks, Memions, DAWebmail, LensLauncher, Perplexy.

LoganSquare

JSON parsing can be a pain sometimes. It's boring again, is a lot of repetitive code. If you're using Volley instead of Retrofit, chances are you have to write code to parse JSON on your own. Also, if you're planning to save static content in a file and read data from there, normal parsing can be slow. LoganSquare makes it bolt fast. Not kidding. I've used it for Perplexy - We're running the parsing on main UI thread, instead of running the parsing method in a background thread - that's how fast it is.

EventBus

In short - intra-app pub-sub model. Works similar to Observable and Observer classes in Java, but is much much more. I was forced to use it for a research project I worked on - GPSLogger, and that's when I understood its beauty. This library isn't useful for all apps. Most apps have a singular direction flow. Apps like GPSLogger which work on several callbacks, interfaces and broadcast receivers, you simply can't create that many callbacks everywhere. This is where EventBus comes handy.

Picasso

Everyone knows this library. Everyone. I still have to mention how amazing it is though.
I've used it in every app that loads images from an online URL.

Other popular libraries I've used in the past.
Development Libraries

  • Butterknife - every app, every time.
  • MaterialDrawer - for all apps that require a drawer.
  • Volley - for all apps that require calls to an API. I do not prefer Retrofit. Maybe I just haven't given it enough of a chance. I should though.
  • EasyGCM - I haven't used this before. But I hope it's amazing.
  • In App Billing - Again. Looong code, shortened. I tried using it, and it worked. Then I decided I don't want in app billing. So :P
  • InstaCapture - Taking a screenshot of the screen. I used this in When God Created You! (The app sucked, agreed hahaha)
  • Bluetooth libs - There are infinite. Use any. They're all amazing. I still haven't made a multiplayer game on Android. Looking forward to do so via bluetooth.


UI Libraries

  • Material Dialogs - Drakeet and Afollestad - Every single app.
  • SwipeStack - I was one of the first ones to star this library, haha :D
  • Material Stepper - Useful for step wise tabbed actions.
  • Material Tip - A simple dialog box that opens from the bottom. Amazing nevertheless.
  • MPChart - Needed these to make graphs when I worked with Anirudh. We connected a hardware sensor that transmits data through the audio jack and displays neat graphs.
  • TimeLine views - I or II. I've used these for explaining how to use the app. It works well.

Try to think of the reason of the number of libraries created in Android.
One is because well of course, someone's made a modular component that can be included in any app - perfect. These are generally UI elements, fancy dialog boxes or new Android Design components.
The other reason for the vast number of these libraries is to reduce the amount of code you have to write. A lot of it can be auto-generated and is repetitive in nature - which becomes very boring to write once you've mastered the basics.

I haven't yet made a library - I really look forward to making a super useful one soon though - it'd probably to ease development than making a fancy UI component.

*Summer '15, after my internship at Tesseract, I promised myself this'll be the last time I ever work on Android. I continued making apps through the next semester. December '15 I got the chance to work with Anirudh Sharma, and we worked on a really cool hardware-software combination. I also made an app to fly a quadcopter through voice commands using my Android. I then told myself, 2016 will be the year I won't touch Android at all. I made Life Hacks and Memions. These apps worked out quite well and gave me hope to continue putting apps on the Playstore. But then I said, alright. Summer '16. No more apps. Not at all. The final vow. Aaaand. What do you know. I found Lens Launcher to which I contributed heavily. I'm not sure if this is a bad addiction.

Comments

  1. You also worked on the GeoSpat app :(

    ReplyDelete
    Replies
    1. Haha, yes. GPSLogger here - https://play.google.com/store/apps/details?id=com.crearo.gpslogger
      I'll probably blog about this soon. :D

      Delete

Post a Comment

Popular posts from this blog

[Breaking News] AI takes over universe to calculate Pi

Firebase Auth | The Debug vs Release Signature Problem

Cold Showers