Tuesday, August 11, 2020

Being in the Moment

So what's next for pyamsoft?

It's been a year since the last update - Android has rapidly evolved from the mobile OS it was when I first began into this worldwide phenomenon and it's userbase has grown exponentially. I no longer develop Android applications professionally, they have been relegated to purely a love and a hobby that I spend all of my free time in. I have thousands of users to please and, since I removed advertisements and all forms of monetary potential from all of my applications and open sourced all the code, I have zero dollars to show for literally thousands of hours of hard work. I've effectively lost money and time developing Android applications. Something has to change.

But change is slow and difficult, so instead here's another app in development.

Introducing Moment, or MMNT: a ticker tracker for the NASDAQ. It will periodically monitor the tickers on the NASDAQ for trading volume - and will send you a notification when the trading volume of a ticker exceeds 10x the average of the past 3 days. In this market of insider trading and rampant speculation, hopefully it can inform you about a burst in trading volume before the price change follows. It will also monitor specific tickers that you request and notify you daily about the total volume and price spreads from open to close. It'll have charts.

MMNT gets it name from the ticker of the same name which tracks Momentous Holdings, a penny stock trading at a volume of 4000 and going for about 20 cents. It has 2 employees. Its a small, penny traded stock that barely sees any activity and is worth barely any money per share. But, back in April of this year, its trading volume increased from a volume average of 150 to 120 thousand, which brought gains of more than 60% at the top. The massive volume increase preceeded the price increase by about a trading day, and the top by about a week. MMNT the app seeks to capture tickers like MMNT whenever its next great pop and drop happens.

It will hopefully be done in less than a year. We'll see.

Stay tuned.

========================
Follow pyamsoft around the Web for updates and announcements about the newest applications!
Like what I do?

Send me an email at: pyam.soft@gmail.com
Or find me online at: https://pyamsoft.blogspot.com

Follow my Facebook Page
Check out my code on GitHub
=========================

Updates

Hey there - been a little while.

Updates were finally released today! Woohoo!

After a year of store silence, updates have been released for all pyamsoft Android applications - bringing them all up to speed with the latest architecture improvements and MVI state management and Android R support! The new release brings support for the Android App Bundle (AAB) format, so downloads should be even smaller than they were before (and they were only 2 or 3 MB before). This also paves the way for further support when the new Play Store APIs stabilize.

update-hosts received a small patch which removes sourceforge.net from the website blacklist, as the site appears to be no longer part of the badware risk on uBlock0.

FridgeFriend also has been pushed to the production track after a year of stringing you along! Its a minimum viable product at the moment, so it's not going to be smart or flashy or anything fancy like that - but it will be enough to validate the idea and also to kick me into gear about supporting it. Now that it is a live production app on the store (as long as it doesn't get banned) it will keep me honest about updating it. Expect to see it after review is completed, which should hopefully take only a couple of days.

Stay tuned!

========================
Follow pyamsoft around the Web for updates and announcements about the newest applications!
Like what I do?

Send me an email at: pyam.soft@gmail.com
Or find me online at: https://pyamsoft.blogspot.com

Follow my Facebook Page
Check out my code on GitHub
=========================

Tuesday, August 4, 2020

Enforcing expected ordering in coroutines

A recent update to PYDroid brings it to 22.0.2 and brings with it two small but major changes.

First is the bump from the bundled Material dependency in pydroid-ui, moving from 1.1.0 to 1.2.0, hooray! See the changelog for the material-components library for details.

Second is a change to how the UiViewModel binds the view and controller. Before, the UiViewModel would launch multiple coroutines on the IO dispatcher and request to bind the controller event bus, the views event busses - then initialize the views - and then bind the state event bus and run the first render. Because these launches were all happening inside the same coroutine scope, they were queued in order but ran sometimes in parallel or even out of order - which goes against the expectation of a strict initialization ordering that the library guaranteed. Because of this lack of order, there were sometimes cases where the UiViewModel initialization could run before the controller event bus was bound, so any publish calls from inside the UiViewModel during initialization would get lost. Similar edge cases were possible in communications from the Views to the ViewModel.

The new version should address these edge cases, by making sure that the bus binding operations happen in order by launching the coroutine on the Main dispatcher, which is a single threaded unbound queue backed by the Main thread, and then immediately switching to an IO context to do their actual work. By queueing the work this way, this should guarantee the following flow

Controller bus is bound
View busses are bound
ViewModel is initialized, calls to publish() from a doOnInit block should reliably reach the Controller
Views are initialized in FIFO order, calls to publish() from a doOnInflate block should reliably reach the ViewModel
State bus is bound, any future calls to setState will emit a change to the view layer, but any setState calls before this will simply update the currently held state object without emitting any UI changes
The initial or most recent state of the UI is rendered.

Note that this flow has not changed, it was always intended to be this way - but hopefully with these changes this flow is even more strictly enforced.

As a side benefit to using the Main dispatcher as a queue, we can remove the unique stateContextDispatcher which was backed by a newSingleThreadedExecutor for each ViewModel, reducing the number of extra threads we are creating and destroying - since threads are expensive on Android this can be a nice benefit.

FridgeFriend finally got an icon today and the store page is beginning preparation for a release. Wow. It's been a while hasn't it.

Stay tuned!

========================
Follow pyamsoft around the Web for updates and announcements about the newest applications!
Like what I do?

Send me an email at: pyam.soft@gmail.com
Or find me online at: https://pyamsoft.blogspot.com

Follow my Facebook Page
Check out my code on GitHub
=========================