Skip to content

About

SDK for Pataa Address Autofill Android

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

32 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

To add Pataa autofill address view on your app please follow the instructions.

image

image

image

**Step 1. Put pataa_autofill_sdk.aar in your project lib folder *

Step 2. Add below line in app level build.gradle

implementation fileTree(dir: "libs", include: ["*.aar"])

Step 3. Add Metadata in manifest

    <meta-data
        android:name="pataa.autofill.sdk.ClientKey"
        android:value="@string/PATAA_API_KEY" />

    <meta-data
        android:name="pataa.autofill.sdk.EnableLogger"
        android:value="true" />

Step 4. Add view on xml(Don't change the id)

    <com.pataa.sdk.PataaAutoFillView
    android:id="@+id/vPataaCodeView"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />

Step 5. Set properties and listener(Only for JAVA), For kotlin skip this step

    ((PataaAutoFillView) findViewById(R.id.vPataaCodeView))
   .setCurrentActivity(this)//to get the result of create pataa
   .setAddressCallBack(new OnAddress() {//to get the click events
       @Override
       public void onNetworkIsNotAvailable() {
           Toast.makeText(MainActivity.this, "onNetworkIsNotAvailable", Toast.LENGTH_SHORT).show();
       }

       @Override
       public void onPataaNotFound(String message) {

       }


       @Override
       public void onPataaFound(User user, Pataa
               response) {
           Toast.makeText(MainActivity.this, user.getFirst_name() + " : " + response.getFormattedAddress(), Toast.LENGTH_SHORT).show();
       }
   });

Step 6. Set properties and listener(Only for Kotlin), For Java skip this step

    findViewById<PataaAutoFillView>(R.id.vPataaCodeView)
        .setCurrentActivity(this)
        .setAddressCallBack(object : OnAddress {
            override fun onNetworkIsNotAvailable() {
                Toast.makeText(applicationContext, "onNetworkIsNotAvailable", Toast.LENGTH_SHORT).show();
            }

            override fun onPataaNotFound(message: String?) {

            }

            override fun onPataaFound(user: User?, response: Pataa?) {
                Toast.makeText(applicationContext, user?.getFirst_name() + " : " + response?.getFormattedAddress(), Toast.LENGTH_SHORT).show();
            }
        })

Step 7. Add PATAA api key on string.xml

    <resources>
	.....
	<string name="PATAA_API_KEY">+ipXPwNxxxxxxxxxxxxxxxxxxxxxxxxxxxxxvkk=</string>
    <resources>

In case of errors

    E/PATAA_SDK_LOGS: {"msg":"Invalid App key","status":600}
    E/PATAA_SDK_LOGS: Invalid App key

Solution : Enable logs from manifest metadata and copy the SHA1 key. Put it on pataa developer console, and then try again you will got the results


    E/PATAA_SDK_LOGS: {"msg":"Your key is deavtivated please generate new","status":200}
    E/PATAA_SDK_LOGS: Invalid App key

Solution : Enable the key for use on Pataa developer console or Create new key.


    E/PATAA_SDK_LOGS: {"msg":"Pataa Code not found","status":204}
    E/PATAA_SDK_LOGS: Pataa Code not found

Solution : Try to search with valid pataa code like - KUMAR100, SINGH221, Because your searched pataa code is not created on pataa platform yet.


    E/PATAA_SDK_LOGS: {"msg":"Pataa Search Limit Over","status":400}
    E/PATAA_SDK_LOGS: Pataa Search Limit Over

    E/PATAA_SDK_LOGS: {"msg":"Invalid API key or App key,you are not authorized.Please provide a valid key","status":400}
    E/PATAA_SDK_LOGS: Invalid API key or App key,you are not authorized.Please provide a valid key

For any other error : Please refer the document

About

SDK for Pataa Address Autofill Android

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors