Android is a truly terrible software development platform
twitter.com
twitter.com
For example, I once wasted two days getting an app startup logo to show with the proper size and aspect ratio on versions of Android used on phones sold 4 years ago, through the latest version. You define the logo in the manifest file. The interpretation of the logo settings changed three times over those API versions, with features added and removed. So a config that works in Android API 18 doesn't work in 20-21, but may work on 23. Support for SVG was dropped and added again. And none of this is documented. The logical way to implement API changes is to version the API file and use a compatibility library that can interpret all supported versions and make them work on the phone. But Android is not built logically. It is built for Google's engineer promo process.
Nobody at Google gets promoted for making the thing easy to use, learn, or maintain. That's why Google puts out so many shiny dev tools that quickly rot. Unfortunately, we are required to work with Android.
You can just gate the upgrade of the app, so that customers on the older version can't upgrade.
---
AndroidManifest.xml vs code declared, the manifest in reality is very different. An "app name" isn't really something useful programmatically. Orientation can be handled programmatically, but you can declare app-wide support for what kind of orientation you support in the manifest.
One syntax is really a style preference. I don't mind using different tools for different tasks, and the manifest is very specific to a specification for the app store, not on-device.
Java vs C++, meh, I think the main idea is that Java is a better language for most people than C++. Especially whatever C++ version existed when Android first came out.
Low-power is kind of a bad argument and pre-mature optimization without real metrics. It's been pretty clear that the reason phones drain the battery is because of the screen, and background jobs hogging the CPU, not running the JVM. Maybe running some compiled binaries would be more performant, but laptop batteries kind of also suck.
Keyboards, yeah, a bit weird, but the idea is that you almost never need to interact with the keyboard, you interact with elements that the keyboard injects into, since people can swap and use custom keyboards and other ways to enter text like dictation or accessibility modes.
Very true that all of this is not newbie friendly though. Shockingly bad really. Especially the status bar APIs.
Save State and process death is also a hilarious one that's underdocumented and confusing to new (and experienced) developers alike.
But god forbid you step away for 6 to 12 months -- rebuilding my once happy app becomes literally the only thing I'll be blowing a day on getting to work again.
Often times I'll just say fuck it and reinstall Android Studio from scratch.
The joy of it all is gone for me.
And then on top of all that, you never know when Google will decide your app (that's been on the Play store for years) is suddenly in violation of SOMETHING and pulls the plug without an explanation, ignoring appeals. (Had this happen to me a couple times.)
With no interest in iOS, and no real alternatives, all that adds up to me eventually retiring from mobile dev in general. Dammed shame, because I had some fun for a while.
In emscripten I can do:
emcc hello.c -o hello.html
...and this gives me a complete 'web application' ready to run in the browser.With the Android NDK I should be able to do this:
ndkcc hello.c -o hello.apk
...and this should give me a complete APK ready to run on the device. Emscripten's emcc is just a "simple" python wrapper script which looks like a gcc-compatible compiler/linker from the outside, but does additional things besides calling the C/C++ compiler and linker (such as creating a .js and .html file next to the .wasm compiler output).If the NDK would have such a compiler wrapper script it would be absolutely trivial to integrate with any existing C/C++ build system.
Another idea the Android NDK should steal from Emscripten is how to integrate the C/C++ side with the "other" side (in Emscripten's case Javascript, and in the NDK's case Java). In Emscripten I can simply embed Javascript code into the C source files with some macro-magic, and call back and forth directly between C and JS. This is how the Java integration should work in the NDK. I shouldn't have to deal with the JNI or with the Java toolchain or with .java files at all.
I believe it's more developer-friendly in the long run to be able to do configuration from in-band in the same language / environment the application is running in vs out-of-band config. Spring config has become a good bit more manageable now that it's in doable Java (or Kotlin) rather than only XML.
Both in-band and out of band could be offered, it wouldn't have to be a hard cutover anyway.
I 100% agree that Android is by far the worst platform to develop for though, at least when it comes to native code.
https://github.com/floooh/fips/blob/master/tools/android-cre...
Naively, I would guess there's a bunch of free libraries you have to import provided by Google or whoever owns Android, and those expose things like `AppWindow()` and `Input()` and `Camera()`. Am I even close? Is this nothing like what one actually does to make an Android app? Is iOS somehow better?
I have no reason to make an app, but I'm considering just looking for a "Hello world!" tutorial and following through just to understand what makes it so notoriously challenging.
You think you can depend on basic stuff like fopen, but it doesn't work like you expect it to. Its a minefield.
If you are trying to make some simple "hello world" application its incredibly infuriating, because what should be simple is made so hard, not least by the platform keeps insisting that "you really should learn this other language"
And for the record: You should not know who Eskil Steenberg is ahead of time, but you are welcome to get to know me now. :-)
Eskil Steenberg
So it's really the same as a "computer-computer", but with a specific UI framework and peripherals like a compass, GPS, camera (as you mentioned), etc.
Where it starts to suck is the interface for interacting with all those things: So you want to access your device's location? Well do you want to use the cellular/WiFi network, GPS, or both to tell you where you are? Ok, you figured that out, now how fast do you want updates? Oh, that was more of a suggestion - what's the fastest we can send you updates? And so on.
And it's like that for almost EVERY. SINGLE. THING. Imagine someone sat down to develop a mobile API, then got bored halfway through and decided to just leave the rest as an exercise to the user. And then some other people decided to come along later and add "improvements" (i.e: what Apple is doing) to the mishmash of existing "stuff", and you basically get Android development.
Yes, iOS is better, at least in my opinion. It's hard to pin down, but you get the sense that at least they designed it for someone who actually wants to write an app.
Given its a mobile device with battery limitations, those seem to be reasonable inputs to want for an API?
I am no longer curious about making an Android app to better understand the headaches. Thanks for saving me from that :-)
On the Android side it seems like there was a huge push for documentation some years ago but due to the sheer size and scope it seems like many things just never got updated and new things got the "Gotta go Fast" treatment. It's always very frustrating reading an official "How-to" article telling you to do one thing and when you click through to the underlying system's documentation you notice that this is no longer how you do it.
On the iOS side I can't understand how anyone figures out how things work. Maybe veterans know enough to decipher 4 word descriptions of a function argument and a random list of exposed function names but I certainly can't. e.g. How anyone figured out how ReplayKit works from the "docs" is beyond me. There is a WWDC video and hopefully some sample code you find in some repos but good luck with that...
I can forgive a lot of peculiarities of a system if I can at least figure out the what & how in the documentation/guides.
There are documentations for rather complex systems that I thought were absolutely amazing, e.g. the MS Hololens. So it is at least possible.
I resorted to the "graphical language" MIT App Inventor. App Inventor might be clumsy and awkward, but nothing is as bad the Android environment and "tool set".
- Me, 2020
How so? I enjoy that on Android at least I can fix things manually or some open source contributor will soon jump on it to fix it for me. You have to wait for Apple to fix things.
The open parts can take literal years to get a fix merged and deployed, so "some open source contributor fixing it" happens very rarely and isn't something you can rely on. Even when that happens, if the bug was in the core SDK instead of in one of the support libs, you'd have to wait like 5 years until most users get the fixed version of the code on their devices.
Hmm different people, different experiences. I work as an Android developer, an in general debugging on the devices works easily.
Android Studio works fine with my testing devices: Samsung, Xiaomi, Pixel, both on Windows and Mac machines. Just plug the device and Android Studio will automatically detect it.
Probably the last time debugging on the device didn't work was when I had a Nokia (6??). No matter what driver I installed, Android Studio didn't detect it. I gave up.
If instead ranting on twitter, he actually bothered to learned, it would have found out that virtual machine is long gone and now a mix of JIT/AOT compilers are used.
Also not allowing full blow applications in C or C++ is exactly the kind of stuff we need to move the security of our devices forward into the future.
While Android development has several issues, these random rants aren't it.
I'm intrigued; please do! (I'm an iOS developer... and definitely not a fanboy.)
iOS development: API has a bizarre malfunction. You are screwed.
Both: You have a bug free app. Until 3 years later, when half the stuff you used is suddenly broken in the OS, the other half is deprecated.
give me a break
You also don't have such a rich ecosystem of third party libraries. For example, I think there's still no implementation of native ads for major ad networks, which can be a deal-breaker if you're working on a large consumer-facing app.
Regarding native C/C++ interop (thank God I no longer have to deal with this!), Flutter has dart:ffi. I'm not sure how it compares to JNI, but it can't be worse. In practice, you'd still end up dealing with the horrible NDK toolchain on Android, though.