Simple(vanilla) yet 'Do it all' place picker for your place picking needs in Android

Overview

Vanilla Place Picker

Vanilla Place Picker provides a UI that displays an interactive map to get the place details and Autocomplete functionality, which displays place predictions based on user search input.

Developers often come across a requirement of adding precise location. So, a place picker which is easy to implement, less time consuming, and simple enough for users to use it is always in demand and here we have a Vanilla Place Picker which developer can add it in quick simple steps.

Preview

image image

Key features

  • Simple implementation for place picker either using Autocomplete, Map or both
  • Set your own custom map styles
  • Customise map pin icon
  • Set default location position
  • Use it without location permission
  • Choose to show only open businesses or all
  • Highly customise attributes
  • Multi languages support.
  • RTL layout support.

Usage

  • Dependencies

    Step 1. Add the JitPack repository to your build file

    Add it in your root build.gradle at the end of repositories:

        allprojects {
    	    repositories {
    		    ...
    		    maven { url 'https://jitpack.io' }
    	    }
        }

    Step 2. Add the dependency

    Add it in your app module build.gradle:

        dependencies {
            ...
            implementation 'com.github.Mindinventory:VanillaPlacePicker:0.1.3'
        }
  • Implementation

    Step 1. Add GOOGLE MAP API KEY to your AndroidManifest.xml:

      <application ... >
        ...
        
        <meta-data
            android:name="com.google.android.geo.API_KEY"
            android:value="@string/YOUR_GOOGLE_MAPS_API_KEY" />
        
      </application>

    Step 2. Add VanillaPlacePicker Builder in to your activity class:

            val intent = VanillaPlacePicker.Builder(this)
                .with(PickerType.MAP_WITH_AUTO_COMPLETE) // Select Picker type to enable autocompelte, map or both
                .withLocation(23.057582, 72.534458)
                .setPickerLanguage(PickerLanguage.HINDI) // Apply language to picker
                .setLocationRestriction(LatLng(23.0558088,72.5325067), LatLng(23.0587592,72.5357321)) // Restrict location bounds in map and autocomplete
                .setCountry("IN") // Only for Autocomplete
                .enableShowMapAfterSearchResult(true) // To show the map after selecting the place from place picker only for PickerType.MAP_WITH_AUTO_COMPLETE
    
                /*
                 * Configuration for Map UI
                 */
                .setMapType(MapType.SATELLITE) // Choose map type (Only applicable for map screen) 
                .setMapStyle(R.raw.style_json) // Containing the JSON style declaration for night-mode styling
                .setMapPinDrawable(android.R.drawable.ic_menu_mylocation) // To give custom pin image for map marker
                ...
    
                .build()
    
            startActivityForResult(intent, REQUEST_PLACE_PICKER)
    
        ...
    
        //----- override onActivityResult function to get Vanilla Place Picker result.
        override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
            super.onActivityResult(requestCode, resultCode, data)
            if (resultCode == Activity.RESULT_OK && data != null) {
                when (requestCode) {
                    REQUEST_PLACE_PICKER -> {
                         val vanillaAddress = VanillaPlacePicker.onActivityResult(data)
                    }
                }
            }
        }
        

Requirements

  • minSdkVersion >= 17
  • Androidx

LICENSE!

Vanilla Place Picker is MIT-licensed.

Let us know!

We’d be really happy if you send us links to your projects where you use our component. Just send an email to [email protected] And do let us know if you have any questions or suggestion regarding our work.

