Skip to content

Instantly share code, notes, and snippets.

@akexorcist
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akexorcist/e791a20ea92e1cfe497e to your computer and use it in GitHub Desktop.
Save akexorcist/e791a20ea92e1cfe497e to your computer and use it in GitHub Desktop.
ตัวอย่างคำสั่งเริ่มต้นสำหรับแอปพลิเคชั่นแอนดรอยด์เพื่อเชื่อมต่อกับบอร์ด IOIO หรือ IOIO-Q
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.inex.ioioapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.inex.ioioapp.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin" >
</RelativeLayout>
package com.inex.ioioapp;
import ioio.lib.api.exception.ConnectionLostException;
import ioio.lib.util.BaseIOIOLooper;
import ioio.lib.util.IOIOLooper;
import ioio.lib.util.android.IOIOActivity;
import android.os.Bundle;
public class MainActivity extends IOIOActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.layout_main);
}
class Looper extends BaseIOIOLooper {
protected void setup() throws ConnectionLostException
, InterruptedException {
}
public void loop() throws ConnectionLostException
, InterruptedException {
}
public void disconnected() {
}
public void compatible() {
}
}
protected IOIOLooper createIOIOLooper() {
return new Looper();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment