Skip to content

Commit

Permalink
New api demo app structure in place
Browse files Browse the repository at this point in the history
  • Loading branch information
dkhawk committed Feb 9, 2024
1 parent 99ba60f commit bd21d4e
Show file tree
Hide file tree
Showing 29 changed files with 955 additions and 1 deletion.
1 change: 1 addition & 0 deletions newplacesapidemoapp/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
98 changes: 98 additions & 0 deletions newplacesapidemoapp/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin")
kotlin("kapt")
id("com.google.dagger.hilt.android")
}

android {
namespace = "com.example.newplacesapidemoapp"
compileSdk = 34

defaultConfig {
applicationId = "com.example.newplacesapidemoapp"
minSdk = 26
targetSdk = 34
versionCode = 1
versionName = "1.0"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary = true
}
}

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
buildFeatures {
compose = true
buildConfig = true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.5.9"
}
packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
}
}

dependencies {

implementation("androidx.core:core-ktx:1.12.0")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.7.0")
implementation("androidx.activity:activity-compose:1.8.2")
implementation(platform("androidx.compose:compose-bom:2024.01.00"))
implementation("androidx.compose.ui:ui")
implementation("androidx.compose.ui:ui-graphics")
implementation("androidx.compose.ui:ui-tooling-preview")
implementation("androidx.compose.material3:material3")

testImplementation("junit:junit:4.13.2")

androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
androidTestImplementation(platform("androidx.compose:compose-bom:2024.01.00"))
androidTestImplementation("androidx.compose.ui:ui-test-junit4")

debugImplementation("androidx.compose.ui:ui-tooling")
debugImplementation("androidx.compose.ui:ui-test-manifest")

// Hilt
val hiltVersion = "2.50"
implementation("com.google.dagger:hilt-android:$hiltVersion")
kapt("com.google.dagger:hilt-android-compiler:$hiltVersion")

implementation("com.google.accompanist:accompanist-permissions:0.31.1-alpha")

// Jetpack navigation
val navVersion = "2.7.7"
// Jetpack Compose Integration
implementation("androidx.navigation:navigation-compose:$navVersion")

implementation("com.google.android.libraries.places:places:3.3.0")
implementation("com.google.android.gms:play-services-maps:18.2.0")
implementation(project(":places-ktx"))
}

secrets {
// To add your Maps API key to this project:
// 1. Create a file ./secrets.properties in the root folder of the project
// 2. Add this line, where YOUR_API_KEY is your API key:
// PLACES_API_KEY=YOUR_API_KEY
propertiesFileName = "secrets.properties"
defaultPropertiesFileName = "local.defaults.properties"
}
21 changes: 21 additions & 0 deletions newplacesapidemoapp/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.example.newplacesapidemoapp

import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4

import org.junit.Test
import org.junit.runner.RunWith

import org.junit.Assert.*

/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.example.newplacesapidemoapp", appContext.packageName)
}
}
24 changes: 24 additions & 0 deletions newplacesapidemoapp/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:name=".NewPlacesApiDemoApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.Androidplacesktx">
<activity
android:name=".NewPlacesApiDemoActivity"
android:exported="true"
android:theme="@style/Theme.Androidplacesktx">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>
Loading

0 comments on commit bd21d4e

Please sign in to comment.