James Scott

2 minute read

Setting up the Android Virtual Device

In the previous post, I suggested that you make the AVDs after making your project for a few reasons. Upon setting up the project, you selected which handheld and wear SDK levels you wanted (even though wear only has one level right now).

Now, you create your AVDs accordingly as specified here. After, creating the AVDs, you’re ready to go!

Since we are anxious to try the Android emulator out with the Android Wear image, make sure you change the menu beside the green play button to wear then press it.

Kudos:¬†Android Studio / InteliJ interfaces nicely with Mavericks’s notification system

Android Emulator Starting Up

Unfortunately, I was unable to run the application due to an error.

Did some searching and found out that other people have had the same problem. In this StackOverflow post, they address the problem. but I came up with a simpler solution by just changing the “compileSdkVersion” and “targetSdkVersion” as seen below.

apply plugin: 'com.android.application'

android {
 compileSdkVersion 20 // James C. Scott edit. original: 'android-L'
 buildToolsVersion "20.0.0"

 defaultConfig {
 applicationId "com.example.jamescscott.helloworldwear"
 minSdkVersion 20
 targetSdkVersion 20 // James C. Scott edit. original: 'L'
 versionCode 1
 versionName "1.0"
 buildTypes {
 release {
 runProguard false
 proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

dependencies {
 compile fileTree(dir: 'libs', include: ['*.jar'])
 compile 'com.google.android.support:wearable:+'
 compile 'com.google.android.gms:play-services-wearable:+'

After the change, the app should run and you should have hello world!

More text

comments powered by Disqus