Comments
  • Show keyboard on search screen

    Show keyboard on search screen

    I think it's a necessary UX improvement to show the keyboard when entering the Search screen, that way the user will be able to type straightaway without having to tap on the top bar.

    opened by Gnzlt 7
  • On Activity Result gives me a different coordinates from the ones i did select on the map

    On Activity Result gives me a different coordinates from the ones i did select on the map

    Hi all, I love this library and its features, have been using it for a while now. I recently noticed something weird! If I select a location where there is no road, I will get different coordinates within the onActivityResult function, those coordinates are in the nearest road from the selected ones.

    Have you implemented this feature on purpose?

    opened by MahmoudiOussama 5
  • Show selected location from autoComplete in map

    Show selected location from autoComplete in map

    When we open auto-complete from map picker, it will be great if u give an option to show the location in the map when selecting from the auto-complete suggestion before delivery it to the intent.

    enhancement 
    opened by abhimuktheeswarar 4
  • is that library affected by the places API changes google is doing?

    is that library affected by the places API changes google is doing?

    Google has deprecated the place picker and will be removing it completely, please do not use Place picker in your project and more

    I just want to have a place picker. I don't even need autocomplete.

    opened by DennyWeinberg 4
  • IncompatibleClassChangeError

    IncompatibleClassChangeError

    java.lang.IncompatibleClassChangeError: Found interface com.google.android.gms.location.SettingsClient, but class was expected (declaration of 'com.google.android.gms.location.SettingsClient' appears in base.apk)

    opened by Irfanhaidermomin 3
  • Trying to launch the library error

    Trying to launch the library error

    java.lang.UnsupportedOperationException: Failed to resolve attribute at index 6: TypedValue{t=0x2/d=0x101009b a=1} at android.content.res.TypedArray.getColorStateList(TypedArray.java:598) at android.widget.TextView.readTextAppearance(TextView.java:3975) at android.widget.TextView.(TextView.java:1027) at android.widget.TextView.(TextView.java:968) at android.widget.TextView.(TextView.java:964) at android.widget.TextView.(TextView.java:960) at com.google.maps.api.android.lib6.impl.fh.(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (100306-0):8) at com.google.maps.api.android.lib6.impl.bo.az(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (100306-0):16) at com.google.maps.api.android.lib6.impl.cr.o(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (100306-0):2) at com.google.android.gms.maps.internal.o.aX(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (100306-0):19) at ef.onTransact(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (100306-0):4) at android.os.Binder.transact(Binder.java:914) at com.google.android.gms.internal.maps.zza.zzH(com.google.android.gms:play-services-maps@@18.0.0:2) at com.google.android.gms.maps.internal.zzk.onCreateView(com.google.android.gms:play-services-maps@@18.0.0:5) at com.google.android.gms.maps.zzau.onCreateView(com.google.android.gms:play-services-maps@@18.0.0:7) at com.google.android.gms.dynamic.zad.zab(com.google.android.gms:play-services-base@@18.0.1:2) at com.google.android.gms.dynamic.DeferredLifecycleHelper.zaf(com.google.android.gms:play-services-base@@18.0.1:1) at com.google.android.gms.dynamic.DeferredLifecycleHelper.onCreateView(com.google.android.gms:play-services-base@@18.0.1:2) at com.google.android.gms.maps.SupportMapFragment.onCreateView(com.google.android.gms:play-services-maps@@18.0.0:1) at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2963) at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:518) at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:282) at androidx.fragment.app.FragmentStore.moveToExpectedState(FragmentStore.java:112) at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1647) at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:3128) at androidx.fragment.app.FragmentManager.dispatchActivityCreated(FragmentManager.java:3072) at androidx.fragment.app.FragmentController.dispatchActivityCreated(FragmentController.java:251) at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:502) at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java:246) at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1432) at android.app.Activity.performStart(Activity.java:7923) at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3364) at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:221) at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:201) at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:173) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2073) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:225) at android.app.ActivityThread.main(ActivityThread.java:7563) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:994)

    opened by delaroy 2
  • issue with VanillaPlacePicker:0.0.9 using with java

    issue with VanillaPlacePicker:0.0.9 using with java

     Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.vanillaplacepicker.data.VanillaAddress.getFormattedAddress()' on a null object reference
    
    bug 
    opened by amitimg29 2
  • Pick button is obstructed in full screen phones

    Pick button is obstructed in full screen phones

    When starting Intent intent = (new VanillaPlacePicker.Builder(Add_Property.this).setTintColor(R.color.colorAccent).enableSatelliteView(true).with(PickerType.MAP).build());

                            startActivityForResult(intent, 100);
    

    The activity starts in full screen, on full screen phones such as S10 Plus , the pick button is behind the fron camera and cannot be clicked.

    enhancement 
    opened by quantyam 2
  • Decrease minSdkVersion to 17

    Decrease minSdkVersion to 17

    The project where I'm planning to use this lib requires at least Android 4.2 and I couldn't find any issue to make this project backwards compatible up to SDK 17.

    Disclaimer: I know the ideal case would be to increase it 🤦‍♂

    opened by Gnzlt 2
  • Auto complete not giving  result according to set country

    Auto complete not giving result according to set country

    if (vanillaConfig.country.isNullOrBlank()) { autocomplete.setCountry(vanillaConfig.country) }

    May be the issue in this function May be ! sign is missing there if (!vanillaConfig.country.isNullOrBlank())

    bug 
    opened by hamza11223322 1
  • Automomplete result not getting

    Automomplete result not getting

    Hello,

    I'm integrating this awesome library, but unfortunately with MAP_WITH_AUTO_COMPLETE, google auto search fragment open. but when I am searching some places it closed automatically without showing any result.

    Please let me know the solution for this.

    Thanks

    opened by Gurmail89 1
