Ok, I upgraded to the latest Android Things and now also get the error.
Background:
1. SDK 25
2. All modules up to date.
3. Original app worked 100% on older Things and B4A 7.
4. B4A 8
The code supplied is just two tests:
1. Define pm
2. Init pm - where the app crash
3. I removed the line:
because I could not get write access to external
What I noted:
1. If I remember correctly I HAD to put this line
in the manifest editor or the app will not execute on the Pi.
Now it does not matter.
2. I was under the impression the marked line in the 'AndroidManifest.xml' will allow write access to the external storage. does not seems to do anything.
3. adding
as per Google to the manifest does nothing.
Sample of final manifest.
Any help will be appreciated.
Adie
Background:
1. SDK 25
2. All modules up to date.
3. Original app worked 100% on older Things and B4A 7.
4. B4A 8
The code supplied is just two tests:
1. Define pm
2. Init pm - where the app crash
3. I removed the line:
B4X:
File.WriteString(File.DirRootExternal, "Limits.txt", "100~200" )
What I noted:
1. If I remember correctly I HAD to put this line
B4X:
AddApplicationText(<uses-library android:name="com.google.android.things"/>)
Now it does not matter.
2. I was under the impression the marked line in the 'AndroidManifest.xml' will allow write access to the external storage. does not seems to do anything.
3. adding
B4X:
<uses-permission android:name="com.google.android.things.permission.USE_PERIPHERAL_IO" />
Sample of final manifest.
B4X:
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="b4a.example"
android:versionCode="1"
android:versionName=""
android:installLocation="internalOnly">
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="24"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.BLUETOOTH"/>
====>> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
<application
android:icon="@drawable/icon"
android:label="B4A Example">
<uses-library android:name="com.google.android.things"/>
<activity
android:windowSoftInputMode="stateHidden"
android:launchMode="singleTop"
android:name=".main"
android:label="B4A Example"
android:screenOrientation="unspecified">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service android:name=".starter">
</service>
<receiver android:name=".starter$starter_BR">
</receiver>
</application>
</manifest>
Any help will be appreciated.
Adie