Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Android platform engineer on application architecture (plus.google.com)
220 points by EddieRingle on May 16, 2016 | hide | past | favorite | 121 comments


Unfortunately, the contents of this post are no surprise to any seasoned Android developer. It's very clear the Android engineers haven't given a lot of thought to how applications are to be developed.

I'm all for them not enforcing one methodology over another. However, in order to build an Android application (following whatever pattern) we do need core building blocks that have been well thought through on how they will be used.

In general performing Async tasks (in particular networking) is excruciatingly convoluted on Android - well, at least to get it right. Many inexperienced Android developers simply get this wrong, and quite frankly I can't blame them. Such a common task should be trivial to perform and not require hours of background reading.

The issue largely comes down to the fact the "system framework" has been designed to be simple (supposedly[1]) for system framework maintainers, and not developers writing applications. Destroying and recreating activities (so you can load different resources) may be simpler from AOSP's perspective, but it's not at all logical from the perspective of an application. Sure, there are several ways to work around this, but they're all stupidly convoluted.

Frameworks should be written for consumers, not maintainers.

[1] Okay, the system frameworks definitely aren't actually well designed / simple to work with for framework maintainers either, that was just the (missed) goal. If you want to see world's worst state machine (a stupid amount of booleans), check-out: http://stackoverflow.com/questions/17847775/nested-fragments...


You've hit the nail on the head. It's not the system engineer's job to develop a useful application framework for common use cases any more than it is a Linux kernel developer's job to do so. Still, it has to be somebody's job, and it's clear that it isn't anybody's job on the Android team. For example, there's a hacky HTTP client library built by the Google Play Android client team (http://developer.android.com/training/volley/index.html) that is promoted for general use for some silly reason, and to use it, you're supposed to copy the library's source code into your project. Pure amateur hour. There should be a team within Android building well-thought-out, properly versioned, and sanely distributed libraries to simplify Android application development. There should be, but there isn't.


You mean like the sets of support libraries which make multi-versioned Android development significantly easier and less time consuming?

I don't get the first-party library cargo cult that has developed on Android. What's wrong having the community develop libraries like on any other platform? There's a huge set of very good quality 3rd party Android libraries and even a great new language (Kotlin).

As a dev I'd be rather that Google focuses on developing quality core blocks which cannot be fixed by community. Sadly it seems that Google developers simply do not know how to build good APIs, even new ones like MediaCodec, BLE APIs, updated storage APIs and permissions are an utter hard to use mess.


"You mean like the sets of support libraries which make multi-versioned Android development significantly easier and less time consuming?"

You mean the ones that seem to change between Android versions, and get weird bugs between versions?

"I don't get the first-party library cargo cult that has developed on Android. What's wrong having the community develop libraries like on any other platform? There's a huge set of very good quality 3rd party Android libraries and even a great new language (Kotlin)."

Because those can't be counted on not to break between versions of Android.


There is no excuse for how hard the permissions API is to use. Why can we not know if the user has "never show again " checked directly? It literally looks like the API and ui came from different proposals


Because you don't need to know. Permissions are sacred. If you don't have the permission, consider the capabilities aren't there and move on.

How would you feel if Facebook or Instagram app refused to start if you didn't give it camera permission? Maybe I don't have a working camera in my Nexus 6.


Unfortunately, this is what Google's own app for the upcoming Google I/O conference does if you deny it access to your contacts at startup.

If you grant the permission only to deny it later, the app won't start again until you grant the permission again.

https://play.google.com/store/apps/details?id=com.google.sam...


That sounds horrible. I can't see a reason why they'd do that. Can you think of anything why this behavior happens?


The only real recourse against combat adversarial developers is to either trash the defective product in reviews or penalize the developers through other means. Holding functionality hostage in order to gain permissions should be instant grounds for rejection and/or further sanctions.


Android 4.4 and later uses the core of OkHttp underneath HttpUrlConnection, which is the library you should be using. If you want fancier features, or don't like using AsyncTask everywhere, just use the full OkHttp from Square and you'll get those.

Volley is just a small abstraction atop HttpUrlConnection, so I'm not sure why you consider it so hacky. It also is available on JCenter, so just compile it into your project using Gradle: "com.android.volley:volley:1.0.0". You're entirely wrong about having to copy the source into your project.


It gets even worse when you want to download files and run into the sordid mountain of bugs that is the DownloadManager library.


Not only didn't they give a lot of thought on how apps are to be developed, they made a bunch of really shortsighted design choices that continue to harm Android as a platform today.

First is the stupidity of Activities. The basic idea was that 1 screen = 1 activity and we can remove all non-active activities from memory and restart them as needed. This was clearly designed with an eye on memory constrained systems. Nowadays even the cheapest phones have shitloads of RAM but we're still stuck with this retarded model. Worse, now we have support for tablets and phones with big screens the 1 activity per screen no longer makes any sense anymore either.

Second, the decision to go with Java as a language. After they make us jump through ridiculous hoops to fit our applications into their stupid activity model just to save RAM, they go waste it by chosing a GC'd language, combined with the performance hit you take for the VM this this has really hurt Android app performance. In return we get an OS that can run in multiple CPU architectures, unfortunately no one runs it onanything other than ARM. The 0.01% of non-ARM devices can't run half the software anyway because they included ARM JNI components to work around the slowness of the VM.

But, I hear you say, you can supply JNI binaries for multiple architectures. Sure you can, if you can fit them in your APK, which you can't because your APK is limited to 50MB because it has to be downloaded to a temp partition before installing. This brings us to the thirds major fuckup: the file system on Android, or specifically the fact that there are several filesystems instead of just the one. But hey, at least now we get to support removable storage, which is both a PITA for developers, extremely confusing for end-users (why can't I install this app when I have gigabytes of free space on my SD card ?) and after all that trouble hardly any phone has removable storage anymore.

This seems to be the big problem with Android's development: a complete lack of vision by Google. They never designed for tomorrows hardware, instead they designed for last years hardware. Android is an OS built around hardware limitations that no longer existed by the time it gained momentum. It's like they were completely surprised by the speed at which mobile hardware evolved.


That seems very unfair.

Android invested up front in more complex technology that would allow adaptation to future hardware devices. Most obviously, by using layout managers instead of pixel positioning like iOS did. That meant Android was able to adapt to a range of screen sizes way earlier than Apple could. Every time Apple tried to introduce a new screen size or resolution it resulted in major pain across their entire app ecosystem, something many Android apps avoided.

