Hi Archu,I am working on a similar issue. Did you have any luck with python scripts in eclipse for android app?Regards,Prat
On Wednesday, September 12, 2012 6:01:55 AM UTC-5, Archu wrote:Hi, I m new to Android. I used the link http://jokar-johnk.blogspot.fi/2011/02/how-to-make-android-app-with-sl4a.html to execute Python script in Android. However, I need to run my own script(after parsing from a JSON file). In my case, I cannot place the script in /res/raw folder. Please let me know the modifications in ScriptService.java. Any help will be appreciated. Thanks in advance !
09-26 09:41:11.881: D/dalvikvm(6427): mprotect(RO) failed (13), file will remain read-write
09-26 09:41:11.891: D/dalvikvm(6427): mprotect(RO) failed (13), file will remain read-write
09-26 09:41:11.891: D/dalvikvm(6427): mprotect(RO) failed (13), file will remain read-write
09-26 09:41:11.891: D/dalvikvm(6427): mprotect(RO) failed (13), file will remain read-write
09-26 09:41:11.901: D/dalvikvm(6427): mprotect(RO) failed (13), file will remain read-write
09-26 09:41:11.901: D/dalvikvm(6427): mprotect(RO) failed (13), file will remain read-write
09-26 09:41:11.911: D/dalvikvm(6427): mprotect(RO) failed (13), file will remain read-write
09-26 09:41:12.071: D/dalvikvm(6427): mprotect(RO) failed (13), file will remain read-write
09-26 09:41:12.461: D/dalvikvm(6427): No JNI_OnLoad found in /system/lib/libandroid_runtime.so 0x0, skipping init
09-26 09:41:14.111: V/sl4a.SimpleServer$ConnectionThread:89(6411): Server thread 15 started.
09-26 09:41:14.571: D/dalvikvm(6411): GC_CONCURRENT freed 509K, 55% free 2862K/6279K, external 410K/517K, paused 5ms+5ms
09-26 09:41:15.011: D/dalvikvm(6411): GC_CONCURRENT freed 478K, 54% free 2893K/6279K, external 410K/517K, paused 5ms+6ms
09-26 09:41:15.161: D/dalvikvm(6411): GC_FOR_MALLOC freed 189K, 54% free 2892K/6279K, external 410K/517K, paused 38ms
09-26 09:41:15.161: I/dalvikvm-heap(6411): Grow heap (frag case) to 5.777MB for 8208-byte allocation
09-26 09:41:15.251: D/dalvikvm(6411): GC_FOR_MALLOC freed 4K, 55% free 2895K/6343K, external 410K/517K, paused 75ms
09-26 09:41:15.251: V/sl4a.JsonRpcServer:74(6411): Received: {"id":1,"method":"_authenticate","params":["c7b9507b-6249-4ea9-9776-87fd801c9932"]}
09-26 09:41:15.281: V/sl4a.JsonRpcServer:117(6411): Sent: {"error":null,"id":1,"result":true}
09-26 09:41:15.301: V/sl4a.JsonRpcServer:74(6411): Received: {"id":2,"method":"makeToast","params":["hello javascript15"]}
09-26 09:41:15.351: V/sl4a.JsonRpcServer:117(6411): Sent: {"error":null,"id":2,"result":null}
09-26 09:41:15.401: V/sl4a.JsonRpcServer:74(6411): Received: {"id":3,"method":"notify","params":["javaScript","Success"]}
09-26 09:41:15.451: V/sl4a.JsonRpcServer:117(6411): Sent: {"error":null,"id":3,"result":null}
09-26 09:41:15.561: D/dalvikvm(6427): GC_EXPLICIT freed 707K, 55% free 648K/1411K, external 0K/0K, paused 106ms
09-26 09:41:15.611: D/dalvikvm(6427): GC_CONCURRENT freed 15K, 56% free 633K/1411K, external 0K/0K, paused 1ms+2ms
09-26 09:41:15.811: V/sl4a.SimpleServer$ConnectionThread:100(6411): Server thread 15 died.
09-26 09:41:15.822: V/sl4a.Process$1:135(6411): Process 6427 exited with result code 0.
Thank you!!
import android
droid = android.Android()
score1 = 10
score2 = 20
average = (score1 + score2)/2
droid.makeToast('Result is: ' +str(average))Can I get the value of average and store it in a file(in internal memory)? Please let me know if it is possible to do it?
Robbie Matthews gives a full, no-holds barred introduction to Android programming for tablets. No previous experience required! Learn More …