1

I have made an android application for android devices(API level 23 and plus) using android studio. Now I want to modify that app for Android of Things(AOT) so that I can run it on Raspberry PI3 which has AOT installed in it.

What are the places in which I have to make changes in my android studio project so as to successfully run the app in AOT?

Shubham Shekhar
  • 316
  • 3
  • 17
  • 1
    that depends on what your app does. Basically just try running it on Android things device, and see if it runs. If it does not - fix the problems. – Vladyslav Matviienko Jun 27 '17 at 07:14
  • 1
    See "Behavior Changes" in [the Android Things SDK Overview documentation](https://developer.android.com/things/sdk/index.html). See also [Create an Android Things Project](https://developer.android.com/things/training/first-device/create-studio-project.html). – CommonsWare Jun 27 '17 at 10:41

2 Answers2

0

According to guidlines:

Add the dependency artifact to your app-level build.gradle file:

dependencies {
    ...
    provided 'com.google.android.things:androidthings:0.4.1-devpreview'
}

Add the Things shared library entry to your app's manifest file and declare a home activity:

<application
    android:label="@string/app_name">
    <uses-library android:name="com.google.android.things"/>
    <activity android:name=".HomeActivity">
        <!-- Launch activity as default from Android Studio -->
        <intent-filter>
            <action android:name="android.intent.action.MAIN"/>
            <category android:name="android.intent.category.LAUNCHER"/>
        </intent-filter>

        <!-- Launch activity automatically on boot -->
        <intent-filter>
            <action android:name="android.intent.action.MAIN"/>
            <category android:name="android.intent.category.IOT_LAUNCHER"/>
            <category android:name="android.intent.category.DEFAULT"/>
        </intent-filter>
    </activity>
</application>
Alexander Tumanin
  • 1,638
  • 2
  • 23
  • 37
  • Thanks Alex. I made the above changes. However I am getting this message: 'A TextureView or a subclass can only be used with hardware acceleration enabled'. I have added : but still I am not getting the camera preview in my application. Hope you can help – Shubham Shekhar Sep 15 '17 at 06:03
0

In addition to Alexander, add in project build.gradle: in repositories :

maven { url 'https://maven.google.com'}

And think about pitfall with permissions: they are first granted after reboot of device, not after installing the app

Jan Debiec
  • 21
  • 5
  • I don't have enough reputations to upvote your anwer. Your answer was of great help. However I am getting this message: 'A TextureView or a subclass can only be used with hardware acceleration enabled'. I have added : but still I am not getting the camera preview in my application. Hope you can help – Shubham Shekhar Sep 15 '17 at 06:18