Phones are still memory constrained. Yes they have "shitloads" of RAM compared to previous devices but they still don't have a swap file of any kind. The activity model allows phones to have an apparently infinite number of apps open, without the UI ever stalling due to hitting a paging storm like desktop apps can. Simply increasing the amount of RAM doesn't solve the problems the activity model was designed to solve, and it's worth noting that when Apple introduced multi-tasking into iOS, they ended up with something quite similar to activities.

The choice of Java had complex effects on memory usage. Whilst Java heaps can be kind of piggy, a lot of memory usage comes from loaded code, and bytecode is a lot more compact than native code is. That's why they're reintroducing JIT compilation in Android N - having moved to fully AOT when ART was introduced they are now going back again to reduce memory pressure.

The decision to support SD cards made a lot of sense back in the days when internal storage was a lot more limited.


> The decision to support SD cards made a lot of sense back in the days when internal storage was a lot more limited.

And it still makes sense today. See: Android One (and most other handsets targeted at the developing world), manufacturers adding SD cards back after dropping them (most recently Samsung) and so on.

Personally speaking, despite loving my Nexus 7s in the past, I'm no longer interested in tablets without SD card slots. Even if it were good for nothing else, it's easy to fill up a 128 GB or larger SD card with video and music I want on hand.


> Android invested up front in more complex technology that would allow adaptation to future hardware devices. Most obviously, by using layout managers instead of pixel positioning like iOS did.

