In addition, your app tin run on diverse versions of the platform because Android Jetpack components are built to supply their functionality independent of whatever specific version, providing backwards compatibility.
Further, Android Jetpack is built roughly modern pattern practices similar separation of concerns together with testability every bit good every bit productivity features similar Kotlin integration. This makes it far easier for you lot to build robust, high lineament apps amongst less code. While the components of Android Jetpack are built to piece of work together, e.g. lifecycle awareness together with alive data, you lot don't lead hold to utilisation all of them -- you lot tin integrate the parts of Android Jetpack that solve your problems spell keeping the parts of your app that are already working great.
We know that these benefits are of import to you lot because of feedback similar this:
"We had been thinking of trying out MVVM inwards our code base. Android Architecture Components gave us an slowly template to implement it. And it's helped brand our code to a greater extent than testable every bit well; the mightiness to unit of measurement exam ViewModels has definitely increased code robustness."
-- Sumiran Pradhan, Sr. Engineer, Zillow
If you lot desire to acquire to a greater extent than close how companies are using Android Jetpack components, you lot tin read the developer stories on the Android Developer site.
And finally, every bit you lot tin run into from the Android Jetpack diagram above, today we're announcing novel components every bit well.
What's New
Android Jetpack comes amongst 5 novel components:
- WorkManager alpha release
- Navigation alpha release
- Paging stable release
- Slices alpha release
- Android KTX (Kotlin Extensions) alpha release
WorkManager
The WorkMananager ingredient is a powerful novel library that provides a one-stop solution for constraint-based background jobs that necessitate guaranteed execution, replacing the necessitate to utilisation things similar jobs or SyncAdapters. WorkManager provides a simplified, modern API, the mightiness to piece of work on devices amongst or without Google Play Services, the mightiness to create graphs of work, together with the mightiness to inquiry the terra firma of your work. Early feedback is real encouraging but nosotros dearest to brand certain that your utilisation cases are covered, too. You tin run into what nosotros lead hold together with hence far together with supply feedback on our alpha on the WorkManager component.
Navigation
While activities are the organization provided entry points into your app's UI, their inflexibility when it comes to sharing information betwixt each other together with transitions has made them a less than ideal architecture for constructing your in-app navigation. Today nosotros are introducing the Navigation ingredient every bit a framework for structuring your in-app UI, amongst a focus on making a single-Activity app the preferred architecture. With out of the box back upward for Fragments, you lot acquire all of the Architecture Components benefits such every bit Lifecycle together with ViewModel spell allowing Navigation to handgrip the complexity of FragmentTransactions for you. Further, the Navigation ingredient allows you lot to declare transitions that nosotros handgrip for you, automatically builds the right Up together with Back behavior, includes amount back upward for deep links, together with provides helpers for connecting Navigation into the appropriate UI widgets, similar the navigation drawer together with bottom navigation. But that's non all! The Navigation Editor inwards Android Studio 3.2 allows you lot to run into together with handle your navigation properties visually:
The Navigation component is also inwards alpha together with we'd dearest your feedback.
Paging
Data presented inwards an app tin live large together with costly to load, together with hence it's of import to avoid downloading, creating, or presenting also much at once. The Paging component version 1.0.0 makes it slowly to charge together with introduce large information sets amongst fast, interplanetary space scrolling inwards your RecyclerView. It tin charge paged information from local storage, the network, or both, together with lets you lot define how your content gets loaded. It plant out of the box amongst Room, LiveData, together with RxJava.
Slices
And finally, to circular out the laid of novel features making their debut inwards Android Jetpack is the Slices component. H5N1 "slice" is a agency to surface your app's UI within of the Google Assistant every bit a consequence of a search:
You tin learn all close the Slices component together with how to integrate it into your app on the Android Developer website.
Android KTX
And lastly but non least, 1 destination of Android Jetpack takes wages of Kotlin linguistic communication features that brand you lot to a greater extent than productive. Android KTX lets you lot transform Kotlin code similar this:
view.viewTreeObserver.addOnPreDrawListener( object : ViewTreeObserver.OnPreDrawListener { override fun onPreDraw(): Boolean { viewTreeObserver.removeOnPreDrawListener(this) actionToBeTriggered() render truthful } });
into to a greater extent than concise Kotlin code similar the following:
view.doOnPreDraw { actionToBeTriggered() }
This is merely the get-go stride inwards bringing Kotlin back upward to Android Jetpack components; our destination is to brand Android Jetpack smashing for Kotlin developers (and of course of teaching Java developers!).You tin read to a greater extent than close Android KTX on the Android Developer spider web site.
Getting Started
You tin acquire started amongst Android Jetpack at developer.android.com/jetpack. You'll uncovering docs together with videos for Android Jetpack, run into what's novel inwards Android Jetpack components, participate inwards the community together with give us feedback. We've also created a YouTube playlist devoted to Android Jetpack, together with hence you lot tin melody inwards for information close Android Jetpack, components, tools together with best practices.
Getting Started amongst Android Jetpack volition say you lot how to select the Android Jetpack components into your existing apps together with attention you lot acquire started amongst novel Android Jetpack apps. Android Studio 3.2 has smashing tooling back upward for Android Jetpack. For edifice novel apps, utilisation the Activity & Fragment+ViewData activity, which you lot tin acquire to from File | New | New Project inwards Android Studio:
What's Next
With Android Jetpack, we're taking the benefits of the Support Library together with the Architecture Components together with turning it upward a notch amongst novel components, Android Studio integration together with Kotlin support. And spell Android Jetpack provides the adjacent generation components, tools together with guidance to accelerate your Android development, we've got a lot to a greater extent than that nosotros desire to do together with nosotros desire your help. Please become to developer.android.com/jetpack together with permit us know what nosotros tin do to brand your sense edifice Android apps fifty-fifty better.