DEV Community

Shivam Tailor
Shivam Tailor

Posted on

Google Places API Library for Android

πŸš€ Just Released: Google Places API Library for Android! πŸŒπŸ“
I’m excited to share my Google Places API Library built in Kotlin! πŸŽ‰ Now, developers can easily integrate Google Places autocomplete search into their Android apps with minimal setup.

πŸ”₯ Features:
βœ… Easy-to-use API – Just add the dependency and initialize
βœ… Optimized performance – Uses Coroutines for fast API calls
βœ… Custom AutoComplete View – Works smoothly with minimal UI code
βœ… JitPack Integration – Simple to include in any project

πŸ“Œ GitHub Repository:
πŸ‘‰

GitHub logo tailorshivam / GooglePlacesLib

Developers can easily integrate Google Places autocomplete search into their Android apps with minimal setup.

Hi πŸ‘‹, I'm Shivam Tailor

A passionate android developer

GooglePlacesLib πŸš€

An easy-to-use Google Places API Library for Android.

Platform Language Version

πŸ“Œ Installation

Add JitPack to settings.gradle.kts:

dependencyResolutionManagement {
    repositories {
        google()
        mavenCentral()
        maven { url = uri("https://jitpack.io") }
    }
}
Enter fullscreen mode Exit fullscreen mode

Then, add the dependency:

dependencies {
    implementation("com.github.tailorshivam:GooglePlacesLib:TAG")
}
Enter fullscreen mode Exit fullscreen mode

🎯 Usage

Initialize in MainActivity.kt:

GooglePlaces.initialize(this, "YOUR_API_KEY")

val autoCompleteView = findViewById<PlacesAutoCompleteView>(R.id.placesAutoCompleteView)
autoCompleteView.initialize("YOUR_API_KEY")
Enter fullscreen mode Exit fullscreen mode

Add in activity_main.xml:

<com.shivam.googleplaceslib.PlacesAutoCompleteView
    android:id="@+id/placesAutoCompleteView"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:hint="Search places..." />
Enter fullscreen mode Exit fullscreen mode

Connect with me:

shivam-tailor-509833106 9581339/tailor-shivam






πŸ›  How to Use:
1️⃣ Add this to your settings.gradle.kts:

dependencyResolutionManagement {
    repositories {
        google()
        mavenCentral()
        maven { url = uri("https://jitpack.io") }
    }
}
Enter fullscreen mode Exit fullscreen mode

2️⃣ Add the dependency in build.gradle.kts:

dependencies {
    implementation("com.github.tailorshivam:GooglePlacesLib:1.0.1")
}
Enter fullscreen mode Exit fullscreen mode

3️⃣ Use it in your MainActivity.kt:

GooglePlaces.initialize(this, "YOUR_API_KEY")
val autoCompleteView = findViewById<PlacesAutoCompleteView>(R.id.placesAutoCompleteView)
autoCompleteView.initialize("YOUR_API_KEY")
Enter fullscreen mode Exit fullscreen mode

❀️ Support & Feedback
⭐ Star the repository on GitHub if you find it useful!
πŸ’¬ I’d love your feedback – Let me know what features you’d like to see next!

πŸš€ Let’s make Android development easier, together! #Kotlin #AndroidDevelopment #GooglePlacesAPI #OpenSource #JitPack #Android #Support

Top comments (0)