Image for post
Image for post
Photo by Isis França on Unsplash

GreeDao is one of the fastest and most efficient ORM libraries to access the SQLite database in Android. But as of now (Aug 2019), it doesn’t support saving a simple list of data in the dao object table.

A very simple use case that I had was to save a list of string in my Dao object table class. One possible way to save that list is to have a one-to-many relationship between two tables but building such a relationship just to save a list of String (or some other object) is too much of a work.

Fortunately, a much easier way to do that is to convert the unsupported data into something that GreenDao supports already. In my case, it was to convert List<String> into String while saving and vice-versa at the time of retrieving it back. …


A Gradle plugin could help your SDK users in integration.

Image for post
Image for post

Objective

It happened to be that when we @ M800 were developing our new SDK, we needed some configuration file to be added to project root by the app developer. This config file will then be processed by our SDK, so we can initialize it properly. Something like what Google does with google-services.json via a plugin:

apply plugin: 'com.android.application'

In this article, I’m going to explain about building a very simple plugin which will read a json file and build some Android string resources from it.

Motivation

Truth be told, none of us here had any experience building a Gradle plugin before, so I was entrusted with the research and development task. I was driven by the excitement of building and learning something new. …


The primary role of a service is as a flag to the operating system, letting it know that your process is still doing work, despite the fact that it is in the background.

  • A service runs in your application’s main thread so any sort of blocking operations should be done by making and managing new threads within the service.
  • They don’t have any user interface and can perform a wide range of tasks like downloading big chunk of data, maintaining a constant connection regardless of the user is using the app (telephony or chat), play music or doing periodic updates all while running the background. …


You can clone this project from this Github repository.

What’s the motivation?

As I was working on my app update (Earthquake App), I realized that the native JSON package available in android sdk is just not good enough in terms of performance and memory consumption. So, I started looking for some other option and very soon I found myself in a hard place deciding between GSON and Jackson (most popular JSON parsing libraries in java).

As my use of JSON parsing is very performance centric, I kept on searching until I stumbled upon LoganSquare (a relatively new library) which claims to be the fastest JSON parsing and serializing library available for Android outperforming GSON and Jackson’s Databind library by 400% or more.

About

Shahrukh Ahmed Siddiqui

Software Engineer @ Lalamove | Android Apps | SDK | Shutterbug | Dreamer | Thinker www.shahrukhamd.com

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store