This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public void onSearchCalled() { | |
| // Set the fields to specify which types of place data to return. | |
| List<Place.Field> fields = Arrays.asList(Place.Field.ID, Place.Field.NAME, Place.Field.ADDRESS, Place.Field.LAT_LNG); | |
| // Start the autocomplete intent. | |
| Intent intent = new Autocomplete.IntentBuilder( | |
| AutocompleteActivityMode.FULLSCREEN, fields).setCountry("NG") //NIGERIA | |
| .build(this); | |
| startActivityForResult(intent, AUTOCOMPLETE_REQUEST_CODE); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Override | |
| protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { | |
| if (requestCode == AUTOCOMPLETE_REQUEST_CODE) { | |
| if (resultCode == RESULT_OK) { | |
| Place place = Autocomplete.getPlaceFromIntent(data); | |
| Log.i(TAG, "Place: " + place.getName() + ", " + place.getId() + ", " + place.getAddress()); | |
| Toast.makeText(AutocompleteFromIntentActivity.this, "ID: " + place.getId() + "address:" + place.getAddress() + "Name:" + place.getName() + " latlong: " + place.getLatLng(), Toast.LENGTH_LONG).show(); | |
| String address = place.getAddress(); | |
| // do query with address |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="utf-8"?> | |
| <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
| xmlns:app="http://schemas.android.com/apk/res-auto" | |
| xmlns:tools="http://schemas.android.com/tools" | |
| android:layout_width="match_parent" | |
| android:layout_height="match_parent" | |
| tools:context=".PlacePredictionProgrammatically"> | |
| <EditText | |
| android:id="@+id/inputEditText" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="utf-8"?> | |
| <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
| xmlns:app="http://schemas.android.com/apk/res-auto" | |
| xmlns:tools="http://schemas.android.com/tools" | |
| android:layout_width="match_parent" | |
| android:layout_height="match_parent" | |
| tools:context=".PlacePredictionProgrammatically"> | |
| <EditText | |
| android:id="@+id/inputEditText" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="utf-8"?> | |
| <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
| xmlns:app="http://schemas.android.com/apk/res-auto" | |
| xmlns:tools="http://schemas.android.com/tools" | |
| android:layout_width="match_parent" | |
| android:layout_height="match_parent" | |
| tools:context=".PlacePredictionProgrammatically"> | |
| <EditText | |
| android:id="@+id/inputEditText" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class PlacePredictionProgrammatically extends AppCompatActivity { | |
| private static final String TAG = PlacePredictionProgrammatically.class.getSimpleName(); | |
| private EditText queryText; | |
| private Button mSearchButton; | |
| private TextView mSearchResult; | |
| private StringBuilder mResult; | |
| @Override | |
| protected void onCreate(Bundle savedInstanceState) { | |
| super.onCreate(savedInstanceState); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Created by Balram Pandey on 12/29/16. | |
| */ | |
| public class EncryptionInterceptor implements Interceptor { | |
| private static final String TAG = EncryptionInterceptor.class.getSimpleName(); | |
| private static final boolean DEBUG = true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Created by Balram Pandey on 12/29/16. | |
| */ | |
| public class EncryptionInterceptor implements Interceptor { | |
| private static final String TAG = EncryptionInterceptor.class.getSimpleName(); | |
| private static final boolean DEBUG = true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Copyright (C) 2015 Jared Rummler <jared.rummler@gmail.com> | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import javax.crypto.KeyGenerator; | |
| import javax.crypto.SecretKey; | |
| import javax.crypto.Cipher; | |
| import javax.crypto.spec.SecretKeySpec; | |
| import javax.crypto.spec.IvParameterSpec; | |
| import java.security.MessageDigest; | |
| import java.security.spec.AlgorithmParameterSpec; | |
| import android.util.Base64; | |
| public class AESEnDecryption { |