12 Juli 2016
Posted by Hoi Lam, Android Wear Developer Advocate
At Google I/O 2016, we launched the Android Wear 2.0 Developer Preview, which gives developers early access to the next major release of Android Wear. Since I/O, feedback from the developer community has helped us identify bugs and shape our product direction. Thank you!
Today, we are releasing the second developer preview with new functionalities and bug fixes. Prior to the consumer release, we plan to release additional updates, so please send us your feedback early and often. Please keep in mind that this preview is a work in progress, and is not yet intended for daily use.
compileSdkVersion
to API 24, and we recommend
that you also update targetSdkVersion
to API 24.
WearableActionDrawer
’s peek view. For developers that want to make
custom wearable drawers, we’ve added peek_view
and
drawer_content
attributes to WearableDrawerView
. And
finally, navigation drawer contents can now be updated by calling notifyDataSetChanged
.
public class MainActivity extends Activity {
...
@Override /* KeyEvent.Callback */
public boolean onKeyDown(int keyCode, KeyEvent event) {
switch (keyCode) {
case KeyEvent.KEYCODE_NAVIGATE_NEXT:
Log.d(TAG, "Next");
break;
case KeyEvent.KEYCODE_NAVIGATE_PREVIOUS:
Log.d(TAG, "Previous");
break;
}
// If you did not handle, then let it be handled by the next possible element as deemed by
// Activity.
return super.onKeyDown(keyCode, event);
}
}
The Android Wear 2.0 Developer Preview includes an updated SDK with tools and system images for testing on the official Android emulator, the LG Watch Urbane 2nd Edition LTE, and the Huawei Watch.
To get started, follow these steps:
We will update this developer preview over the next few months based on your feedback. The sooner we hear from you, the more we can include in the final release, so don't be shy!