Courtesy: GitHub

SMS Verify App

This sample demonstrates the use of Play Service's SMS Verification APIs to get access to specially-tagged text messages (the tags associate the message with the APK) without needing full SMS retrieval permission (SMS_READ).


To build the application, you will need to acquire or generate at least three (potentially four), files. These files are not distributed with this source as they contain sensitive keys, etc.

./android/app/google-services.json (configuration for Google API client). (Online tool to generate google-services.json. The package name is

./sms-verification/android/app/src/main/res/values/sensitive.xml (configures the HTTP endpoint the app uses to send the SMS). The format is:

<?xml version="1.0" encoding="utf-8"?>
  <string name="server_client_secret">0000000000</string>
  <string name="url_verify"></string>
  <string name="url_request"></string>
  <string name="url_reset"></string>

./sms-verification/android/debug.keystore (keystore used to sign the APK).

./sms-verification/appengine/ (configures the SMS itself). (Optional—this is only necessary if deploying/changing the appengine server-side component.) Use the script sms-verification/bin/ to generate the hash if required:

$ sms-verification/bin/ --package --keystore sms-verification/android/debug.keystore 

These three files have dependencies on each other; they together ensure that the text messages sent by the server can be read by Google Play Services.

compileSdkVersion 25

applicationId ""

minSdkVersion 23

targetSdkVersion 25

versionCode 1

versionName "1.0"

compile fileTree(dir: 'libs', include: ['*.jar'])

compile ''

compile ''

compile ''

compile ''

compile ''

compile ''

compile ''

compile ''

testCompile 'junit:junit:4.12'

compile ''



  • android.permission.INTERNET





A {@link PreferenceActivity} that presents a set of application settings. On handset devices, settings are presented as a single list. On tablets, settings are split by category, with category headers shown to the left of the list of settings.

See Android Design: Settings for design guidelines and the Settings API Guide for more information on developing a Settings UI.

Set up the {@link}, if the API is available.


A service to verify a telephone number.

Handle action Foo in the provided background thread with the provided parameters.