Android Developers needs to be creative

Bal sikandar
MindOrks
Published in
3 min readSep 16, 2019

Let me say this first, This post is gonna expose how I work sometimes, Well maybe we’ll do. It’s easy to get started with Android but sooner or later we’re gonna get a problem which will be a little tricky to solve. This is the beginning of a series and I'll keep adding another story every other week about my out of the box solutions and if you also have something do comment or write about it🤓 😎.

Anything is fair in love and war and Android development(Coz the competition baby😜).

Problem statement👹

I was working on a keyboard app which had more than half-million DAU(Daily active users) but it wasn’t being reflected on the dashboard of Third-party tools like similarweb, SEMrush, etc.

Description:

Technically, Keyboard apps are services because they’re built using something called InputMethodService. Even if users are interacting with keyboards app there DAU may not be counted by tools like similarweb. Although our own analytics had the right numbers but it’s hard to convince third parties like investors to trust you since they prefer these independent tools.

How similarweb works?

I’m gonna keep it simple, Similarweb ask apps with good DAUs to add its SDK in their projects for money. So if even one app in your device has their SDK, they can track, session count, session time etc by using their background service. More importantly, they track foreground UI components i.e Activity, fragment not services so no keyboard apps and god knows why.

Solution 😀:

Sorry for making you wait or not since you already skipped to this point. Anyway, since it was a keyboard app users used it hundreds of time every day so we came up with an idea to launch an Invisible Activity for 200–300ms and then finish it. Simple right? It was. You don’t need complex algorithms to solve every problem. The way we did we opened Invisible Activity only once or twice each day when a user was closing keyboard so it didn’t hamper user’s experience. BTW we had the right to do it since people were interacting with our app like any foreground app.

Result🎊 🎉

It worked. Within a couple of months, numbers improved on these third-party tools.

Technical Aspect

Invisible Activity:

An activity without setContentView(R.layout.mLayout) Below is the code to do it.

Mr. India Activity.

Also, add a transparent theme for this Activity in Manifest file

android:theme="@style/AppTheme.Transparent"

Invisible Activity is good stuff

I have since used it again for few things like Deep linking for eg: when you click on a deep link you’re taken to splash or other screens which redirects the user to the targeted screen. We didn’t want a user to show this intermediate screen so we used it and come on doesn’t splash feels like an eternity.

Thanks for reading this article. Be sure to click 👏 to recommend this article if you found it helpful. It means a lot to me.

Also let’s connect on facebook, twitter, github and linkedin.

Clap, share if you like it and follow me for my next move.

--

--

Bal sikandar
MindOrks

Android developer @shuttl Ex @_okcredit. Blogger | Open source contributor https://about.me/balsikandar.