Layout managers are complex technology now ? The layout managers Android uses are pretty much identical to what Java used in AWT and Swing and is trivial to implement. I know because I implemented just such a thing for a UI toolkit I made for J2ME back in the day. Desktop apps have been doing it for decades. iOS by contrast uses a much more complicated system (not saying it's better, just more complex).

Also, I vastly prefer iOS's sytem with just a handful of resolutions so you can fine-tune your designs to the exact screen dimensions. In practice I've found it very hard to explain Android's layout mechanisms to designers and to get good designs from them that scale well. Most designers I know prefer being able to make a pixel-perfect design like you can on iOS. Sure it works fine for business-style apps but if you want to make something spiffy, you're fucked on Android.

> when Apple introduced multi-tasking into iOS, they ended up with something quite similar to activities.

iOS has nothing even remotely resembling activities. Background apps can be suspended and possibly killed, but that's as far as the parallelels go. Don't even get me started on the insane idea of Intents (sounds like a great concept but horrible in practice and badly implemented too).

> The activity model allows phones to have an apparently infinite number of apps open, without the UI ever stalling due to hitting a paging storm like desktop apps can.

Then why is this not an issue at all on iOS. In fact, my 6S pretty much never kills background apps and even when it does that does not affect foreground performance. And if they were so concerned about the UI stalling, they should have stayed away from Java. It has improved a little bit but especially in the early days the GC would regularly freeze the entire JVM for 100+ ms. Try hitting 60fps like that.

> The choice of Java had complex effects on memory usage. Whilst Java heaps can be kind of piggy, a lot of memory usage comes from loaded code, and bytecode is a lot more compact than native code is.

Wut ? Loaded code is a completely negligible part of an apps memory usage. And again, not an issue on iOS. In fact memory is far more constrained on Android than on iOS even when Android devices have more physical RAM. Android severely limits the amount of RAM an application can use (the heap size limit). I've never run into problems with RAM usage on iOS and regularly on Android. On a 1GB iPhone you can easily use 700-800MB RAM for your app if you wanted, while you're lucky if you can get 192MB on a 3GB Android phone.

Furthermore, garbage collected languages use about 3 times as much RAM as a non-GC language for similar performance (tradeoff between how often the GC runs vs performance) negating any and all gains of a smaller code size. There is also this thing called the ARM Thumb instruction set which results in smaller binaries if that really is an issue.

> The decision to support SD cards made a lot of sense back in the days when internal storage was a lot more limited.

And this goes to the heart of my criticism: yes internal storage was a lot more limited back then. Both Google and Apple knew this. They both also knew (or should have) that internal storage was going to improve a LOT and very quickly at that. This is the point I'm trying to make: Google develops for yesterdays and todays constraints while they should be developing for tomorrows. In fact, Google should look farther into the future than Apple does because it takes so long for their software to reach consumers, it's taking 2-3 years for any new Android release to gain any significant market share. Android N should be built with 2019's phone hardware in mind, instead it's being built for 2015 hardware.


Regarding GC, Windows Phone apps are garbage-collected, yet Windows Phones has a great reputation for smoothness and responsiveness on anemic hardware like the Nokia 520.


WP only runs one application at a time. When you switch away from an app, it's "tombstoned" so that the app in focus has all available resources. It is possible to run tasks in the background, but IIRC the OS reserves the right to tell your background task "GFY".


Which is exactly what Android and iOS do as well.


No it doesn't. One look at the Windows Phone reddit will tell you otherwise. Windows phone jank is masked by superfluous animations, capped scrolling speeds and other tricks to hide it. Unfortunately, those tricks don't do the job.


What's wrong with intents now?


Intents don't work because they were designed to be too flexible.

Say I want to be able to share something on social media from my app, seems like the exact use-case Intents were made for. So I create an intent of type ACTION_SEND because that's the only one that sorta does what I need and now my user gets a HUGE list of options, half of which are irrelevant and/or don't work at all. I cannot limit the Intent to 'share on social media' because it has no such category. You cannot filter the list yourself because that would mean having to know the package name of every possible social media app.

Worse, even the well known social media apps do not work. No one agrees on what fields should mean what and how to interpret them. For example: you can create an intent that prefills the text and attaches a photo and it will work when you use it to open Twitter but not Facebook, facebook ignores the pre-filled text. Another app will ignore the photo, etc. you can't test every possible target app so the whole mechanism is unusable if you want to deliver a good UX. In the end you give up and just add the Facebook and Twitter SDK's to your app.

Another example: we have an app that deals with privacy-sensitive information. We want the user to be able to e-mail this to him/herself but nothing else. Or rather: we don't want our users to accidentally share this information on social media. You cannot create an Intent that will only open the users preferred email client and excludes everything else.

Intents are pretty much worthless if you care about a good UX at all.


From a user's perspective, I consider Intents the strongest feature of Android as it let the system make no assumptions about my preferred apps. If it is important to closely control the user's flow, as in your second example, then you're probably better off hardcoding a list of other apps that your app can interact with using explicit intents like how sharing works on iOS. General intents like ACTION_SEND are designed to be intercepted by any app that declares itself capable of servicing the request, regardless of how well the app can actually do so.


> From a user's perspective, I consider Intents the strongest feature of Android as it let the system make no assumptions about my preferred apps.

Half of the time the apps listed make no sense for an intent. There needs to be a mechanism for more fine-grained categories. For example, it should be possible to create a 'social media' intent for sharing on social media. It makes no sense to include Dropbox or Google Drive in that list.

And while it may be a nice feature for power-users, it's a horrible feature for the average user. Why would the user want to be presented options that don't even work ?


Just wanted to chime in as a former six year Android user that I miss intents the most.

I'm using my phone much less for certain activities. For instance, I share to instagram less because it's not in thr iOS share drawer for some reason.

I think the arguments leveled against Android elsewhere in this thread are solid...maybe even the UX one against intents. I certainly don't suggest an Android to anyone in my parents' generation, except my former-programmer uncle.


Instagram seems to have decided to implement their own sharing system that ignores everything but the most popular apps and websites.


Intents are a great idea for communicating between apps. They are complete and utter garbage for communication within the app between screens.


> n return we get an OS that can run in multiple CPU architectures, unfortunately no one runs it onanything other than ARM. The 0.01% of non-ARM devices can't run half the software anyway because they included ARM JNI components to work around the slowness of the VM.

These sentences are utter lies that have no basis in reality. Most applications do not use native code and even those that can mostly do have x86 binaries available. There's also significantly more than 0.1% of non-ARM devices, not to mention the fact that Android currently runs targeting three different ARM architectures.

Also having worked on a rather huge NDK project that barely hits 15MB of native code I seriously have to wonder how is 100MB limit (not 50MB as you say, since that was lifted) a problem code-wise. Resource-wise yes (and OBB system is kinda crap), but 50MB of compressed binary?!


> Also having worked on a rather huge NDK project that barely hits 15MB of native code I seriously have to wonder how is 100MB limit (not 50MB as you say, since that was lifted) a problem code-wise. Resource-wise yes (and OBB system is kinda crap), but 50MB of compressed binary?!

First of all, 50MB is the hard limit, in reality you should keep it under ~30-35MB or so. Your app will fail to install on MANY devices if you don't because while the play store may accept up to 100MB, the cache partition used by the Play Store app usually doesn't have that much space, especially on low-end devices. You start running into problems way before you hit 50MB.

As for OBB's, they are a PITA to use and you can't load things like layouts from OBB neither can you load other resources from them without rolling your own system for picking out the correct (mdpi/hdpi/xhdpi/etc) version.

The only thing you should use expansion files for is content, not anything needed for the application itself. And it's really easy to hit that limit then.


> First is the stupidity of Activities. The basic idea was that 1 screen = 1 activity and we can remove all non-active activities from memory and restart them as needed. This was clearly designed with an eye on memory constrained systems. Nowadays even the cheapest phones have shitloads of RAM but we're still stuck with this retarded model. Worse, now we have support for tablets and phones with big screens the 1 activity per screen no longer makes any sense anymore either.

Shouldn't fragments solve this?[0]

[0] https://developer.android.com/guide/components/fragments.htm...


Uh, fragments introduced just more of the same problems. A fragment in an activity has an insane, confusing lifecycle, then if you nest them, you basically summon Cthulhu. The more experienced part of the Android dev community is slowly transitioning into using views instead of fragments.


Sadly fragment API is pretty terrible - it adds a heapload of complexity due to it's async nature (see https://i.stack.imgur.com/fRxIQ.png which is NOT an exagerration), it's very buggy and filled with hard to debug device-specific issues.

Most developers have opted for one of the more popular MVVM / MVP patters that help manage UIs without use of Fragments, but pain when designing tablet interfaces is still there.


<rant>

IMHO, Fragments didn't simplify my work or make it more manageable. Fragments mostly added new weird things to remember, and, for all that complication, I don't seem to reuse them all that much.

Fragments have their own lifecycle events which are like those of an Activity, but not exactly. They also interact with the Activity lifecycle in ways that I found a bit confusing, personally.

To get access to your Fragment instances, you're supposed to rely on the FragmentManager (and/or FragmentManagerCompat, depending on what minimum version of Android you support), which puts you at arm's length from them, making life a bit awkward. Fragments also exist in another flavor, from the compat library, so that sometimes results in mismatched types which can be confusing.

Then you have to get used to the idea that you're only supposed to create trivial constructors for your Fragments.

If a Fragment needs to know something interesting, you're supposed to pass parameters to it, not through a constructor, but, with setArguments. That way the system can resupply those arguments if it has to destroy and recreate your Fragment on your behalf in certain circumstances. This could be better documented, IMHO.

But wait, there's also a lifecycle callback named "onViewStateRestored" which supplies a savedInstanceState Bundle to your Fragment which it can use to bring itself back to the desired state. This is more like what Activities do, kind of. But it doesn't seem to interact usefully with Activity state restoration, which I found counterintuitive.

And when I think about how smart these Android SDK programmers are (and I have no doubt that they are super bright people), I wonder why this is what they came up with. It makes me feel dumb. And if your goal is to create a product your customers will love, maybe you should avoid making them feel dumb.

</rant>


Android is usually pointed to as a success story for Java performance. I thought that it was just us that had performance issues because we were developing a big app with a completely custom UI... Interesting to see that others feel this way.

The conclusion is that it almost doesn't matter what language you choose for a platform if you have enough man-power and resources and you can force developers to use it. :)


Java performance on Android is crap. The real succes story for Java performance is on the server side.


where no one can actually see the horrible performance which would be immediately noticeable in any environment with UI interaction... think falling trees in a forest...


It's very clear the Android engineers haven't given a lot of thought to how applications are to be developed.

The best quote from the article that backs up what you just said: "Heck, I only know about MVC from school." Hmmmm...


Yes, Dianne Hackborn was one of the main proponents and designers of the fragment system lamented in your StackOverflow question referenced: http://android-developers.blogspot.com/2011/02/android-30-fr...


One could say the same thing for Win32 API. That's why you had Microsoft MFC, Borland VCL, wxWidgets, etc. running on top of it and making it more user friendly. The real problem seems to be that Android API is moving so fast, that it's risky to build such tools. The other problem is that these days most developers expect to get it for free, so there's no financial incentive to build it.


Poorly designed APIs are a common theme with Android. Another example is the MediaCodec APIs for hardware video encoding. They are so awful compared to iOS that it makes me think twice about buying another Nexus phone. It is impossible to design a nice real time video application while targeting a significant number of Android devices.


> Frameworks should be written for consumers, not maintainers.

Welcome to Worse is Better. This is literally what Unix went against. People used to write that way before; now it has to be easiest for platform developer/maintainer.


I'd be curious to see how would Dianne respond to this, if you posted it on the Google+ page.


You're welcome to post a link here. It does seem like something the Android engineering team should hear (even if they have heard it before).

Nonetheless, it's worth adding that my comment was written for the HN community. I'd usually be a bit more tactful (sic polite) when corresponding with someone directly. Also, my critique applies to the Android engineering team in general; singling Dianne out is probably a bit harsh.


My favorite one is Button, it inherits from... TextView.

Doesn't contain a TextView, inherits. Ugh.


Yeah. And "ImageButton" is a subtype of "ImageView" so it isn't a "Button". But it has button states.


Eschewing the traditional application architecture has made for both a terrible development experience and poor quality applications in general. The application lifecycle is convoluted with even the Android developers joking about how confusing it is. Everything about the model has made it far more difficult to port existing software to, and native development for me personally has been an absolute nightmare. No clean exit strategy for applications, half the methods in the lifecycle don't even get called, etc. I can't imagine the completely naive and oblivious thought process that led to the mess they created. Good thing Android is backed by Google though, so no matter how terrible it is it'll still be popular.


I agree. Android architecture is a mess. Activity life cycling is actually impossible. There are certain actions the OS takes that will cause crashes no matter how well architected the app is.

My main quibble with Android is that since everything is tied to the activities it is impossible to build an MVC style app. You are better off using the NDK or an engine. Then you can build your software correctly.


Do you mind expanding on some of your statements? Especially:

> Activity life cycling is actually impossible. There are certain actions the OS takes that will cause crashes no matter how well architected the app is.


I work on a very popular app in Latin America. That means we get to experience every single edge case in the eco system. My favorite quirk has been that for some reason I will never understand when an app goes into a full screen ad it can make your main activity eligible for GC. That means that you don't get any of your Activity life cycle events. Just a lone finalize and your app is gone. Then when the video ad is done you get a truly spectacular crash!

Sadly, I have a half dozen different ways activities have found to explode themselves. It makes me sad!


Sounds like the video ad is a new activity? Since it's full screen, your main activity is no longer visible so you should be seeing onPause and onStop fire. Are you saying you don't see them?

Also, I'd imagine video ads are also quite memory intensive, so if a low-RAM device is playing one I wouldn't be surprised if Android has to kill some processes (like your activity that was sent to the background) to make space.

Perhaps you should look into what these video ads are doing and what sort of resources they eat up?


How would the ndk help, doesn't it run within an activity?


I use the NDK a lot because you can kind of ignore the Android nonsense and structure your code properly. My approach is to have it build out the main activity then fire out into my app code. That code is beautifully MVC and for the most part ignores Activities, Fragments and Intents. For me it was faster to develop in than Android Java because I wasn't so strongly tied to the view code.


Why do activities make it hard to do MVC? They seem similar to UIViewControllers on iOS.


One thing platform engineer should do is to rotate into app engineer role and experience it for a couple month at least, without doing it you don't really understand all the pains the app engineers are suffering due to platform design. At very least you can make your doc so much better by knowing which part you absolutely want to cover in details.

This is especially true for Android platform team, to be honest.


What a platform engineer needs to do is to listen user's feedback early and often in order to improve the API. An API is a product,and like every products there should be usability concerns. I wouldn't say Android SDK is bad, it's just so convoluted it doesn't feel like it was written in this century.

It's like someone wanted to impose something regardless of its usability, a lot of design decisions seem to have been taken unilaterally because of one engineer's ego.


Dogfood, you say? I concur. I've only dabbled in Android development but (while a lot of things do feel well designed) there are some ridiculous design choices in there.

The one thing I've found really annoying is instability of the API as new versions are churned out. New features are added, deprecated almost immediately, and replaced with entirely different things (looking at you, NotificationListenerService!) It feels like they're thrashing trying to hit feature quotas or something.


After developing a few Android apps as an agency dev, we settled on a common structure that helped keep our code relatively clean.

Each activity would have an associated fragment, the idea was that the activity would be responsible for loading the fragment as the current view and other lifecycle functions as well as being the entry-point for any external data-loading (through creating and calling of services).

The fragment would initiate with a reference to the parent activity as a context, and would be responsible for view-centric things like displaying content and adding event handlers, which would more often than not use the context reference to call some remote API.

I suppose you could think of it in terms of Model/Controller/View-Controller but I'm sure there is a more correct model for thinking about it (and it probably is more straight MVC anyways).

The problem I've found with Android is that Google has created almost it's own language when it comes to Android app architecture, which creates a lot of confusion, especially for developers who just assume that all frameworks use the MVC concept (laugh if you will, but this is a thing).

Even though google is quite behind when it comes to the app market, I think there is still time for them to come out with a new set of documentation which outlines the "correct" (the "Google-blessed" one at least) structure for Android apps so that we as a development community can start moving away from the "everything-and-the-kitchen-sink goes in the current activity" style of Android development.


There's a few issues with this though. Take various animations such as the one on the toolbar that some Google apps have (the arrow that spins into a hamburger and back again). Easy to do if you're just loading different fragments into a Framelayout, impossible to do with activities as you reload the entire toolbar on an activity change.

It's a general problem in the Android world. Some things can only be done as an activity whilst others as fragments.

In fact this is a problem even on Googles own apps. Right now if i tap things in the nav panel of the Gmail app it's a crap shoot whether i open a fragment or activity. Things like inbox/sent are loaded as fragments. Things like settings are loaded as activities with a completely different loading in animation. Help is different again. Lots of different ways of loading in a view all coming from options in the same menu. It's pretty fucked up form a UI perspective.


> There's a few issues with this though. Take various animations such as the one on the toolbar that some Google apps have (the arrow that spins into a hamburger and back again). Easy to do if you're just loading different fragments into a Framelayout, impossible to do with activities as you reload the entire toolbar on an activity change.

I haven't even found an easy way to control the state of that animation, even if I use only one activity.


Well it's easy enough to transition into arrow and hamburger

ObjectAnimator arrowRotateAnim = ObjectAnimator.ofFloat(mDrawerArrowDrawable, "progress", 0.0f, 1.0f);

arrowRotateAnim.setDuration(Constant.NAV_ARROW_TIME);

arrowRotateAnim.start();

and vice versa on progress where mArrowDrawable is a DrawerArrowDrawable object. I set NAV_ARROW_TIME to 300 and it seems the same as what google has.


There are benefits other than cross-platform development to using web views or React Native or something that gets rid of the Android guts.


What you described sounds a lot like what I used to do for years. It works fairly well, and you can tack a headless Fragment onto it for things that you don't want directly connected to an activty's lifecycle (rotating the screen mid user sign-up shouldn't restart the HTTP call, etc).

This works well, and I'm at the point where I develop it without thought while creating new apps, but I've been playing with a less constrained DI flow instead using Dagger 2.

The more business logic and multiple copies of shared UI elements in different Fragments are directly connected to their parent Activity, the harder it is to re-arrange and re-use them. I've been working on migrating all core elements of our application into a shared library project, and that would've been impossible with a closely tied codebase.


> rotating the screen mid user sign-up shouldn't restart the HTTP call, etc

This was the very first thing I struggled with when making my first (and to be honest, only) Android app. I was making an HTTP call in a background thread and when the screen rotated, the app crashed. Making this kind of basic functionality harder to program is such a big turn-off for the platform, and seriously lowers my confidence in the correctness of what I've written.

I ended up writing this gross code (https://github.com/bschwind/skritter-android/commit/6fdffab1...). That's probably not the recommended way to solve it now, or maybe it is. I don't know because everyone seems to have their own special solution to the problem, and we're lacking solid, idiomatic solutions to basic problems an app developer faces.

For the small Android work I do now, I just stay in my own little NDK world.

Edit: It also seems I was pretty frustrated with the android API at the time, lots of colorful print statements :)


Likewise. Pulling the rug from your entire application because the user changed the device's orientation is a braindead action on the OS's part, and the justification (that it 'makes it easier for applications to handle orientation shifts') is pure bullshit. You can relay a layout without tearing down the associated Activity.

I think the real reason they did it this way is to make developers deal more directly with Android's larger philosophical choice of "the system can start and stop any activity at any time". Which stinks, IMO - it's fine if you're displaying a property page or an image from a gallery but is a terribly hostile environment to any process which interacts with the (stateful) real world and necessarily must also be stateful.


I used to use AsyncTask way more, I now stick to other ways to doing background processing. What you have is pretty close to what I described as a "headless fragment", it's a pretty common (but ugly, imo) paradigm, from the looks of it you either made something similar to or followed this: http://www.androiddesignpatterns.com/2013/04/retaining-objec...

Nowadays I've pretty much drunk the RxJava kool-aid. For this kind of thing, I would make the HTTP method exist inside of an Observable which would be observed on a shared single instance Looper provided via Dagger.


Yep! I think that's the exact article I settled on after running into that problem. It's been 2.5 years since I wrote that code and I haven't done any significant Android programming since then. Next time I do, I"ll give RxJava a try.


Have you tried putting all logic into a service, and only using fragments and activities foot display?


To be honest with you all my experiences with Services have made me never want to use them.


Binding services is pretty horrible, but I've very rarely had to do it. Using an IntentService is pretty straightforward and covers most use-cases of running something in the background.

Though RxJava has quite reduced the amount of interaction I do with Android core components like Services.


I worked with Dianne fifteen years ago, and she was good. However, hearing from others who were involved in early Android, and then left in disgust, the designers who set out the initial form did boot have extensive application framework/developer experience, and we're still hiring to this day because of it.

Let's say it all together: Implementation inheritance is a mistake, and interface based design is a clearer option.


It's not just that. Hackborn spent many years denying that Android was janky as fuck, or making excuses for it (e.g. https://plus.sandbox.google.com/105051985738280261832/posts/...).


You must be mistaking me with someone else.


Deleted, then. Perhaps I have conflated the memory of being at javaone and being told all about the wonders of javafx, and the contemporaneous wonders of "filthy rich clients".


This makes my head spin.

Plenty of examples on developer.android.com use Activities, Services, BroadcastReceivers for things that go beyond what Dianne Hackborn is recommending here.

It's like the Android SDK team want to have their cake and eat it too:

"We've built a tremendously powerful and useful SDK. It really helps you build great apps quickly and easily."

vs.

"Oh, and, by the way, be careful not to misuse our main components. They were never designed to help you build great apps quickly and easily."


Well, d.android.com exists to showcase the core apis. They can't possibly show you how to create an app with 3rd party components on top of a single activity. Just take the bear necessities from there add your own stuff on top.


I guess I've been reading that documentation from the wrong perspective. I thought they were trying to show me the right way, or at least, a good way, to create apps and add features to them.


Disclaimer: I am not an Android developer.

I cannot seem to reconcile these two statements:

> Should you use MVC? Or MVP? Or MVVM? I have no idea. Heck, I only know about MVC from school and had to do a Google search to find other options to put here.

And

> In Android, however, we explicitly decided we were not going to have a main() function, because we needed to give the platform more control over how an app runs.

So this person claims to not know or care about design patterns; but then explicitly enforcing a design pattern?

She does say:

> Android could feel like it has strong opinions on how apps should be written. With its Java language APIs and fairly high-level concepts, it can look like a typical application framework that is there to say how applications should be doing their work. But for the most part, it is not.

But after reading through the post, it does seem like a particular set of design patterns is being propagated.


Seems many people are missing the overall point of the post: The APIs Android provides that are listed here are intended to be used as the glue between your application and the rest of the system. However you want to build your application from that point on is up to you.

In particular, Android Activities aren't simply a main() function because they are designed from a multitasking standpoint; users are going to be going in and out of apps, changing the state of the device (such as rotating the device), etc. In other application environments, you might register callbacks to fire when the window is hidden or gets resized. In Android those callbacks already exist and are set in stone to encourage apps to behave as a good citizen on a potentially resource-constrained mobile device. But as the post details, you don't have to do anything beyond properly managing heavy resources (like camera access) and saving and restoring state at the appropriate points if you don't want to.


You need only look as far as the large collection of flags involving the Intent object to realize how badly things went wrong.


Most Android developers I know (and even some iOS developers) consider the Intent system one of Android's diamonds in the rough.

Could you perhaps explain how you would've designed it?


The intent system is great for communicating between apps, or just saying, "I need to do X, but I don't care what provides it." It is an absolute abomination for communicating within the app, though. There is absolutely no reason why I should have to go through the trouble of serializing an object just to pass it to the next screen. (Yes, I have read the technical reasons why not. I consider that a huge fucking design flaw)


The concept may be a diamond in the rough i.e. co-operative multi-tasking. The implementation, not so much.


Speaking as someone who has been writing Android software for like 4 years now as my job (but who has been in the industry for much longer than that, as a 42 year old who has programmed in just about every major environment), I agree with what you wrote here.

Intents are great in concept and they work out well for users, but the interface/API for using them to do anything can quickly become painful if you go even a step off the beaten path of "perform this operation with these parameters".

A common recurring theme with Android (and this applies to all the major bits -- Activities, Fragments, Services, etc) is that you'll easily hang yourself if you don't have a really clear picture of how they actually work but you attempt to use them. Android almost completely fails, IMO, when it comes to the concept of "keep the easy things easy". There's a huge upfront cost to understanding the major components before you can start really using them at all safely, in my experience. As a bare minimum, if you don't have an intimate understanding of the Activity and Fragment lifecycles and a full understanding of what needs to be on the UI thread when (and when different callbacks from the OS are/aren't on the UI thread) you are likely to create a terrible mess of an app that kinda sorta works on most devices, usually, but is broken in some fundamental ways you aren't aware of.

I don't personally know any day to day Android developers who haven't spent a considerable amount of time in the AOSP code trying to figure out exactly how some of these systems work because failing to understand them internally combined with lack of any sort of clear direction from the platform team (extremely open case of there being more than one way to do anything, which makes authoritative answers to the question "How should I do this?" nearly impossible without a long list of caveats) is the path to writing Android code which mostly works but has some fundamental mismatches with the operating system and becomes a complete mess to maintain.


The user interface concept might be called UI subroutines, along the lines of UI continuations of this paper from an MIT research project in 2003: http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.10.2...


The great "Advocating Against Android Fragments" post on the Square Corner blog by Pierre-Yves Ricau highlights how horrible the Android lifecycle is.

https://corner.squareup.com/2014/10/advocating-against-andro...

Also, if you are doing any substantial Android development, you are bound to run into many issues (say, for instance, it's horrible soft keyboard management system). Hackborn can be found on many of these issues trashing developers asking those questions.

https://groups.google.com/forum/#!topic/android-platform/Fyj...

Non productive vitriol is the norm for this person.


Android noob here. I've been teaching myself Android programming for the past couple of months and I've found it overall a messy and unpleasant experience for the reasons many of you have already mentioned. So much, in fact, that I'm looking for alternatives.

So what's the best option?

Kivy? Python is slow, adoption seems non-existent, not suitable for every kind of app

Cordova? Web apps are slow, JavaScript sucks big time

Qt? Google discourages use of the NDK for developing apps, can't figure out anything from their crappy website

Xamarin? C# doesn't look like a significant step up from Java, from Microsoft

Delphi? Proprietary, Windows-only and costly

Clojure/Kotlin/Scala? It seems you need to be a master Android developer to use them, still doesn't get you out of the horrible Android architecture.


Android is a messy process. Since you've effectively implied that you're excluding all of the options, you only have message Android.

Web apps don't suck that much as long as each screen does one thing well. Xamarin is for getting a slightly more elegant language (since Java 1.8 isn't supported) into the mix while providing a reasonable cross-system platform. Clojure/Kotlin/Scala do require you to master Android first because they are built on top of it. Each provides is own abstraction, even if it's just a language.

In the end it's about trade offs and acceptance. Raw Android is like working in a better assembly. It's got decade's old abstractions. It's powerful, but annoying. For everything else, there's the complexity of working with the various abstractions over a system that does not want to be abstracted.


I spend a lot of time in Xamarin so I'm biased in that direction, here's why I think it might bring more of an advantage than you think.

C# is IMO a significant step up from whatever Java is running in Android. It's a much richer language as far as syntactic sugar (see properties, type inference), and fundamentals - optional dynamic typing, better generics than Java, and gotcha-free lambdas. The biggest advantage though is async/await, which puts c# miles ahead of Java when it comes to concurrency, something that's oh-so-important in mobile land. And of course Xamarin opens up F#, which is a whole different story.

Also, C# opens up some frameworks that will give you significantly more modern techniques than what can be easily done in vanilla native Android dev. Take a look at ReactiveUI and MvvmCross, and a recent favorite - https://github.com/RolandPheasant/DynamicData

Now that it's free and doesn't require Windows, I definitely think anyone trying to build significant native Android apps should at least take a look.


If this is so terrible, why isn't there some Java framework on top of this that's designed to make sense for developers?


They do exist.

Check out rxjava from netflix, dagger and butterknife and okhttp and retrofit and picasso (and and....) from square, MVP libraries, kotlin and anko from jetbrains

What is truly holding back many developers is the above cargo cult that the path mentionned in android.developer.com is always the right one.

There have been some harsh comments on Dianne Hackborn, but I find that she is actually doing us a great service here by dissiping this myth. I find she does a great job at explaining what is the scope they really care about, and the one where you are free to discover better alternative that do not have the "Google" label on it.


I agree with your last two statements, but the idea the RxJava and Dagger make things _easier_ to understand for developers (I'm inferring this relates more to newcomers to Android as they are the once which have a hard time grokking this stuff) is a joke. RxJava and Dagger only increase ramp up time and the amount of stuff to learn, regardless of how useful they are. If someone came to me confused and I pointed them in that direction, Im sure they would get lost in the woods somewhere and Id never see them again.


Fair point. They make things simpler, not easier


> What is truly holding back many developers is the above cargo cult that the path mentionned in android.developer.com is always the right one.

Yes. I sometimes think we need to embrace an "Android-free Android programming" approach where we use builtin Android components as little as possible and better written 3rd party components and libraries for everything else.


Because I shouldn't have to go somewhere else to have a sane framework for writing Android apps.


I hear Oracle has something available for that.


Recently I was looking for one book desperately , a book that shows android (and its apps) architecture, form low-level to high-level, design decision which you should take when you design your app architecture. I hate how all books are kind of reference manual. If I want to see what an API doing , I will look at it documentation I don't need another book.But sadly most of books written about android is just talking about API details.

p.s. If you know such book I would be grateful .


You might consider this book: http://www.amazon.com/Android-Programming-Ranch-Guide-Guides... I've read some of their books before, and they have good understanding (and presentation) of architecture.


Rails is built on top of Ruby language, designed to be opinionated, following MVC. You like it, you use it. You don't like it, try another framework.

Using the same analogy, Android is build on top of Java language, is 'opinionated': instead of designing with Model, View, Controller components, it's designed with 'unusual' components (as in not following any classic architectures) e.g. Activity, Service, ContentProvider. You like it, you use it. You don't like it, unfortunately you still have to use it. The real issue here is a lot of developers depend on Android framework, and many of them seem to struggle with the way it's structured, with no direct replacement (not taking into account hybrid frameworks here).

The way I see it, architecture is an opinionated topic. Sure classic architectures like MVC, MVP, MVVC are proven ones, but they serve as a guideline at most. There is no right or wrong if you follow this and not follow that. You are not happy with any of them, you make your own architecture/pattern. Hell it's opinionated, you are allowed to have an opinion here! If you think MVC or some other pattern is the right way to go, then the author has the right to think her design is the right way. It just keeps going on.


> You like it, you use it. You don't like it, unfortunately you still have to use it.

You always have the option of falling back to OpenGL-rendered widgets and using a framework with MVC if you want to. Qt supports this, for instance.


One of the biggest challenges for building on Android is its complexity, and the team must successfully integrate with a lot of surface area conceptually (the fundamental building blocks Dianne explains is just the start). This unusually negative comment thread (for HN, I think) is probably illustrative of how frustrating Android development can be.

On the other hand, it's been clear to me that Google is investing heavily in making Android an easier platform to develop for.

First, the tooling: Moving to Gradle for the build system was a huge improvement. Making a repeatable, extensible build is the vital with teams moving towards the DevOps world with CI/CD. Android Studio has also been a welcome change; all of the separate components of the build being integrated together makes for a much better development experience. The best example of this is Instant Run, which is a great accomplishment for the tooling team.

The Support Libraries are also a solid investment for implementing good patterns - particularly patterns that can be tricky to implement yourself like the separately sliding appbars. Getting more developers to adopt the support libraries also allows more compatibility, since Google can release the fixes independently from platforms.

YouTube has also been a great resource for Android developers as Google has been constantly releasing content about how to build better apps. Jo and Ian are really great.

Anyway, I would watch this space. It might be a coincidence that Dianne made this post, or the most recent videos ("concurrent tasks with multiple documents" and "tasks and back stack", respectively) were also about basic Android features. Maybe Googlers are reflecting on what Android is due to the current news of Oracle v Google. Or maybe it's because IO is this week. I'll be watching!


I agree that moving to AS+Gradle was a net improvement (even though Gradle is not always so quick) because it let us exactly reproduce the individual developer's build on the CI server, as you say.

OTOH, I wonder how many devs really grok the Android gradle plugin and feel comfortable just writing tasks themselves without carefully copying/pasting/modifying some magical incantation from somewhere.

I feel like the verdict on Instant Run is still out though. We need to get used to the complexity of IR's choices to restart the Activity or stop the entire app and reinstall the apk etc and gain solid confidence that we can just trust IR to truly reproduce our code changes in its special, optimized way.


> how many devs really grok the Android gradle plugin and feel comfortable just writing tasks themselves without carefully copying/pasting

That plugin uses Apache Groovy for its syntax, though in reality only a tiny non-Turing Complete portion of Groovy's syntax is used in virtually every build script out there. The main difficulty with Gradle is really the complex API it exposes to Groovy, e.g. not knowing whether to use an = like in

    depos = {
      //stuff
    }
or

    depos {
      //stuff
    }


I think it's fine for the Android team to take this approach like so many framework authors before them. I think the problem is that Android developers are seeking patterns and prescriptivist documentation because that's what many other platforms offer these days.

On iOS, the message has always been clear: "Use MVC, delegates & data sources, storyboards, etc. /We use them internally/ and you should too. Don't go re-invent UIViewController!"


Tldr: that's how the system interacts, you are free to do what you want and just use the framework for system interactions if you need them.

I guess this is a late reply but I feel the need to add in here considering I began my career with Android devices and because of that have looked at everything from that perspective(I write code for web apps, analytics, devops too). What everyone seems to be focusing on is how broken the android platform is. But no one sees the main theme of the post being that your code is really not necessarily a part of the design. Take the entire Android environment , Android currently works on at least a million distinct devices which vary massively in configurations (I include tv/wear/auto and maybe upcoming platforms here too). This with a 6 month major release cycle (if you want to argue about the necessity of this, it's a another topic). You really cannot break everything in the next api level and neither can you make a simple framework for the comfort of the newer programmers or people from other environs. If you really want to get to the main bit of development, there are several starter packs which can help you in the same. This would also explain the sheer number of Android libraries available. this how the system works,not your app. And unless you are building a system app you are free to do what you want and interact with the system as it dictates, because more than the Android system is designed to cater to the end user. It's not a product for developers (I look at the ios development as a a product for devs and end users).

Android development is frustrating and I have had my fair share of pointless arguments on bugs which the Android team refuses to recognize. But when you go through the AOSP code you see how much of can be done with the system. The bitmap provider implementation for example is my go to code for whenever I have to perform intensive processing.

The new memory manager is also an interesting piece of code which Android devs should read. And all these were written while interacting with the same framework.


I remember her name. Wasn't she the one who vehemently was defending activity lifecycle and other broken multi-threaded API, something every Android developers I talked to would consider totally broken?

To be fair, developing on Android has become so insane releases over releases that her crazy write up about no engineering design hardly comes as a surprise...

Shame on Google for forcing us to use that POS.


I met her once at Google I/O, and it wasn't a pleasant interaction. I was lamenting how the recent (at the time) switch from USB Mass Storage to MTP made file transfers to and from computers very iffy. (And it's still pretty iffy today.) I was asking why the change was made, and if there was a chance at the option for it being restored, as devices used to allow both.

A lot of times, files on the Android device don't show up properly in Windows Explorer. She asked what I was doing, and I said copying APK files. (I regularly used to backup APKs so I could revert software updates which degraded the experience.)

She immediately stated that they "didn't support piracy" and walked off. As if the process of sideloading APKs or transferring them to and from a PC was somehow automatically illicit activity, rather than... something a lot of developers probably do regularly.


I see Android guys lack commonsense and I am not surprised. How did they think you are pirating apk's after attending I/O event that costs fortune to enter ?


Shame. Shame. Shame.


The fact that an Android platform engineer doesn't know of design patterns beyond MVC, and only knows that vaguely by reputation, explains why it's so difficult to build well designed apps for Android.

Yes, technically the platform APIs don't "care" about what's going on in an app. But when the APIs are designed in such a way as to (inadvertantly) work against MVC or other design patterns, they make developer lives more difficult. And you can expect that to happen if your platform engineers aren't familiar with these concepts.


Actually I'd attribute the difficulty to the culture of "Java-ism" that emphasises huge, complex, design-pattern-filled "extensible" architectures which happen to be extensible only in very specific ways.

I wanted to take up casual writing of Android apps as a hobby, mainly because I think the little portable computer I keep in my pocket could become so much more useful, but the unusual API combined with the complexity and general baroqueness of the architecture was a big turn-off. I don't get the whole "design patterns" thing either, but I do have extensive experience with writing Win32 apps, and a little bit of X (which is not all that different.)


I wonder if Google's ultimate goal is to make "Android apps" all work on Native Client/LLVM.

It already seems to be the goal to make all Java apps work on Native Client on Chrome OS. But once that's done, couldn't they just allow anyone to write apps in Go, Rust, Python, etc for Native Client directly? (and thus eliminating what will probably be some performance penalty of running Dalvik apps on Native Client).

That way Google gets to deprecate Java apps in the next 5-10 years and be done with Oracle forever, and developers would have a choice of some really good and safe languages as well.


I've scratched that same itch - and ended up with a bunch of Python code on a server and using my pocket-computer just for it's web browser... For "casual apps in my pocket" it's often "good enough". (This just moves the playing field, but I'm comfortable in html/javascript and FE Dev, so it works for me...)


26min into the 2014 Google I/O Android fireside chat: https://youtu.be/K3meJyiYWFw?t=26m

Q: So I was wondering if you guys at any point considered the support -- the official support -- of the Scala programming language. I'm asking this question especially now that we all saw that Apple released Swift after 4 years of work. And I think that Swift allows for things for iOS developers that we can't do in Java with the Android SDK. So my question was: have you ever thought about it before -- the release of Swift? Have you thought about it after that? Is there any plan?

Android answer 1: Well, so, I like Cocoa, but Objective-C is based on C, which is 40 years old, so I think Apple sort of had to, like, update it a bit. Umm, so, yeah [laugh], I don't know. Scala -- I don't know. Anyone want to take that? [Android team laughs]

Android answer 2: [loudly] No. [room laughs, claps] Alright, seriously, it's -- Java is the programming language for Android. I don't really think there's a lot of benefit to -- the entire framework is built around the Java programming language and I don't really -- I don't think there's much benefit for us to try to support another whole -- another different language.

Person from answer 1: What about Swift? [room laughs]

Person from answer 2: [jokingly] I'll think about it.

Person from answer 1: [mockingly] It's got optional semi-colons.

Person from answer 2: You have the NDK so you can throw something there. But the NDK -- it doesn't have access to the framework, and that's kind of the challenge. If you want to do a different language, if you want to have it as a first-class language equivalent to the current framework you've got to have either a whole new framework or some bindings to it, which is going to make it a really bad experience because it's going to be Java and this other language.

Q: I want to work with Scala because Scala is compiled to the JVM, so it can run on Android. So there are currently ways to do that -- to work with Scala -- but it's using third-party libraries. So you have classes -- that's what I meant by people to wrap their Java classes, but then it becomes tricky to integrate that cleanly with Android Studio. That also evolves quickly. I'm not sure if it's as complicated as creating a whole new language like Apple did, but my question was just if you guys were considering any...

Android answer 3: From the tool perspective, probably later this year or early next year, there are some changes going on inside Gradle right now that will make things easier to you to just have a module that's originally written in Scala that you compile down to bytecode and then we can just dex that and package that with your application. But it's not going to help you access the activity API through Scala code. It would be -- if you have some code that -- your business logic or whatever that you want to write in Scala because it's easier for you, you should be able to do that. Because as you said, it's compatible. It just generates regular bytecode and then just dexing it. But that's very different from saying "you can code Android in Java" where you have access to all the framework APIs.


I gave up on watching those Android Fireside chat sessions because of the horrible jokey way in which so many valid concerns end up getting dismissed, every time.


It's been interesting to see the emergence of the Android Developer-Advocate-Comedian in Fireside chats and at Google I/O sessions.

Maybe some of these folks are bored with their jobs, or just tired of trying to do the impossible: convince the developer community that the Android SDK is a great and well designed thing that makes creating great, robust, secure apps easier and faster.

"We know we can't give them world-class, visionary, insanely great engineering, but we can try to give them something entertaining."

Bread and circuses ...


Standard Googler behavior. :-)


good find


She mentions that we should think of the android apis as a "system framework", and I remember a different Google Android engineer saying something similar about the RecyclerView, that right now the focus is on making the technical functionality and API solid and stable, even if not so developer friendly. Someone else, or future Google, can make a more developer friendly API on top of the awkward RecyclerView API. The problem with designing APIs that aren't really meant for app developers, but instead for higher level framework developers, is that those higher level frameworks don't actually exist, and even if they did, there's no clear message for developers to follow. Less choices, or at least a "recommended" approach, would be valuable.


Unfortunately, 18 months since its release, I'm not sure if anybody (certainly not Google) has come up with some nicer abstractions on top of RecyclerView.

It works well for basic lists, but out of the box it comes with very little — not even a click listener for items in the view.

Having written a custom LayoutManager for RecyclerView a year ago (and then a matching ItemDecorator), it was probably the most difficult (and frustrating) thing I've had to do in Android development.

At the time there were certainly zero code samples that correctly implemented a layout manager that worked in all cases. Indeed, I gave up on supporting various parts of the API. I don't imagine that has since changed.


Probably because the RecyclerView is so frikkin' complicated, as Chet Haase and Yigit Boyar explain here: https://youtu.be/imsr8NrIAMs

After watching this for five or ten minutes, I gave up. It didn't seem like it offered a good return on time invested.


They really should have stuck with int main. What's unfortunate is the quantum leaps they've been taking in terms of complexity to just get an app up and running on their platform. But I guess that's the only way their engineers can justify their salaries/bonuses. Same as with that horrific nightmare of an app Facebook puts out.


What would staying with the main entry point solve, aside from being familiar?

Your application would still have to directly manage binder callbacks and register for lifecycle events. Re-using the old Java/POSIX entry point actually increases the complexity significantly.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: