Net-centric Computing

Downloads

BTconnect (Framework for bluetooth connections) –  Android Studio project

Docs

Pico starterkit

Veranderingen voor Android Studio:

Om het android studio project aan de praat te krijgen zijn er een aantal wijzigingen nodig in het android manifest en de gradle build files.
Android manifest (/app/src/main/AndroidManifest.xml)
Gemarkeerd (in rose) moet worden toegevoegd of gewijzigd.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="uva.nc.app"
    xmlns:tools="http://schemas.android.com/tools">

    <uses-permission android:name="android.permission.BLUETOOTH" />
    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />

    <uses-feature android:name="android.hardware.usb.accessory" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="Netcentric"
        android:theme="@style/AppTheme"
        tools:replace="android:label,android:theme">
        <activity
            android:name=".MainActivity"
            android:label="Netcentric" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
                <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>
        <activity
            android:name=".DevicesActivity"
            android:label="Netcentric:device">
        </activity>
    </application>

</manifest>
In beide gradle.build files (module “lib” en “app” )
apply plugin: 'android'

android {
    compileSdkVersion 19
    buildToolsVersion '19.1.0'

    defaultConfig {
        minSdkVersion 15
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            apply plugin: 'idea'
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:19.+'
    compile project(':lib')
}