Friday, July 04, 2014

Learning Android Wear programming

Due to hurricane Arthur, most of my July 4th outdoor activities have been canceled, and I decided to start learning Android Wear programming.

Following the tutorial at http://developer.android.com/training/wearables/apps/creating.html, I have updated my emulators to support SDK Level 20, assign ARM image, and downloaded the Android Wear app from Google Play store.

I am using an older Android phone. After downloading Android Wear app from Google Play store and installed it, the device suggested I need to update Google Search service and Google Play app. After these 2 apps got updated, the Android Wear app started on the phone.

Developer needs to
start up the emulator first, and
wait for the emulator to fully start up with home screen displayed
connect the phone to the PC/laptop
forward the port adb -d forward tcp:5601 tcp:5601 in the command prompt of Android Studio
start up the Android Wear app on the device

In the Android Wear app on the phone, a view similar to the home screen of the emulator is also displayed. There is an watch icon in the action bar on the left side, next to it is the title "Emulator", below it is the status. On the right side of the action barm there is an Android Smartwatch icon, settings icon, and menu. tapping on watch icon, the status of the emulator in the Android Wear app would say "Connected". Now we can see the notifications on the phone is available on the emulator.

If the phone can not connect to the emulator, please unplug the phone from the PC/laptop, and plug it again, it is also helpful to wipe the data when the emulator is started.




No comments: