Last active
August 14, 2020 04:51
-
-
Save Garyteck/84587d78fd49c186acb0ee3e164c8533 to your computer and use it in GitHub Desktop.
CryptoCurrency Entity with Room
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Entity(tableName = "CryptoCurrency") | |
data class CryptoCurrency( | |
@PrimaryKey | |
val id: String, | |
val changePercent24Hr: String?, | |
val marketCapUsd: String?, | |
val maxSupply: String?, | |
val name: String?, | |
val priceUsd: String?, | |
val rank: String?, | |
val supply: String?, | |
val symbol: String?, | |
val volumeUsd24Hr: String?, | |
val vwap24Hr: String? | |
) | |
//Room Library in your app build.gradle file | |
def room_version = '2.3.0-alpha02' | |
kapt "androidx.room:room-compiler:$room_version" | |
implementation "androidx.room:room-runtime:$room_version" | |
implementation "androidx.room:room-ktx:$room_version" | |
implementation "androidx.room:room-testing:$room_version" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment