Introduction to new comingAndroidX libraries Anh.Tran @Android team 07/09/2018... Android JetPack a flash introduction... AndroidX - What is it?What different between Android Jetpack and
Trang 1Introduction to new coming
AndroidX libraries
Anh.Tran @Android team
07/09/2018
Trang 21 Quick introduction of Android JetPack
2 AndroidX library
3 Demo
Trang 31 Android JetPack (a flash introduction)
● Google IO 2018
● https://developer.android.com/jetpack/
Trang 41 Android JetPack (a flash introduction)
Trang 5AndroidX - What is it?
What different between Android Jetpack and AndroidX?
Trang 6AndroidX - What is it?
What different between Android Jetpack and AndroidX?
Android Jetpack
Set of libraries, provide recommendation and tools to let you create a good app.
AndroidX
AndroidX is a library itself, which is its feature might or might not in Android Jetpack
(KTX and Slices are the AndroidX features and both also in Android Jetpack)
AndroidX = Support libraries + Refactor
Trang 7Why need refactoring?
Trang 8v4, v7, v13, ….
v-x, by the x, mean minimum SDK support So “v-4” support until SDK level 4.
v4 Support Library is for Android 1.6 (API level 4) Android 2.3 (API level 9) Android 4.0 (API
level 14) and higher.
v7 Support Library is for Android 2.1 (API level 7) Android 2.3 (API level 9) Android 4.0 (API
level 14) and higher.
v13 Support Library is for Android 3.2 (API level 13) and higher However, the new features in
v13 have depicted already.
https://stackoverflow.com/questions/18271429/difference-between-android-support-v7-appcom pat-and-android-support-v4
Trang 9v4, v7, v13, ….
https://stackoverflow.com/questions/15109017/difference-between-android-app-fragment-and-a ndroid-support-v4-app-fragment
Trang 10So
… it’s time to refactor
Trang 11AndroidX ~ Android eXtension libraries
● android.* - class which are bundled with the operating system and
can have different APIs and behavior for different Android versions.
● androidx.* - Classes like AppCompatActivity or ViewModel, which
are unbundled from the operating system and ship in your apk These
libraries are written to provide a single API surface with behavior
that's as consistent as possible across Android versions.
Trang 121 no more v-4 v-7 v-13 v-14
2 Android android.* and androidx.*
3 Reset version back to `1.0.0`
Trang 13How to migration to AndroidX
AS 3.2 Beta
Trang 14After migration
Trang 15Demo time
Let’s try with our Quoinex Android project!
Trang 20Issues after migration
Trang 21About versioning
Still multiple numbers of version (1.0.0, 2.0.0, …)
Trang 22Still not stable
Trang 231 ‘AndroidX’ is just a refactor of support libraries and
versioning
2 Quoinex app can be migrated to ‘androidX’ with only
some issues fixes (ButterKnife, Test, …)
3 ‘AndroidX’ is still not stable for production Should
wait Google for next announcements
Trang 24Thank you!