Image for post
Image for post

Sometime after Redis came to the rescue (https://bit.ly/3mrGSdu), another chapter was opened in this journey of Redis. There was a need to store a key with an associated value which by definition resembles a simple set operation.


SET key value [EX seconds|PX milliseconds|KEEPTTL] [NX|XX] [GET]
Available since 1.0.0.Time complexity: O(1)Set key to hold the string value. If key already holds a value, it is overwritten, regardless of its type. Any previous time to live associated with the key is discarded on successful SET operation.https://redis.io/commands/set

Creating “top-level” keys comes with these advantages

  1. Redis does not support nested types…


Image for post
Image for post

Once upon a time, there existed data that lived peacefully in a pgSql database. This data belonged to over 1 million unique users who’d access via mobile or web. This was mostly ok with response times between 1 to 5 seconds. This database contained a trail of user events, users request data with an identifier then the service queries the database to retrieve information associated with that identifier.

All seemed fine, but what would happen if a lot of users showed up at the same time requesting for data, what would happen if the number of events per user doubled…


Image for post
Image for post

Just started taking a look at the MapReduce paper written by Jeffrey Dean and Sanjay Ghemawat ( https://static.googleusercontent.com/media/research.google.com/en//archive/mapreduce-osdi04.pdf). Just thought it would be fun to write a basic implementation with Kotlin Coroutines.

What are Coroutines

Essentially, coroutines are light-weight threads. https://kotlinlang.org/docs/reference/coroutines/basics.html

kotlinx.coroutines is a rich library for coroutines developed by JetBrains.

Let’s get started. To use Kotlin Coroutines:

  1. You need to be running Kotlin version > 1.3.0

2. You need to add the coroutine library as a dependency in your build.gradle file.

Now we have the Coroutine library added lets start our mini map-reduce.

Map Reduce

A MapReduce program is composed of

  1. A…


There are hardly any android apps built without forms. It can be daunting especially when you have forms all over the place. Usually they lead to never ending xml files or really long xml files. And then there is the case where the form contains other elements which are not inputs eg info cards, images etc. Most at times we will just repeat the form code in all xmls that they are needed in or probably use the include tag (but there is no for-loop for (not that I know of though.)). We have already achieved component reuse by Componentization…


Ogya is a set of tools for quick android development. It gives you a consistent way to display dialogs and load lists with only one recycler adapter. The adapter can handle multiple view types.

If this is your first encounter with Ogya. Then please read this

Image for post
Image for post
Componentization with Ogya

With Ogya we have the power to use one listAdapter for all. However the binding logic was coupled with each instance of the listableAdapter. This led to duplication of code , especially if you needed the same list item in multiple places. Componentization helps us build reusable components that behave exactly the same way…


Image for post
Image for post

Ogya

Ogya is a set of tools for quick android development. It gives you a consistent way to display dialogs and load lists with only one recycler adapter. The adapter can handle multiple view types. Do more with less.

Usage

  • Enabled android data binding
android { 

dataBinding { enabled = true }
}
  • Add it in your root build.gradle at the end of repositories:
allprojects { 
repositories {
… maven {
url ‘https://jitpack.io'
}
}
  • Add the dependency
dependencies 
{
implementation ‘com.github.billkainkoom:ogya:0.50’
}

Quick List (Listable Adapter)


Image for post
Image for post

Dialogs are part of android development, they are like really part of it. You just can’t do without them or maybe you could. But what if there was just this one dialog you could use for everything from confirmation, verification, information or progression (I really needed to finish the rhyming, but this means to show progress as in a ProgreesDialog).

Well I came up with one such dialog that , I call the QuickDialog.

Quick Dialog

Quick dialog simply gives you multiple consistent variants of dialogs you need in your Android App.

  • Message Dialog
  • Progress Dialog
  • Alert Dialog
  • Input Dialog

Quick Start


Image for post
Image for post

Like many new languages, there is always the hype part, where we hear a lot of news and read lots of articles about how great the language is. There is even a term for such stuff — Hype Driven Development (HDD) (I didn’t coin this term by the way). So Kotlin first appeared in 2011 (The name comes from Kotlin Island, near St. Petersburg and it was developed by Jetbrains). Heard of it some time ago but never gave it any attention. So when Google announced at Google I/0 2017 that it would have first-class support on Android, I knew…


Ever since Kotlin became a first class language for Android, I have not gone a day without hearing, reading or watching something about Kotlin. Not as if I do it intentionally — I just cant avoid it. Its just everywhere.

Image for post
Image for post

Ever since Kotlin became a first class language for Android, I have not gone a day without hearing, reading or watching something about Kotlin. Not as if I do it intentionally — I just cant avoid it. Its just everywhere. So I revisited my first story on medium, and well its Java 7(Yeah it is). …


Image for post
Image for post

So lets imagine you have a long math operation and you want to do something when you have finished the calculation. What do you do? Well in android its not advisable to do it on the main thread since that will block the ui and cause bad user experience. So being as smart as you are you define a function which does the computation on another thread and then when complete updates a certain textField or edittext with the answer.

I know you have heard of Java Interface, everyone has. You even use them in your App development all the…

Bill Inkoom

Software Engineer with great love for Mathematics especially Abstract Mathematics.

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