当前位置:网站首页>Using jetpack libraries in applications
Using jetpack libraries in applications
2022-07-25 23:31:00 【Cola Kolo】
Use... In your application Jetpack library
all Jetpack Components are available in Google Maven Found in the code base .
open settings.gradle file , take google() Add code base to dependencyResolutionManagement { repositories {...}} In block , As shown below :
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
jcenter()
}
}
then , You can use the build.gradle Add... To the file Jetpack Components ( for example LiveData and ViewModel And so on ), As shown below :
dependencies {
def lifecycle_version = "2.2.0"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version"
...
}
many Jetpack Libraries provide Android KTX Expand , As above lifecycle-livedata-ktx and lifecycle-viewmodel-ktx Shown .KTX The extension is based on Java Of API Build on , Make the most of it Kotlin Unique language functions .
For new Jetpack Library version , Please check out Version information page .
be based on Kotlin And based on Java Of API The reference document page applies to all Jetpack library .
边栏推荐
- Recursion of function (use recursion to find the factorial of 1-N) (use recursion to find Fibonacci sequence) (use recursion to traverse data)
- Which securities firm is the best and safest for beginners to open an account
- Node Foundation
- Yii2 behavior usage and its calling method
- 学习探索-3d轮播卡片
- [QNX hypervisor 2.2 user manual]9.8 load
- Moment.js
- How does PHP remove an element from an array based on the key value
- MVVM model
- [nodejs] nodejs create a simple server
猜你喜欢

Grain Academy p98 trample pit e.globalexceptionhandler: null

Cuteone: a onedrive multi network disk mounting program / with member / synchronization and other functions

类和对象(2)(6个默认成员函数)

utility实用组件学习之swap,move,forward,exchange

Very simple vsplayaudio online music player plug-in

学习探索-3d轮播卡片

Solution of phpstudy service environment 80 port occupied by process system under Windows

chown: changing ownership of ‘/var/lib/mysql/‘: Operation not permitted

Apple CMS V10 template /mxone Pro adaptive film and television website template

POI特效 市场调研
随机推荐
PyTorch的数据输入格式要求及转换
1913. Maximum product difference between two number pairs - no sorting required
Docker 安装 Redis-5.0.12(远程访问)
【代码案例】博客页面设计(附完整源码)
Very simple vsplayaudio online music player plug-in
What is a physical firewall? What's the effect?
MVVM model
TS basic data type
E-commerce RPA, a magic weapon to promote easy entry
npm+模块加载机制
[QNX Hypervisor 2.2用户手册]9.6 gdb
Anti shake and throttling
[testing technology automated testing pytest] basic summary of pytest
762. 二进制表示中质数个计算置位
@Autowired annotation required attribute
Classes and objects (2) (6 default member functions)
Query commodity cases (operate data with array addition method) / key points
关于优先队列
Source code of wechat applet for discerning flowers and plants / source code of wechat applet for discerning plants
Three board axe! Help you become an excellent software engineer