PrimeDroid
RSS Feed

Articles

  • RxJava Introduction

    I had promised to publish one blog post every two weeks, but since I published my last blog post, I switched over to a new job and the last three months have been a lot of fun but busy adjusting to my new job and co workers. However, I feel like I may have settled now and will resume my blogging efforts. Today’s topic is not specific to Android but to reactive programming. As such, this post will be the first in a series of posts on RxJava for the foreseeable future. I want to really nail this topic down, because I see functional programming the way of the future, so let’s put in some topics around it.

    Read More »

  • Dagger

    Dagger is a very popular dependency injection library created by the team at Square. Although Jake Wharton is associated with it, he has mentioned in his talks that the idea and initial development for Dagger was done by Jesse Wilson and Bob Lee (these two were also involved in the development of the another popular D.I. library - Guice at Google). Dagger uses a Directed Acyclic Graph(DAG) to map the different creational classes and hence the name DAGger. The folks at Google advocate against the use of DI frameworks on account of these frameworks using reflection and give example of Guice. However, Dagger was designed to avoid this issue and does not use reflection at all and instead uses static dependency to build the ObjectGraph. To be honest, I don’t know understand everything of what I have written in the last two sentences, but it just sounded so cool and so trustworthy that I felt inclined to use it. Once I started using it, I realized the awesome power especially as my app grew. We will be using Dagger 2 for this tutorial.

    Read More »

  • Handler Thread

    If you have been an Android developer for sometime, no doubt you follow the gospel - move heavy duty processing stuff to a non-ui thread. This is because if you do heavy operations such as networking, image manipulation, the UI will be frozen, possibly leading to an ANR message…argggh. You will need to perform the heavy operations on some other thread and then communicate the result to the UI thread.

    Read More »

  • Sync Adapter

    Without doubt, your app will communicate with the server and fetch some data for the the users to view, unless you have some extraordinary idea that is self sufficient within the app. Most likely, you will end up making frequent server calls to sync data. Here is where you will find the Sync adapter useful. For the Sync adapter you need an Account authenticator, which I have explained in my previous blog post. If you have not implemented an account authenticator, please do so. For someday when you end up sitting across Larry or Mark from you know where, you will thank me silently for the extra couple of billions that feature adds to your deal. I take 100% commission in the form of retweets and likes.

    Read More »

  • Account authenticator

    Let us start at the beginning. You have an android app and want to allow users to create an account on your app. You might think about storing the user identifying token in shared preferences or sqllite DB, or just make a server call every time. There may be some solid implementations for these, but Android actually provides a mechanism for account creation and management. So let’s make use of it. But how? This is what grinds my gears. The documentation is sparse in my opinion and if not for some good blogs (mentioned at the bottom) I’d be stuck too. So this is one more attempt at demystifying the Account Authenticator.

    Read More »

Santosh Astagi
Santosh Astagi

Android developer.

GitHub Twitter Email

TOC