Skip to content

Instantly share code, notes, and snippets.

@barnhill
Last active December 15, 2023 23:48
Show Gist options
  • Save barnhill/1eb17ca5ad749142734cd1bbb0500a27 to your computer and use it in GitHub Desktop.
Save barnhill/1eb17ca5ad749142734cd1bbb0500a27 to your computer and use it in GitHub Desktop.
Pokemon Challenge

Android Pokemon Challenge

image

We will be building a Pokemon card viewing application today! You will be using the Pokemon TCG API

Example GET Request:

https://api.pokemontcg.io/v2/cards

Example response:

{
  "data": [
    {
      "id": "g1-1",
      "name": "Venusaur-EX",
      "images": {
        "small": "https://images.pokemontcg.io/g1/1.png",
        "large": "https://images.pokemontcg.io/g1/1_hires.png"
      }
    }
  ]
}
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-kapt'
}
android {
compileSdkVersion 33
defaultConfig {
applicationId "com.example.pokemoncards"
minSdkVersion 28
targetSdkVersion 33
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
packagingOptions {
exclude 'META-INF/main.kotlin_module'
}
}
ext.jackson_version = '2.13.4'
ext.retrofit_version = "2.9.0"
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
// Google
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.core:core-ktx:1.10.1'
implementation 'androidx.navigation:navigation-fragment-ktx:2.6.0'
implementation 'androidx.navigation:navigation-ui-ktx:2.6.0'
implementation "com.google.android.material:material:1.9.0"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4"
// Image Loading
implementation 'com.squareup.picasso:picasso:2.71828'
implementation "com.github.bumptech.glide:glide:4.14.2"
implementation "com.github.bumptech.glide:recyclerview-integration:4.14.2"
// Json Parser
implementation 'com.google.code.gson:gson:2.9.0'
implementation "com.fasterxml.jackson.core:jackson-core:$jackson_version"
implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version"
implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_version"
implementation "com.fasterxml.jackson.module:jackson-module-kotlin:$jackson_version"
// Networking
implementation "com.squareup.retrofit2:retrofit:$retrofit_version"
implementation "com.squareup.retrofit2:converter-gson:$retrofit_version"
implementation "com.squareup.retrofit2:converter-jackson:$retrofit_version"
implementation "com.squareup.okhttp3:logging-interceptor:4.9.2"
// Testing
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test:runner:1.5.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment