phillipsyoav / android-python27

Automatically exported from code.google.com/p/android-python27
0 stars 0 forks source link

Support for Samsung Chord API #29

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Can you add support for the Chord API?  I can help with it if you want.

http://developer.samsung.com/chord

Original issue reported on code.google.com by john.j.j...@gmail.com on 3 Jun 2013 at 3:35

GoogleCodeExporter commented 8 years ago
Just adding custom Chord facade would fit right ? 
http://code.google.com/p/android-python27/wiki/TutorialHowToCreateCustomRpcFacad
e

Original comment by anthony....@gmail.com on 3 Jun 2013 at 3:54

GoogleCodeExporter commented 8 years ago
Thanks for your reply!  I think I can easily create the RPC Facade as described 
in the wiki.

I then want to invoke on the facade using the Lua scripting language.  That 
should work, right?

Original comment by john.j.j...@gmail.com on 3 Jun 2013 at 5:41

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Yes should work. You need to embed the Lua interpreter instead of the Python 
one. 

Lua is there: http://android-scripting.googlecode.com/files/lua_r2.zip

You would need to replace python27.zip by lua_r2.zip, extract it, set 
interpreter path and env var for lua.

In GlobalConfig.java:

change to: public static final String PYTHON_ZIP_NAME = "lua_r2.zip";

remove: public static final String PYTHON_EXTRAS_ZIP_NAME = 
"python_extras_27.zip";

In ScriptActivity.java change the interpreter path (chmod):

this.getFilesDir().getAbsolutePath() + "/lua/bin/lua"

And remove to part which extract python extras.

And in ScriptService.java (and BackgroundScriptService.java ) change 
interpreter path + env var:

File pythonBinary = new File(this.getFilesDir().getAbsolutePath() + 
"/lua/bin/lua");

And for var smth like:

environmentVariables.put("LUA_CPATH", this.getFilesDir().getAbsolutePath() + 
"/lua/lib/lua/5.1/?.so" + ":" + this.getFilesDir().getAbsolutePath() + 
"/lua/lib/lua/5.1/loadall.so" + ":" + this.getFilesDir().getAbsolutePath() 
+"/lua/lib/lua/5.1/?/init.sl" + ":" + this.getFilesDir().getAbsolutePath() + 
"/lua/lib/lua/5.1/?/?.so");

environmentVariables.put("LUA_PATH", this.getFilesDir().getAbsolutePath() + 
"/lua/share/lua/5.1/?/?.lua" + ":" + this.getFilesDir().getAbsolutePath() + 
"/lua/share/lua/5.1/?.lua" + ":" + this.getFilesDir().getAbsolutePath() + 
"/lua/share/lua/5.1/?/init.lua" + ":" + this.getFilesDir().getAbsolutePath() + 
"/lua/lib/lua/5.1/?.lua" + ":" + this.getFilesDir().getAbsolutePath() + 
"/lua/lib/lua/5.1/?/init.lua");

That should be all.

Original comment by anthony....@gmail.com on 3 Jun 2013 at 7:00