I have sucessfully built, complied and tested the
So now moved on to this thread :-
using the that code and Manifest detail, I get the following error :-
Logger connected to: Android.local:5555
--------- beginning of main
--------- beginning of system
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
(ArrayList) [BCM10, BCM11, BCM12, BCM13, BCM14, BCM15, BCM16, BCM17, BCM18, BCM19, BCM2, BCM20, BCM21, BCM22, BCM23, BCM24, BCM25, BCM26, BCM27, BCM3, BCM4, BCM5, BCM6, BCM7, BCM8, BCM9]
main_activity_create (java line: 362)
java.lang.SecurityException: Caller lacks required permission com.google.android.things.permission.USE_PERIPHERAL_IO
at android.os.Parcel.readException(Parcel.java:2013)
at android.os.Parcel.readException(Parcel.java:1959)
at com.google.android.things.pio.IPeripheralManagerClient$Stub$Proxy.GetGpioClient(IPeripheralManagerClient.java:759)
at com.google.android.things.pio.GpioImpl.<init>(GpioImpl.java:50)
at com.google.android.things.pio.PeripheralManager.openGpio(PeripheralManager.java:197)
at anywheresoftware.b4a.objects.PeripheralManagerWrapper.OpenGpio(PeripheralManagerWrapper.java:45)
at ph1lj.things4.main._activity_create(main.java:362)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:213)
at ph1lj.things4.main.afterFirstLayout(main.java:105)
at ph1lj.things4.main.access$000(main.java:17)
at ph1lj.things4.main$WaitForLayout.run(main.java:83)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Here is the manifest :-
AddManifestText(
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="28"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
CreateResourceFromFile(Macro, Themes.LightTheme)
'End of default text.
'PER ANDROID THINGS
AddApplicationText(<uses-library android:name="com.google.android.things"/>)
''Launch activity automatically on boot (can remove if not needed)
AddActivityText(Main,
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.HOME"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
)
AddPermission(com.google.android.things.permission.USE_PERIPHERAL_IO)
AddPermission(com.google.android.things.permission.MANAGE_INPUT_DRIVERS)
As you can see I added the permission for the USE_PERIPHERAL_IO - so what is going on ?
Note I also ensured the instruction are uptodate using v1.10, I'm using B4A v10.0 - and the Android thing v1.0.14
can anyone help ?
B4A Library - Android Things
The Things library provides access to hardware features of Android Things platforms. The library supports GPIO and Serial communication. I2C with JavaObject: https://www.b4x.com/android/forum/threads/things-i2c.75504/#post-479173 Follow this tutorial to get started...www.b4x.com
So now moved on to this thread :-
Android Things Infinite Loop ( DIRECTION_IN )
Hi All as object thread i have: Raspberry 3 Android 8.1.0 ( API 27) + Android Things Build OIM1.18 OEM Version 16 All work in DIRECTION_OUT_INITIALLY_LOW, but if i add DIRECTION_IN i have an infinite loop True - False. In summary Statechanged changes continuously to False / True. I have an...
www.b4x.com
using the that code and Manifest detail, I get the following error :-
Logger connected to: Android.local:5555
--------- beginning of main
--------- beginning of system
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
(ArrayList) [BCM10, BCM11, BCM12, BCM13, BCM14, BCM15, BCM16, BCM17, BCM18, BCM19, BCM2, BCM20, BCM21, BCM22, BCM23, BCM24, BCM25, BCM26, BCM27, BCM3, BCM4, BCM5, BCM6, BCM7, BCM8, BCM9]
main_activity_create (java line: 362)
java.lang.SecurityException: Caller lacks required permission com.google.android.things.permission.USE_PERIPHERAL_IO
at android.os.Parcel.readException(Parcel.java:2013)
at android.os.Parcel.readException(Parcel.java:1959)
at com.google.android.things.pio.IPeripheralManagerClient$Stub$Proxy.GetGpioClient(IPeripheralManagerClient.java:759)
at com.google.android.things.pio.GpioImpl.<init>(GpioImpl.java:50)
at com.google.android.things.pio.PeripheralManager.openGpio(PeripheralManager.java:197)
at anywheresoftware.b4a.objects.PeripheralManagerWrapper.OpenGpio(PeripheralManagerWrapper.java:45)
at ph1lj.things4.main._activity_create(main.java:362)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:213)
at ph1lj.things4.main.afterFirstLayout(main.java:105)
at ph1lj.things4.main.access$000(main.java:17)
at ph1lj.things4.main$WaitForLayout.run(main.java:83)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Here is the manifest :-
AddManifestText(
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="28"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
CreateResourceFromFile(Macro, Themes.LightTheme)
'End of default text.
'PER ANDROID THINGS
AddApplicationText(<uses-library android:name="com.google.android.things"/>)
''Launch activity automatically on boot (can remove if not needed)
AddActivityText(Main,
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.HOME"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
)
AddPermission(com.google.android.things.permission.USE_PERIPHERAL_IO)
AddPermission(com.google.android.things.permission.MANAGE_INPUT_DRIVERS)
As you can see I added the permission for the USE_PERIPHERAL_IO - so what is going on ?
Note I also ensured the instruction are uptodate using v1.10, I'm using B4A v10.0 - and the Android thing v1.0.14
can anyone help ?
Last edited: