- Android Wear Projects
- Ashok Kumar S
- 107字
- 2021-07-15 17:17:53
Multifunction buttons
In addition to the power button, Android Wear supports another button called the multifunction button on the device. The Wearable support library provides API for determining the multifunction buttons included by the manufacturer:
@Override
// Activity
public boolean onKeyDown(int keyCode, KeyEvent event){
if (event.getRepeatCount() == 0) {
if (keyCode == KeyEvent.KEYCODE_STEM_1) {
// Do stuff
return true;
} else if (keyCode == KeyEvent.KEYCODE_STEM_2) {
// Do stuff
return true;
} else if (keyCode == KeyEvent.KEYCODE_STEM_3) {
// Do stuff
return true;
}
}
return super.onKeyDown(keyCode, event);
}
Visit https://developer.android.com/training/wearables/ui/index.html for any sort of query that you might have on design guidelines for Wear device programming.
推薦閱讀
- Learning Microsoft Windows Server 2012 Dynamic Access Control
- Pandas Cookbook
- JavaScript:Moving to ES2015
- Unity&VR游戲美術設計實戰
- Qt5 C++ GUI Programming Cookbook
- Deep Learning with R Cookbook
- Mastering HTML5 Forms
- Node.js從入門到精通
- Clojure Polymorphism
- Learning Bootstrap 4(Second Edition)
- Java并發實現原理:JDK源碼剖析
- 計算機應用基礎案例教程(第二版)
- Learning Cocos2d-JS Game Development
- Python趣味創意編程
- Java核心技術速學版(第3版)