Creating an app for Android Gingerbread in 2020

Whatsapp has officially revoked support, Google says 0.2% of devices accessing Google Play are still running it. I explore the difficulty in targeting a 10-year old version of Android.

Step 1: Search the internet

Maybe I’m using the wrong search terms but this is a bit of a bust. Google likes to showcase new shiny things. My search did come up with the above information regarding Whatsapp and also Google removing support (if you want to target the Play Store) but how do I do this for just my phone?

Step 2: Just go for it

I am using Android Studio. What if I just choose Gingerbread in the settings from a new project? Will it work?

Ok, it turns out that I only have lowest Android 4.0 (Ice Cream Sandwich)
I need 2.3.3 (Gingerbread)

Let’s check the SDK settings in Android Studio – I am sure I installed all the correct target libraries years ago, what is the problem?

SDK tools says Gingerbread is installed. Google says no!

Step 3: What happens if I plug the phone in?

Android Studio and ADB recognise the device. API level is 10. OK in my new project I go to build.gradle (why are there two, couldn’t they just call the one you need to edit something else?) and change API level to 10 (target, min, compile) – now what? Wait some hours while Gradle does it’s magic. I’m waiting for my laptop to be depreciated by Android Studio to be honest, it’s such a resource hog! (pro tip, if your laptop is running too hot, check out cpulimit on the command line. Or just get a job and buy a new one..)

This is turning out almost as bad as React Native, which I had a look at the other night – 1 hour to get to a “Hello World” app to work. Admittedly I was installing the framework from scratch…

So far so good, Gradle hasn’t thrown any errors, I’m installing the basic Gingerbread app now…

