Instant Buy Quick Start: Run a Sample Wallet Android App
This quick start example lets you install a sample Android app that demonstrates Google Wallet Instant Buy integration. Complete the following steps, and you can have a sample Android app running on your device:
To review the sample app's UI without setting up the sample in a development environment, you can install GoogleWalletSample.apk on your device. If you're looking for a more detailed, end-to-end sample, see the Tutorial.
Step 1: Check prerequisites
To run the quick start example you'll need:
- The Android SDK development environment.
- Google Play Services. Follow these setup instructions to import the Google Play Services library.
- A recent version of Apache Ant.
Step 2: Deploy the Android app
Download and expand the archive instant-buy-android-sample.zip. You can find the source and resources for the sample app in the
/walletdirectory of this archive.
Run the Android utility to update the projects with the Android SDK path and version. Use the latest
Android 23) that you retrieve using the command,
android list targets:
$ android update project --path <path/to/google-play-services_lib> --target <target_id> $ android update project --path ./wallet --library <relative/path/to/google-play-services_lib> --target <target_id>
Copy the Android support library JAR file from its location in the Android SDK to the
$ cp <android_sdk>/extras/android/support/v4/android-support-v4.jar ./wallet/libs
Deploy the sample app to the device by running the following command in the
$ ant clean debug install
Step 3: Launch and verify the Android app
Once you have completed all the tasks listed above, you can open the "XYZ, Inc." app on your device. The first screen displays a simple example camera store page:
You can select one of the three items and go through a typical purchase flow like the ones described in End User Flows.
If your goal is to develop a more full-featured integration of Google Wallet into an Android app, you can find more detailed guidance in our tutorial. To dive into the details of the API, see the API Reference.