Android Vector Drawables and SVG

How-to create your graphics in Android without bloating your APK.

"If you’ve ever worked with vector image formats, you’ll likely have come across the SVG format (Scalable Vector Graphics), the industry standard on the web. It is capable and mature with established tooling, but it’s also a vast standard. It includes many complex capabilities like executing arbitrary javascript, blur and filter effects or embedding other images, even animated gifs. Android runs on constrained mobile devices so supporting the entirety of the SVG spec wasn’t a realistic goal. SVG does however include a path spec which defines how to describe and draw shapes. With this API you can express most vector shapes. This is essentially what Android supports: SVG’s path spec (plus a few additions). Additionally, by defining its own format, VectorDrawable can integrate with Android platform features. For example working with the Android resource system to reference @colors, @dimens or @strings, working with theme attributes or AnimatedVectorDrawable using standard Animators.""

Nick Butcher

Android Jetpack Compose

Android without layout files? Yes, it's the era of declarative UI development. The shift has arrived on the Web with Angular/React, iOS with Swift-UI, hybrid Android with Flutter and now with Jetpack Compose on native Android development.

"Historically, an Android view hierarchy has been representable as a tree of UI widgets. As the state of the app changes because of things like user interactions, the UI hierarchy needs to be updated to display the current data. The most common way of updating the UI is to walk the tree using functions like findViewById(), and change nodes by calling methods like button.setText(String), container.addChild(View), or img.setImageBitmap(Bitmap). These methods change the internal state of the widget. Manipulating views manually increases the likelihood of errors. If a piece of data is rendered in multiple places, it’s easy to forget to update one of the views that shows it. It’s also easy to create illegal states, when two updates conflict in an unexpected way. For example, an update might try to set a value of a node that was just removed from the UI. In general, the software maintenance complexity grows with the number of views that require updating. Over the last several years, the entire industry has started shifting to a declarative UI model, which greatly simplifies the engineering associated with building and updating user interfaces. The technique works by conceptually regenerating the entire screen from scratch, then applying only the necessary changes. This approach avoids the complexity of manually updating a stateful view hierarchy. Compose is a declarative UI framework. One challenge with regenerating the entire screen is that it is potentially expensive, in terms of time, computing power, and battery usage. To mitigate this cost, Compose intelligently chooses which parts of the UI need to be redrawn at any given time. This does have some implications for how you design your UI components, as discussed in Recomposition."

https://developer.android.com/jetpack/compose/mental-model

Navigation Graph

The new Navigation Graph for developers is especially helpful to chain screen sequences, like tutorials inside your app. The following is an extract of https://www.androidauthority.com/android-navigation-architecture-component-908660/

"What is the Navigation Architecture Component? Part of Android JetPack, the Navigation Architecture Component helps you visualize the different routes through your application and simplifies the process of implementing these routes, particularly when it comes to managing fragment transactions. To use the Navigation component, you’ll need to create a Navigation Graph, which is an XML file describing how your app’s Activities and fragments relate to each other..."

Get startet on https://developer.android.com/guide/navigation/navigation-getting-started

Jetpack and AndroidX

Android is far from a finished platform and in 2018 progressed in the solution of the following challenges:

Tackling the challenge of supporting tens of thousand devices having a variety of different hardware. That means, making it easy for manufacturers to port new hardware to the platform. The new bundling mechanisms will separate code, that is unique to your app and the code, that is unique to your device, so Google can serve for each app bespoke libraries for each hardware over the Play Store. Separating modules, that can be installed by any hardware manufacturer, without any help from Google, from those, that want to license their device with Google's services. With AndroidX, the downward compatibility libraries (support libraries) are now separated from the Android SDK. Making developers want to use Google Services, instead of self made or third party's, so data is stored on Google's servers. With Jetpack, Google created a new container for high level convenience libraries on top of the Android SDK.
Read more here: https://stackoverflow.com/a/52002285/2477937