Wednesday, November 10, 2021

End of More Ages

Seems like only yesterday I was writing about this.

Sad to say it but it must be said - Pasterino, ZapTorch, and WordWiz have all been deprecated today and are henceforce unpublished and wholly unsupported. They will receive no further updates or bugfixes.

Long story short, Google Play Store and the Android ecosystem have evolved once again to a point where applications like these that serve as simple utility single-function applications are no longer needed nor encouraged. Rather than fill out disclosure forms regarding data I don't collect and having to comply with a continuing restrictive process, I've decided I would simply rather not invest additional work and time into hobby projects I already struggle to maintain.

They are, as of this moment, dead. Any existing versions should continue to work until they don't with any new Android versions, and if you've already installed the application you will continue to be able to use them as always. I just will not be working on them in the future any further unless the landscape once again changes.

That leaves FridgeFriend, HomeButton, and the mystery stock application alive for now - who knows what the future holds?

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
=========================

Friday, November 5, 2021

A New Age

Lets talk Android.

 

Jetpack Compose UI is the new hotness, and last time we spoke I mentioned how I would begin bringing Compose support over to all pyamsoft Android applications.

First, for users.

Almost all pyamsoft applications have been converted to Jetpack Compose. This includes Home Button, Pasterino, ZapTorch, WordWiz, and SplatTrak. FridgeFriend is larger and thus is not complete yet, but support will be coming soon. Please look forward to seeing these new versions on the store within the next couple of months as bugs and testing need to still iron out any kinks. There will be no new features and the applications should keep 100% feature parity with the current version.

-----

This is a nerd corner post.

100 commits into PYDroid later and I'm happy to report that the first-version-pass support for Jetpack Compose is live in PYDroid 24.0.0!

 Jetpack Compose is, for comparison's sake, a better version of React.js but built for native Android applications using Kotlin. It's awesome.

 All PYDroid internal screens and dialogs have replaced the old XML view system with Compose views, and bridging support for themes is handled per application. Let's go over the main user facing changes with PYDroid first.

1. The PYDroid.init function takes a couple new parameters now.

googlePlayLicenseVerificationKey: String

imageLoader: () -> Unit

theme: ComposeThemeProvider?

logger: PYDroidLogger?

First, the license verification key. This is a new required parameter which should resolve to your Google Play LVL base64 string for your application. Internally, PYDroid will check the Google License verification service to make sure that your application has not been tampered with whenever you make a release build. License verification requires that you extend from PYDroid-UI ActivityBase. To disable this feature, set ActivityBase.disableProtection = true.

Next, the required imageLoader callback. PYDroid now internally uses Coil as an image loader. To allow a user to configure the image loader, this lazy resolver accepts an ImageLoader instance from the application, and uses it in the library on demand. Your application must pull in Coil as a dependency.

The theme is an optional parameter, which allows you to pass your applications Compose MaterialTheme and is provided with a ThemeProvider and a composable content callback. This will allow your Compose theme to be applied to PYDroid internal components for application consistency. Your application must implement its own Compose theme, or provide an instance of MDCTheme, otherwise this will fall back to Compose defaults.

Finally, the optional logger parameter is a new logger interface which is used in the library internally. If you do not wish for the library to show logs, you do not have to pass an implementation. As a result of this interface, PYDroid no longer depends on the Timber library, but your applications can still use Timber as a logger by implementing the DebugTree in a PYDroidLogger interface.

Now let's talk progress - specifically, let's talk deprecations.

From PYDroid-Arch, the entire UiView, BaseUiView, UiRender, ViewBinder, StateSaver, and UiViewEvent system has been deprecated. The UiView system was a way for XML Android Views to fit into PYDroid's component style architecture, which worked well to separate large screens into small independent visual components. With Jetpack Compose, this separation can be achieved inside of a Composable itself, which means that our own independent UiView system is no longer needed. The UiViewModel will continue to exist and operate with a UiController and handle a UiViewState in the MVI style, but any methods revolving around UiComponents and UiViews have been deprecated.

All PYDroid-UI which revolves around the Android View system and XML views have been deprecated. This includes XML Preference support in the SettingsFragment. Preferences should now be handled in the Compose friendly PYDroid-Ui PreferenceScreen composable, which provides a bridge between the old XML based views and the new Compose UI. Applications still using the old AppSettingsPreferenceFragment based settings screen can continue with no changes, but any new applications will be able to use SettingsFragment for Compose compatible preference UI.

All PYDroid-Util functions revolving around Views have been deprecated. As well as these, the Context.asDp() and Drawable.mutate related functions have been deprecated in favor of the Compose built-in counterparts.

The entire PYDroid-Loader module has been deprecated in favor of Coil and it's ImageLoader. Glide is large and not Kotlin-first and Coil is a smaller project and already has first party support for Compose. PYDroid-Loader was built around the old View system, and is both less feature filled than Coil and lacks Compose support.


To migrate to the new PYDroid 24.0.0, you should break up your migration into the following

1. Migrate to PYDroid 24
2. Migrate your application to Compose

To migrate to 24 is (hopefully) very simple. Provide the 2 new required parameters to your application level PYDroid.init() call (you may need to get your Base64 LVL key from Google Play Developer Console), and remove the deprecated fields from your MainActivity like the fragmentContainerId and snackbarOwner. You should be able to then build and run your application. You will notice at this point that some PYDroid UI components are not themed correctly. To resolve this you should either migrate to a Compose theme, or pull in the MDC Theme adapter project to convert your XML theme. Once you have done this, you can now begin the full migration to compose on your own time.


========================
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
=========================