ScriptBasic

Support => General Discussions => Topic started by: Support on May 16, 2012, 11:14:05 AM

Title: Build your own SL4A Facade
Post by: Support on May 16, 2012, 11:14:05 AM
Quote from: Sergey Zelenev
I need to use a closed-source proprietary Java library with my SL4A standalone project (in form of APK).
I will need to expand the SL4A RPC API for that.

What would be a good example in the source on how to do that? I'm not too strong with Java, so something very basic would be helpful.

If you have a Java background, (Pete Verhas: do you have your ears on?) one could create their own Facade scripting extension to SL4A.

Quote from: anthony prieur
You need to create your own facade class and then add it to
FacadeConfiguration.java, like:

sFacadeClassList.add(MyCustomFacade.class);

FacadeConfiguration.class needs to be put out of script.jar and add it
to your project, see e.g.:
HERE (https://code.google.com/p/android-python27/source/browse/apk/src/com/googlecode/android_scripting/facade/FacadeConfiguration.java)

Simple facade you can use as base for yours:
HERE (https://code.google.com/r/naranjomanuel-sl4a/source/browse/android/TextToSpeechFacade/src/com/googlecode/android_scripting/facade/TextToSpeechFacade.java?r=8170a5460c2cc791b4765ea947401f15554ff328)