My experience with Android development
So I wanted to make a real time push notification app for VU. Looked around on the internet and there where plenty of tutorials. Great! Lets get started!
First I needed to have a Google API key for the push notifications. Yeh, all push notifications need to go via Google. I could probably setup my own socket and make the phone wake up in intervals to keep the connection alive. But it would probably take several hours to get it to work, so I paid the $25 registration fee for API access.
Install Java SDK, Install Android SDK, Install Android studio ... Android studio is like 5-10 GB is size! I wonder how the hell a program can get so big. But hard drive space is cheap, right?
Made a hello world app in Android studio and it worked! (in the emulator). Then I installed the demo of real time notifications. But it didn't work! And I had no idea what all those files did.
So I thought, fuck this Java shit, and installed Cordova! Plugged in an old Android phone to the PC and tried to get a hello world program to run on it, and it didn't work. It appears my phone was way too old for Cordova.
Then went back to Android studio and tried to get it running on my phone from there. After some Googling I found out that my phone's Android version was 10, and was not supported by the Android SDK on Windows.
No problem! Lets boot into Linux then ...
Also, I thought; lets do it for real this time in the command line interface and no bloated IDE.
Developing "enterprise" Java means boilerplate, lots of code and files to achieve even a simple thing like hello world.
First you need a bunch of XML files: Every damn string needs to be placed in a XMl file. I do think it's a good idea to separate GUI and code though, and if you are gonna translate your app into different languages you need to place all strings in some-sort-of XML file anyway.
Then there is a compile step, which I'm not a fan of. Did I say one step? Ha ha, this is "enterprise". So first you need to fetch the Android SDK Java files and compile them together with your own Java files. Then you have to compile them all to Android VM code. Then package them. Then sign the package, compress and optimize the package. And then finally upload it to your phone to see if it works.
A bash script took care of that though.
Now I had some other work to do and today after a few weeks I had time to work on the Android project again.
But when I tried to run the bash script for all the compilation steps, it didn't work! After some research I found out that my Java version had upgraded.
Went to Oracle to download the old (deprecated) version that I needed, but had to register to get access to it. I'm still waiting for that registration e-mail so I can download the damn Java SDK! Then tried to follow some guides on gradle, but that wasn't very helpful as none of the "gradle magic" worked.
Written by Johan Zetterberg May 4, 2016.