Closed GoogleCodeExporter closed 9 years ago
1. What's specified exactly in getResourceAsStream() argument when you try to
load
TimeZone.dat?
2. After the build task is done, can you find the TimeZone.dat file in
microemu-android/bin/assets folder?
Original comment by bar...@gmail.com
on 15 Jan 2010 at 10:05
[deleted comment]
Btw, it works with the applet version of microemu:
http://www.latinsud.com/pub/jCompass/
It is only Android version that fails.
1. From source code of the application:
org/qcontinuum/compass/TimeZone.java:
InputStream inputStream = obj.getClass().getResourceAsStream("TimeZone.dat");
Please note that it is a relative path. Imho almost nobody uses relative paths,
then
the problem not being noticed before.
2. File was originally located in JAR:
org/qcontinuum/compass/TimeZone.dat
File path in APK:
assets/org/qcontinuum/compass/TimeZone.dat
My conclusion is:
If "org/qcontinuum/compass/TimeZone.class" wants "TimeZone.dat", then
we should look for "org/qcontinuum/compass/TimeZone.dat"
I tried reading the JAVA API doc to find out what's the correct behaviour, but i
coulndn't understand it fully.
Btw, i did a dirty patch to prove my idea. In
MicroEmulatorActivity.java:getResourceAsStream(String name) i replaced:
return MicroEmulatorActivity.this.getAssets().open(name);
with
return MicroEmulatorActivity.this.getAssets().open("org/qcontinuum/compass/"+name);
This patch trick worked, but i know it is not a general solution. It would
require
retrieveing the path of the calling class, but i currently don't know how to do
it,
sorry (maybe something in MIDletBridge.java?).
Original comment by LatinSuD@gmail.com
on 15 Jan 2010 at 2:08
Original comment by bar...@gmail.com
on 16 Jan 2010 at 8:39
Original comment by bar...@gmail.com
on 18 Jan 2010 at 8:39
Fix commited to trunk
Original comment by bar...@gmail.com
on 26 Mar 2010 at 11:36
Original issue reported on code.google.com by
LatinSuD@gmail.com
on 14 Jan 2010 at 10:31