Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Andy lib解説

2,079 views

Published on

2012/1/28
夜子まま塾ADKの資料です

Published in: Technology, Business
  • Be the first to comment

Andy lib解説

  1. 1. Now Loading. Please Wait ... Re:Kayo-System Co.,Ltd.2012 1 27
  2. 2. Re:Kayo-System Co.,Ltd.2012 1 27
  3. 3. Re:Kayo-System Co.,Ltd.2012 1 27
  4. 4. Re:Kayo-System Co.,Ltd.2012 1 27
  5. 5. Re:Kayo-System Co.,Ltd.2012 1 27
  6. 6. Re:Kayo-System Co.,Ltd.2012 1 27
  7. 7. Re:Kayo-System Co.,Ltd.2012 1 27
  8. 8. Re:Kayo-System Co.,Ltd.2012 1 27
  9. 9. Re:Kayo-System Co.,Ltd.2012 1 27
  10. 10. Re:Kayo-System Co.,Ltd.2012 1 27
  11. 11. Re:Kayo-System Co.,Ltd.2012 1 27
  12. 12. Re:Kayo-System Co.,Ltd.2012 1 27
  13. 13. Re:Kayo-System Co.,Ltd.2012 1 27
  14. 14. Re:Kayo-System Co.,Ltd.2012 1 27
  15. 15. Re:Kayo-System Co.,Ltd.2012 1 27
  16. 16. Re:Kayo-System Co.,Ltd.2012 1 27
  17. 17. <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/ res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > </LinearLayout> Re:Kayo-System Co.,Ltd.2012 1 27
  18. 18. Re:Kayo-System Co.,Ltd.2012 1 27
  19. 19. Re:Kayo-System Co.,Ltd.2012 1 27
  20. 20. <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center" android:orientation="vertical" > <Button android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Button" /> </LinearLayout> Re:Kayo-System Co.,Ltd.2012 1 27
  21. 21. public static final class layout { public static final int control=0x7f030000; public static final int device_list=0x7f030001; public static final int device_name=0x7f030002; public static final int hoge=0x7f030003; public static final int main=0x7f030004; } Re:Kayo-System Co.,Ltd.2012 1 27
  22. 22. public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Button btn = (Button)findViewById(R.id.button1); } Re:Kayo-System Co.,Ltd.2012 1 27
  23. 23. Re:Kayo-System Co.,Ltd.2012 1 27
  24. 24. Re:Kayo-System Co.,Ltd.2012 1 27
  25. 25. Re:Kayo-System Co.,Ltd.2012 1 27
  26. 26. Re:Kayo-System Co.,Ltd.2012 1 27
  27. 27. Button btn = (Button)findViewById(R.id.button1); btn.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // } }); Re:Kayo-System Co.,Ltd.2012 1 27
  28. 28. Re:Kayo-System Co.,Ltd.2012 1 27
  29. 29. Re:Kayo-System Co.,Ltd.2012 1 27
  30. 30. Re:Kayo-System Co.,Ltd.2012 1 27
  31. 31. Re:Kayo-System Co.,Ltd.2012 1 27
  32. 32. Re:Kayo-System Co.,Ltd.2012 1 27
  33. 33. Re:Kayo-System Co.,Ltd.2012 1 27
  34. 34. Re:Kayo-System Co.,Ltd.2012 1 27
  35. 35. Re:Kayo-System Co.,Ltd.2012 1 27
  36. 36. Re:Kayo-System Co.,Ltd.2012 1 27
  37. 37. Re:Kayo-System Co.,Ltd.2012 1 27
  38. 38. Re:Kayo-System Co.,Ltd.2012 1 27
  39. 39. Re:Kayo-System Co.,Ltd.2012 1 27
  40. 40. Re:Kayo-System Co.,Ltd.2012 1 27
  41. 41. Re:Kayo-System Co.,Ltd.2012 1 27
  42. 42. Re:Kayo-System Co.,Ltd.2012 1 27
  43. 43. Re:Kayo-System Co.,Ltd.2012 1 27
  44. 44. Re:Kayo-System Co.,Ltd.2012 1 27
  45. 45. Re:Kayo-System Co.,Ltd.2012 1 27
  46. 46. Re:Kayo-System Co.,Ltd.2012 1 27
  47. 47. Re:Kayo-System Co.,Ltd.2012 1 27
  48. 48. Re:Kayo-System Co.,Ltd.2012 1 27
  49. 49. Re:Kayo-System Co.,Ltd.2012 1 27
  50. 50. Re:Kayo-System Co.,Ltd.2012 1 27
  51. 51. Re:Kayo-System Co.,Ltd.2012 1 27
  52. 52. Re:Kayo-System Co.,Ltd.2012 1 27
  53. 53. Re:Kayo-System Co.,Ltd.2012 1 27
  54. 54. Re:Kayo-System Co.,Ltd.2012 1 27
  55. 55. Re:Kayo-System Co.,Ltd.2012 1 27
  56. 56. Re:Kayo-System Co.,Ltd.2012 1 27
  57. 57. Re:Kayo-System Co.,Ltd.2012 1 27
  58. 58. Re:Kayo-System Co.,Ltd.2012 1 27
  59. 59. Re:Kayo-System Co.,Ltd.2012 1 27
  60. 60. Re:Kayo-System Co.,Ltd.2012 1 27
  61. 61. <fragment android:id="@+id/fragment1" android:tag="ADK" android:layout_width="0dip" android:layout_height="0dip" android:name="jp.co.kayo.ykmjuku.andylib.component.ADKCompone nt" /> Re:Kayo-System Co.,Ltd.2012 1 27
  62. 62. DeviceComponent mDevice; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); ToggleButton toggleButton1 = (ToggleButton)findViewById(R.id.toggleButton1); toggleButton1.setOnCheckedChangeListener(this); try { mDevice = ComponentHelper.getDevice(getSupportFragmentManager(), "ADK"); } catch (Exception e) { Toast.makeText(this, e.getMessage(), Toast.LENGTH_SHORT).show(); } } Re:Kayo-System Co.,Ltd.2012 1 27
  63. 63. public void onCheckedChanged(CompoundButton buttonView, final boolean isChecked) { if(mDevice!=null){ AndyCommand cmd = new AndyCommand( (byte) 0x03, (byte) 0x1B, new byte[] { isChecked?(byte)1:(byte)0 }); try { mDevice.sendCommand(cmd); } catch (IOException e) { Toast.makeText(this, e.getMessage(), Toast.LENGTH_SHORT).show(); } } } Re:Kayo-System Co.,Ltd.2012 1 27
  64. 64. <?xml version="1.0" encoding="utf-8"?> <resources> <usb-accessory manufacturer="Google, Inc." model="DemoKit" version="1.0" /> </resources> Re:Kayo-System Co.,Ltd.2012 1 27
  65. 65. <application android:icon="@drawable/ic_launcher" android:label="@string/app_name" > <activity android:name=".MainActivity" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> <intent-filter> <action android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED" /> </intent-filter> <meta-data android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED" android:resource="@xml/accessory_filter" /> </activity> <uses-library android:name="com.android.future.usb.accessory"/> </application> Re:Kayo-System Co.,Ltd.2012 1 27
  66. 66. Re:Kayo-System Co.,Ltd.2012 1 27
  67. 67. Re:Kayo-System Co.,Ltd.2012 1 27

×