Search code examples
androidandroid-studioraspberry-pi3android-things

Is it necessary to first connect raspberry pi 3 with adb then develop the android things project


I am new to android things. Recently I tried to build an android things app on android studio 2.3.3 with 25 SDK.

But when I include the android things support library into the dependency of app module build.gradle file and sync with latest gradle changes,it gives me the below error :

"Install repository then Sync"

Plz Someone help me.


Solution

  • You don't need to connect Raspberry Pi to develop a Android Things project. There are three points which you have to keep in mind while developing for Android Things:

    • Update your SDK tools to version 25.0.3 or higher.
    • Update your SDK with Android 8.0 (API 26) or higher.
    • In order to access new APIs for Things, you must create a project or modify an existing project that targets Android 8.0 (API level 26) or higher. Add the library.

    In your case, you need to install the latest bulid tools, and repositories to develop an Android Things Project. Your build.gradle should look like this:

    apply plugin: 'com.android.application'
    android {
    compileSdkVersion 25
    buildToolsVersion "25.0.3"
    
    defaultConfig {
        applicationId "com.android.androidthings.id"
        minSdkVersion 21
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    }
    dependencies {
            compile fileTree(dir: 'libs', include: ['*.jar'])
            testCompile 'junit:junit:4.12'
            compile 'com.android.support:appcompat-v7:25.3.1'
            provided 'com.google.android.things:androidthings:0.3-devpreview'
    }