Open GoogleCodeExporter opened 9 years ago
oh it looks like you do not have the write permision on the /data fold, so try
to change the path define in org/python/util/debug/FixMe.java
or you can give me a path where you can read and write, i will change the path
for you
regards
Original comment by juanzhew...@gmail.com
on 16 Nov 2008 at 6:32
Actually I don't even have *read* permission. Looks like /sdcard, /system
(maybe
/system/framework? there are a bunch of .jar and .odex files there... or
/system/app.) Those are about it, based on an ls -R / from the adb shell. (I
haven't
tested the package build yet, I'll try and get to that later)
Original comment by eic...@gmail.com
on 16 Nov 2008 at 11:23
Hello,
what files are /data/app on your phone?
> dalvikvm -classpath /data/app/Jythonroid.apk org.python.util.jython
I'm wondering about the Jythonroid.apk. Is this file exists?
Google suggest the functions openFileInput and openFileOutput to read/write
files. I don't know, where this
files were created, so I found it out with this code (in an activity):
<code>
try {
FileOutputStream out = this.openFileOutput("test.txt", Application.MODE_WORLD_WRITEABLE);
Log.e("gucken", this.getApplicationContext().getFilesDir().getAbsolutePath());
out.write(1);
out.flush();
out.close();
File f = new File("/data/data/de.local.andy/files/test2.txt");
f.createNewFile();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
</code>
The files are generated at /data/data/NameOfYourApkWithoutExtension/files/
I got the Interpreter running, my APK is named org.python.util.apk here are my
FixMe-Settings:
<code>
public static final String apkpath = "/data/app/";
public static final String apkname = "org.python.util.apk";
public static final String apppath = apkpath + apkname;
public static final String tmpdirpath = "/data/jythonroid/";
</code>
The directory /data/jythonroid/ was created from me by hand (mkdir
/data/jythonroid)
Then, I replaced this line:
File fff = new File("/data/jvm.class");
with
File fff = new File("/data/data/org.python.util/files/jvm.class");
(Adjust the path for your settings)
That is working for me. (Okay, one warning about a buffer size, but it's
running).
Hope this helps.
Greetings from Germany, Neq
Original comment by nequiq...@googlemail.com
on 18 Nov 2008 at 9:30
Hm, no edits for comments?
> Then, I replaced this line:
> File fff = new File("/data/jvm.class");
> with
> File fff = new File("/data/data/org.python.util/files/jvm.class");
> (Adjust the path for your settings)
forget to say, this line is located in the function getDexClass in in FixMe.java
Greetings from Germany, Neq
Original comment by nequiq...@googlemail.com
on 18 Nov 2008 at 9:35
thanks for you tips, because i do not even get a real phone now, i can only
promise
it runs on the emulator.
and i am not so familar with the way android handle files, thanks for you tips,
and
i am wondering whether there is a way to get the apk absolute path in
android?if we
can get that path, the configuration will be automatically.
and the jvm.class seems useless in the program, i will delete it in next update.
by the way i am forcusing on fix the "from package import *" probleam, it seams
like such problem was caused by the java.lang.Package.getPackeges() bug of the
android.
regards
Original comment by juanzhew...@gmail.com
on 18 Nov 2008 at 10:36
Hi,
one note, I also have no real phone, it will introduced in germany in first
quarter of 2009.
The full path to the apk file can get with this (inside of an activity):
this.getApplication().getPackageCodePath()
returns /data/app/de.local.andy.apk on my app.
hope this helps.
Greetings, Neq
Original comment by nequiq...@googlemail.com
on 18 Nov 2008 at 10:50
Original issue reported on code.google.com by
eic...@gmail.com
on 16 Nov 2008 at 6:03