Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 24 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
24
Dung lượng
1,09 MB
Nội dung
Introduction to new coming AndroidX libraries Anh.Tran @Android team 07/09/2018 Contents Quick introduction of Android JetPack AndroidX library Demo Android JetPack (a flash introduction) ● Google IO 2018 ● https://developer.android.com/jetpack/ Android JetPack (a flash introduction) AndroidX - 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 - 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 Why need refactoring? v4, v7, v13, … v-x, by the x, mean minimum SDK support So “v-4” support until SDK level 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 v4, v7, v13, … https://stackoverflow.com/questions/15109017/difference-between-android-app-fragment-and-a ndroid-support-v4-app-fragment So … it’s time to refactor AndroidX ~ 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 Notes no more v-4 v-7 v-13 v-14 Android android.* and androidx.* Reset version back to `1.0.0` How to migration to AndroidX AS 3.2 Beta Canary 15+ https://developer.android.com/topic/libraries/su pport-library/androidx-rn After migration Demo time Let’s try with our Quoinex Android project! Prepare - Android Studio 3.2 RC2 - Gradle 4.6 - Gradle build tool 3.2-rc02 - Update SDK API to 28 Issues after migration - - Dagger - No issue with Quoinex project ButterKnife - https://github.com/JakeWharton/butterknife/issues/1296 - Use `9.0.0-Snapshot` Resolve some method signature changed - RecyclerView constructor Test - `android.test.mock.MockContext` no more found About versioning Still multiple numbers of version (1.0.0, 2.0.0, …) Still not stable Summary ‘AndroidX’ is just a refactor of support libraries and versioning Quoinex app can be migrated to ‘androidX’ with only some issues fixes (ButterKnife, Test, …) ‘AndroidX’ is still not stable for production Should wait Google for next announcements Thank you! ... might not in Android Jetpack (KTX and Slices are the AndroidX features and both also in Android Jetpack) AndroidX - What is it? What different between Android Jetpack and AndroidX? Android Jetpack... 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. .. across Android versions Notes no more v-4 v-7 v-13 v-14 Android android.* and androidx. * Reset version back to `1.0.0` How to migration to AndroidX AS 3.2 Beta Canary 15+ https:/ /developer .android. com/topic/libraries/su