Oh snap! ConstraintLayout not supported on Gingerbread. Do I want to override this warning and install anyway (or use another layout, what did people use for Gingerbread back then?

Install anyway Gradle lets find out if I can get this thing to run. I love ConstraintLayout, most of my apps use it!

Ok nah, Android support v7 library has moved past the whole “Gingerbread” thing (AKA they DEPRECIATED it). Time to start again – I may need a new test project..

Support v4 library has minimum API 14, same as Support v7 library.

So far no luck compiling anything for my old phone with Android Studio.

Let’s Try Github

There’s loads of old code on Github, clone and install something from +5 years ago when Gingerbread was still supported?

OK success. I went and imported a project (https://github.com/andmatand/knitknit-gingerbread/) 44 commits, somebody put some time into this knitting tool for their girlfriend (it says so on the readme)

Then I had to specifically choose not to use the latest versions of libraries, add maven (all guided by Android Studio) and voilla. The thing installs.

This is pretty hit/miss. But as a proof of concept I will take it. I want to use my old phone for something, maybe as a streaming webcam, we used to use it as a baby monitor when my son was little. Now I can make my own apps for it.

Next up: Installing Ubuntu on my S3 mini (using PostmarketOS) and running some good old c – and is there any point in doing this if you can just install Termux?

Whatever happened to processing.js

I have mentioned this before, Processing is the greatest tool to code for me because it provides easy access to so many creative coding options. The main reason I love it so much is because it is cross-platform. I use the same code on the web, desktop and mobile apps (Android).

Now one of those options is less accessible for many new coders. Namely, processing.js.

What is processing.js?

If you don’t know, processing.js is simply a way for your processing (JAVA) code to be translated into JavaScript and run in a browser canvas window.

Why is it cool?

I love processing.js because it’s the easiest way to use the same code and get web-based sketches running on my own server. Just include a processing.js file and the processing sketch (with a tiny bit of html) and it works.

What to do now?

Processing wants us to start using P5.js which is the functionality of Processing but using JavaScript syntax. I am mainly an Android and Java programmer, so for me this is an unnecessary step (mainly involving changing all int’s and floats to var) and I personally will continue using processing.js.

But they took the website away!

Now we come to the reason for this post: they took away the website! If you try and go to processingjs.org website now you will find it’s been taken down by the maintainers. Only the github code is left for posterity. Well luckily there is always the wayback machine: https://web.archive.org/web/20180510071709/http://processingjs.org

Processing.js is alive and well. It’s still working on my site, you can see a load of them all over this site, and on my cv even.

Google Play Store Says NO!

Google Play Store is the portal through which all successful Android Apps have to travel, in order to reach their audience. The last two Apps I tried to upload there were refused, one on the valid grounds of being just a web view. The other, most recently was mistaken by what I can only imagine is an AI to be an Augmented Reality App.

Here is the offending app. Apparently I need to notify people about the confusion that augmented reality can cause. Is this Augmented Reality?

Well try the app out for yourself and see: https://circusscientist.com/SwipeCard.apk

I have changed the age limit to over 18, hopefully this will get my app accepted. Otherwise the only recourse is sending an email to request a review (probably from a bot)

Legal Animation

A friend who is a graphic artist contacted me, he has a client who is looking for some complex animation of legal transaction history, to illustrate corrupt dealings I imagine.

Anyway, here is the work I’ve done so far.

Hypothetical scenario: There are some terrible things going on at Google, FaceBook and Monsanto. Not to mention the USA, what are they doing with their finances? Check out the attached video to find out!

Corrupt Companies and dodgy dealings

Think I am going to get the gig? At this point I am enjoying creating this program enough not to care.

For those who are interested, the data comes from .csv files – transactions and accounts. Also there are different types of transactions, indicated by a different coloured line. Still a lot to do, but I’m quite proud of this one.

Android for Africa!

Living in Africa is absolutely analagous to living in the old wild west sometimes. Just driving to work here can be a life threatening proposition some days. Protests, cash-in-transit heists, blown up ATM’s, hijackings and street beggars at every traffic light all threaten to disturb ones peace at any moment.

A bit like running Android on your phone really. That is unless you are up to date with the latest patched version. Which runs on precisely two devices as far as I am aware. The rest of us are left to make shift in yesterday’s abandoned OS graveyard, where the bad guys have their playground.

Privacy concerns? First world problems! Just be thankful that nobody screen captured your banking app today – while slowly cooking your phone casing with illicit cpu bitcoin mining cycles.

From a development perspective the OS is no better, a dictatorship with a fickle overlord. Time to change your code again, unpack and repack the activity car, it’s an API roadblock. Pay the play store compliance tax now or try your luck on the sideloading second economy, where your cloned apps beg at the same alternative app store intersection as you, with a flashy ad platform sign held high.

Gotta love Android. It’s the wild west out here. Android for Africa!

 

Smart Poi Emulators

Two emulators are featured here, the first takes all images in a folder and shows them in sequence, as they would look on the spinning poi:

 

The second program receives RGB values from serial connected poi chip and displays on screen. This is showing what is actually being sent out to the LED strip, useful for testing – I was getting a bit tired of spinning the poi whilst programming them and the Android transmitter app at the same time.

The image below is of the computer generated default offline patterns, but if wifi sent images are available it looks somewhat similar to the above. Colour is not yet optimized.

 

For the serial sending to work on the poi, a fairly large change in code is needed. The serial necessarily slows everything down drastically, so it’s for testing only.

What it’s really like to be a developer

The long road to Smart Poi, visualized:

In order to make this video I used a program called gource. It takes your Git commits and creates an infographic video automatically. I modified the programmer avatar using the –default-user-image setting.  If you want to see something spectacular, check out the linux kernel gource!

Android Development Overview

For Android I started off using MIT’s app inventor:

http://ai2.appinventor.mit.edu/

This was fun and I had some success with a few projects, however as a touch typist I am always more comfortable using the keyboard. As I was already using the amazing Processing IDE for desktop Java apps,  Processing for Android was the next step:

https://processing.org/

Of course there is no substitute for the real thing, which is what I am using most often now, Android Studio. Processing for Android provides a handy tool for exporting sketches as they are called, so the transistion is pretty seamless. Android Studio is a huge IDE with bells, whistles, mags and stickers attached. Learning how to use this beast is going to take a long time, especially with Google pulling out the rug (ie changing everything with each new release) every couple of months.