Android Examples

Introduction

This page contains example projects for Android.

Example Sound Project

This example shows how to load sound files in Android, play them, and stop them.  The contents of the TAR file can be extracted and installed in a running Android emulator.

1. Download the latest version of the sound example TAR file using the following link:
Sound Example Release 2

2. Start an Android emulator.

3. Extract the contents of the TAR file.

$ tar xf example-sound_2011-08-07_002.tar

4. Navigate to the extracted directory.

$ cd example-sound_2011-08-07_002/

5. Update the file “local.properties” to point to the path of your Android SDK directory.

6. Update the file “default.properties” if you want to target a different version of Android.

7. Run Ant to install the sound example.

$ ant install-android-emulator

 

The sound files included in this package were created by Mike Koenig and are licensed under the Creative Commons Attribution 3.0 license.

Example Texture and Vertex Buffers

This example shows how to bind textures and create buffers for vertex data. Note: This example leverages the Google triangle example from this site.  We take no credit for the original triangle code.  We just didn’t want to write the boiler-plate from scratch just to illustrate a simple point.  The original code was under the Apache license.

1. Download the latest version of the texture example TAR file using the following link:

Texture Example Release 1
2. Start an Android emulator.

3. Extract the contents of the TAR file.

$ tar xf example-texture_2011-08-07.tar

4. Navigate to the extracted directory.

$ cd example-texture_2011-08-07/

5. Update the file “local.properties” to point to the path of your Android SDK directory.

6. Update the file “default.properties” if you want to target a different version of Android.

7. Run Ant to install the sound example.

$ ant install-android-emulator

 

1 thought on “Android Examples”

Comments are closed.