Thursday, August 25, 2016

Fluid UIs-The Correct Asynch Construct

I have to change my framework code as obviously AsynchTask is not the correct Asynch construct to use. It's not correct as the AsynchTask is not android lifecycle aware.

We want to use AsynchTaskLoader as its android lifecycle aware and does not hold a reference to any UI part. It helps prevent the Task from trying to communicate with a destroyed UI view such as in the case of the device orientation changing.

If it was known to be longer background task, its just formatting display data and populating the ViewModel or Presentation Model, than I would be using the FutureTask which provides an added feature of being cancel-able.

True I could break down and use RxJava's Observable, but my point is its not necessary to bring in Rxjava if you know the correct choices in your implementation of a fluid UI.

Monday, August 22, 2016

Fluid UIs

Okay, so rather than attack Fluid Uis from the state immutable part I revamped an approach where we attack the fluid Ui problem from moving stuff off the UI-thread.

Backgound: When RecyclerView was first released it sheppard in a new way to do things and have view holder by default enforced. Well, it changed things in that the adapter no longer did just adapting compared to the old ListView. The Adapter now did not only adapting but also binding to the view.

Binding is okay on the UI-thread, BUT the adapting part as since its not bound to the view should not be on the UI-thread but on the NON-UI Thread. Most of you wrap the http calls in the asynchtask and that is not enough.

And we can in fact separate the adapting from the binding and put them on different threads. And the trick is to do it with only one application wide thread pool and provide enough debugging hooks so that when one uses this framework one can keep track of whether their app arbhcitecture regresses in performance on this set of issues.

AND, yup thee is an and, be flexible enough that I do not dictate what Android App Architecture pattern you want to use to make use of this framework.

So the project with the new approach is:


First release is in  September.

I have been through enough code to know most android devs are not doing this. Even the Google IO app demo does not do this, WTF?

Thursday, August 18, 2016

RxJava is not App Responsiveness!

RxJava is not App Responsivenss! here are the two areas of App Responsiveness:

1. Use Immutables in all object models to reduce GC

2. Separate ViewState, ViewModel, AdapterModel, DataModel and wrap the adapter code in an AsynchTask to be done on the non-UI thread. If using a binding library that is the only thing that should be on the damn UI thread!

Now, how you handle the callbacks and data flows is up to you. But I do not believe that you need to use the heavy RxJava or agera to achieve that as you could make up your own monad and promise implementations.

The magic bullet towards app Resposniveness is not rxJava!
Its actually knowing how the Dalvik/Art VMs work and how the graphics UI pipeline in Android  works and changing things to minimize what occurs on the UI threads.

Monday, August 15, 2016

New App Achitectrue:GWSAdux

The repo is up to the new app architecture for Android, called GWSAdux. The very first alpha release will be in the next 10 days. Its focused on app Responsiveness.

Saturday, August 13, 2016

Its Probably Adux

Remember, I am completing an attempt at a new app architecture for android? Its probably going to be named Adux. Why Adux?

Well, when I looked at the redux implementations on android I noticed that they were all wrong in that the device orientation changes were not handled. But, when you make changes to implement that you get more than one State class so its than not really redux but Adux, get it?

More info coming this next week with the repo published this next week.

Wednesday, August 10, 2016

Sweet Immutable magic

Put an immutable collections container in a ViewModel, shocking magical. Okay, I being obtuse...ViewState container as an immutable collection, plus ViewModel with the inside container being an immutable collection object, and plus some other immutable collection data handling magic.. AND no effing need to even touch huge RxJava! :) damn!

Monday, August 8, 2016

Functional Programming is Fun

Well, its fun if you figure out a way to get Responsive Android Apps without resorting to use RxJava and its large learning curve.