VIM3L Android API function calls

Hi

I am looking at this API document for VIM/VIM3L here.

With my VIM3L running Android, I am trying out some of these API calls.

Setup:
I downloaded this project:
And copied the library and necessary code to my own project.
My project builds and runs.

Results:
I am getting some mixed results.

These API function calls work:

getKhadasApi().setLedMode()
getKhadasApi().setFanMode()
getKhadasApi().getFanMode()

I do not see any behaviour change when any of these API functions are called:

getKhadasApi().reboot()
getKhadasApi().shutdown()
getKhadasApi().sleep()

Calling either of these API functions returns “socket: Permission denied”:

getKhadasApi().getCurrentResolution()
getKhadasApi().getValidResolution()

Calling this API function always results in -1 (fail), whether I set GPIO A6 to input or output:

getKhadasApi().gpioRead(“GPIOAO_6”)

Questions:

Q1: These API function calls are defined for the VIM. Should they also work for the VIM3L?

Q2: Why would the calls to reboot(), shutdown() and sleep() have no effect?

Q3: I have come across two GPIO header descriptions on your website - this one and this one.
Which GPIO pin does GPIOA0_6 refer to / How do I know which i/o configuration I have?

Hi - can anyone give me some info please?
Thanks

Hi @gar1234, Developers are on vacation for this week, you will get a follow up by next week.

Regards.

They work with VIM3L

Can you use the reboot, shutdown and sleep functions with the vim3_demo.apk we generated? The apk is in the root directory of the code after you git clone
Post the ineffective logcat

image


LCD backlight controlled by GPIOAO_6
The above two links are introductions describing 40pin. This needs to be combined with the sch of vim3l to see the corresponding pins.

For Q2:

I cannot build the original project.

I get this error:

Unable to make field private final java.lang.String java.io.File.path accessible: module java.base does not “opens java.io” to unnamed module @b934bf5

This is my setup:

Android Gradle Plugin Version = 3.6.1
Gradle Version = 7.2
JDK = kbr-17 (JetBrains Runtime version 17.0.6)

Hello, after the project is downloaded, the generated apk can be used directly. You don’t need to compile a new apk.

The error you reported may be due to incorrect studio configuration. Let me take a look here.

If I load the demo apk, the API functions work. I have tried to integrate the API library in to my project but I can’t get it to work successfully yet.
Here are the steps I took so far:
I copied file ‘khadas_api.jar’ to the project’s lib folder
I included the library file in the project
In my main .java file, I defined KhadasApi:

private static KhadasApi mKhadasApi;
public static KhadasApi getKhadasApi() {
    return mKhadasApi;
}

In the OnCreate(), in the same file:

    mKhadasApi = new KhadasApi(this);

And later in that same file, on a butotn click:

getKhadasApi().reboot();

The only other related I file that I could find, was ‘khadas_api.jks’, which is in the app directory. I copied that file to my app directory.

When I run the project now, I get the following error:

FATAL EXCEPTION: main
Process: com.example.MyApp, PID: 26831
java.lang.NoClassDefFoundError: Failed resolution of: Landroid/app/KhadasApiManager;
at com.wesion.KhadasApi.(KhadasApi.java:25)
at com.example.MyApp.ApplicationClass.onCreate(ApplicationClass.java:25)

Have you copied arm64-v8a/libkhadas_serial_port_jni.so and armeabi-v7a/libkhadas_serial_port_jni.so under khadas_api_demo/app/src/main/jniLibs to your project?