Upgrade to Pro — share decks privately, control downloads, hide ads and more …

DevFest14 Zhuhai Android Wear CodeLab

Zoom.Quiet
October 18, 2014

DevFest14 Zhuhai Android Wear CodeLab

show the base dev. flow for Android Wear

Zoom.Quiet

October 18, 2014
Tweet

More Decks by Zoom.Quiet

Other Decks in Technology

Transcript

  1. 三星Gear Live智能⼿手表规格: ※ 屏幕:分辨率为320*320的1.63英⼨寸Super AMOLED屏 幕,像素密度为278ppi ※ 处理器:1.2GHz的⾼高通骁⻰龙400处理器 ※ 内存:512MB

    ※ 内置储存:4GB ※ 电池:300mAh,底部有⽆无线充电引脚 ※ 蓝⽛牙:蓝⽛牙 4.0 LE ※ 传感器:⼼心率传感器、陀螺仪、加速计和罗盘 ※ 三防:IP67 ※ 尺⼨寸:56mm * 38mm * 8.9mm ※ 重量:59g
  2. Java Development Kit Android Studio 0.8.x + Android 4.4W API

    20 Android Wear Emulator Android Wear App
  3. System App 获取语⾳音输⼊入 除了可以⽤用语⾳音操作启动activity,还可以获取⽤用户的语⾳音输⼊入内容并且处理它们,例如将语⾳音输⼊入内容作为搜索内容或者短信发送出 去。 调⽤用startActivityForResult()启动处理语⾳音识别的activity,并且intent设置action为ACTION_RECOGNIZE_SPEECH。 并在activity中重写onActivityResult()⽅方法,来处理返回的语⾳音输⼊入结果。 private static final

    int SPEECH_REQUEST_CODE = 0; private void displaySpeechRecognizer() { Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); startActivityForResult(intent, SPEECH_REQUEST_CODE); } protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == SPEECH_REQUEST_CODE && resultCode == RESULT_OK) { List results = data.getStringArrayListExtra( RecognizerIntent.EXTRA_RESULTS); String spokenText = results.get(0); } super.onActivityResult(requestCode, resultCode, data); } Voice
  4. Start Device Debug Mode adb forward tcp:4444 localabstract:/adb-hub; adb connect

    localhost:4444 Host: connected Target: connected adb devices adb -s localhost:4444 
 adb -s localhost:4444 TCP/IP: adb -e Debug With BlueTooth