Releases(0.3.1)
Owner
MindInventory
MindInventory works with Enterprises, Startups, and Agencies since 2011 providing web, mobile app development, enterprise mobility solutions & DevOps services.
MindInventory
Order picking with QR codes

Order PiQR Order picking with QR codes Open the project in Android Studio and run. First step was to create a new simple project in Android Studio. Th

Marcel van Pinxteren 0 Dec 3, 2021
Solves the audit needs for any JVM based application

Auditor-v1 Solves the audit needs for any JVM based application.

Lowe's 12 Dec 15, 2022
A simple e-market application that allows users to view the store details and products, add products to the basket, and place an order.

E-Market Application Features : Store details & products screen Fetch the store detail from an endpoint and display this upper part of the screen. Fet

Amit Kumar guha 2 Jun 27, 2022
All in 1 picker library for android.

Lassi Lassi is simplest way to pick media (either image, video, audio or doc) Lassi Media picker Key features Simple implementation Set your own custo

MindInventory 137 Dec 30, 2022
Android Ptrace Inject for all ABIs and all APIs. Help you inject Shared Library on Android.

Android Ptrace Inject 中文可以参考我的注释内容进行理解 我写的注释相对来说比较全面了 How to build Make sure you have CMake and Ninja in your PATH Edit CMakeLists.txt. Set ANDROID_ND

SsageParuders 65 Dec 19, 2022
Yet another booru viewer for Android

Yet another booru imageboards viewer for Android Download Preview Click Here Building You can build this app just like any other flutter app, for exam

Nauval Rizky 129 Jan 4, 2023
Kotlin Multiplatform Mobile version of Tisdagsgolfen... yet another version.

TheCube in Kotlin Multiplatform Experimenting with KMM, and Kotlin, Jetpack, SwiftUI, and all the other new stuff... https://kotlinlang.org/docs/kmm-g

Kim Fransman 0 Dec 25, 2022
Yet Another Native Loader for the JVM.

yanl - yet another native loader Yet another Native library extractor/loader for the JVM, written in Kotlin. why other libraries simply don't fit my n

Stardust Enterprises 5 Dec 23, 2022
Yet another advanced Craftfting Table mod. My entry for ModFest: Singularity

Crafting Bench A utility mod that adds a custom crafting table with semi-automatic crafting. Features For a complete list of features please check the

Luca Argolo 2 Aug 23, 2022
Automatically empty the trash in all of your Plex libraries

Plex Auto Trash Automatically empty the trash in all of your Plex libraries. If you disable automatic trash emptying (and you probably should) trash s

Jake Wharton 25 Aug 11, 2022
Add Wheel Date - Time Picker in Android Jetpack Compose.

WheelPickerCompose Add Wheel Date - Time Picker in Android Jetpack Compose. Usage Picker Usage WheelDateTimePicker { snappedDateTime -> } WheelDatePic

Emir Demirli 81 Dec 30, 2022
Klimatic is an android app built using Kotlin. It try to showcase all the latest technologies used in android.

Klimatic Klimatic is an android app built using Kotlin. It try to showcase all the latest technologies used in android. Built using Android Architectu

Shivam Satija 34 Oct 11, 2022
An example for who are all going to start learning Kotlin programming language to develop Android application.

Kotlin Example Here is an example for who are all going to start learning Kotlin programming language to develop Android application. First check this

Prabhakar Thota 56 Sep 16, 2022
An Android app with many challenge modules and SOLID at all

android-super-app An Android app with many challenge modules and SOLID at all. Features Kotlin Coroutines with Flow (State Flow) Kotlin Serialization

Thiago Santos 21 Nov 28, 2022
Dots indicator that shows the current position on a View Pager. It does all the work for you with a few customisations.

Dots What is Dots? Dots is a library that helps in implementing a simple yet effective dots indicator for the View Pagers used in your android code. I

Deepan 23 Feb 16, 2022
The Superhero app keeps track of the near real-time location of all the volunteers.

Superhero The Superhero app keeps track of the near real-time location of all the volunteers. The app sends requests for emergency tasks to nearby vol

CoronaSafe Network 4 May 3, 2022
LanServers - A small plugin written in Kotlin that runs on all major Minecraft Servers

LanServers This is a small plugin written in Kotlin that runs on all major Minec

Redstonecrafter0 6 Mar 12, 2022
Mars is an all-in-one plugin for PGM servers

Mars Mars is an all-in-one plugin for PGM servers. Using Mars Contributing to Mars Why? Mars was built to handle everything that PGM isn't supposed to

Warzone 6 Feb 13, 2022