当前位置:网站首页>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 .
边栏推荐
- 关于优先队列
- 推荐系统——An Embedding Learning Framework for Numerical Features in CTR Prediction
- PHP JSON variable array problem
- Moment.js
- Enterprise level inventory management system of code audit
- Deep and shallow copies
- Mongodb query and projection operators
- Source code of YY music wechat applet imitating Netease cloud music
- Learning exploration-3d rotation card
- Regular expression (user name form verification / verification of landline number / regular replacement)
猜你喜欢

File contains vulnerability

Release of v6.5.1/2/3 series of versions of Xingyun housekeeper: the ability of database OpenAPI continues to be strengthened

numeric学习之iota,accumulate

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

The new UI people help task help PHP source code with a value of 1500 / reward task Tiktok Kwai headline like source code / with three-level distribution can be packaged applet

Docker installation redis-5.0.12 (remote access)

学习探索-3d轮播卡片

How does PHP remove an element from an array based on the key value

Taobao Search case

OASYS system of code audit
随机推荐
Mongodb update operator (modifier)
模拟实现string类常用接口
Simulate and implement common interfaces of string class
[Database Foundation] summary of MySQL Foundation
POI特效 市场调研
学习探索-3d轮播卡片
Pytorch data input format requirements and conversion
Learning exploration - waves
chown: changing ownership of ‘/var/lib/mysql/‘: Operation not permitted
ES6 syntax (difference between let, const, VaR, deconstruction assignment, arrow function, residual parameters, extension method of array)
【MUDUO】打包EventLoop和Thread
电商RPA,大促轻松上阵的法宝
推荐系统——An Embedding Learning Framework for Numerical Features in CTR Prediction
图的遍历-DFS,BFS(代码详解)
TS interface
Duplicate numbers in array
Rendering, filtering (filtering) and sorting of lists
The difference between MySQL clustered index and non clustered index
Deep and shallow copies
Family relationship calculator wechat applet source code