Re:Android platform engineer on application architecture
by EddieRingle on Monday May 16, 2016 @12:46AM
(#11704293)
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.
Re:Android platform engineer on application architecture
by lanestp on Monday May 16, 2016 @10:09AM
(#11706322)
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!
Re:Android platform engineer on application architecture
by EddieRingle on Monday May 16, 2016 @10:40AM
(#11706561)
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?
Re:Android platform engineer on application architecture
by steplee on Monday May 16, 2016 @12:04AM
(#11704182)
How would the ndk help, doesn't it run within an activity?
Re:Android platform engineer on application architecture
by lanestp on Monday May 16, 2016 @10:25AM
(#11706445)
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.
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.