Awesome, awesome work Niklas! Highly appreciated!

Julian

Von meinem Mobiltelefon gesendet


-------- Ursprüngliche Nachricht --------
Von: Niklas Merz <[email protected]>
Datum: Sa., 11. Jan. 2020, 12:36
An: [email protected]
Betreff: Re: PLC4X on Android?
Hi again,

Good news! I got the PlcDriverManager working with Dalvik classloading
in my Cordova plugin.

Turns out my previews finding took me to a wrong route:

> ClassLoader cl = ClassLoader.getSystemClassLoader();
> Thread.currentThread().setContextClassLoader(cl);

I was not really familiar with the Cordova thread concept. My code runs
in a different thread than the webview. The classloader I got this was
somehow was not able to properly load the PLC4X classes. Don't ask me
why :-).

I just see Dalvik has a different path:

dalvik.system.PathClassLoader[DexPathList[[directory "."],
dalvik.system.PathClassLoader[DexPathList[[zip file
"/data/app/io.cordova.hellocordova

If I run the PlcDriverManager in the Cordova UI thread via
"runOnUiThread", it works just fine.

The PLC4X Cordova plugin now works in general.

Thank you all for your help.

Kind regards
Niklas

Reply via email to