Discussion:
PathClassLoader Issue
MoggoDude
2008-10-16 10:47:26 UTC
Permalink
Hi,
I was woundering if someone could help me on a technical issue
concerning the PathClassLoader in Android SDK 1.0.
The problem I'm and other people, see blog,
http://groups.google.com/group/android-developers/browse_thread/thread/ae71de8061c7eabf/c601569b1636f9dc?lnk=gst&q=PathclassLoader#c601569b1636f9dc,
have experienced arrises when attempting to dynamically load classes.
Using the example in the
blog:

PathClassLoader loader = new PathClassLoader(
"/data/data/org.beo/beo.mylib/myLib.apk",
ClassLoader.getSystemClassLoader());
Class calledClass = null;
calledClass = loader.loadClass("beo.mylib.beoware");

produces the following error:
ERROR/dalvikvm(312): Can't open dex cache
'/data/dalvik-cache/***@data.....@classes.dex': No such file or
directory
09-26 00:03:34.928: INFO/dalvikvm(312): Unable to open or create cache
for
/data/data/....................apk'

This is rectified by shelling into the emulator using the adb utility
and changing the permissions on
the directory /data/dalvik-cache using chmod 777 .

The main concern I have is, what will be the permissions /data/dalvik-
cache on on a target device, such as the new HTC G1 phone ?
Users of any application using the PathClassLoader will propably not
be able to issues chmod 777 commands (can't expect them
to either). Consequently, this would render applications relying on
PathClassLoader inoperable. If anyone can help me with this issue,
it would be very greatly appreciated.

Regards,
MoggoDude
hackbod
2008-10-16 20:48:52 UTC
Permalink
Sorry, this is not supported for 1.0.
Hi,
     I was woundering if someone could help me on a technical issue
concerning the PathClassLoader in Android SDK 1.0.
The problem I'm and other people, see blog,http://groups.google.com/group/android-developers/browse_thread/threa...,
have experienced arrises when attempting to dynamically load classes.
Using the example in the
PathClassLoader loader = new PathClassLoader(
"/data/data/org.beo/beo.mylib/myLib.apk",
ClassLoader.getSystemClassLoader());
Class calledClass = null;
calledClass = loader.loadClass("beo.mylib.beoware");
ERROR/dalvikvm(312): Can't open dex cache
directory
09-26 00:03:34.928: INFO/dalvikvm(312): Unable to open or create cache
for
/data/data/....................apk'
This is rectified by shelling into the emulator using the adb utility
and changing the permissions on
the directory /data/dalvik-cache using chmod 777 .
The main concern I have is, what will be the permissions /data/dalvik-
cache on on a target device, such as the new HTC G1 phone ?
Users of any application using the PathClassLoader will propably not
be able to issues chmod 777 commands (can't expect them
to either). Consequently, this would render applications relying on
PathClassLoader  inoperable. If anyone can help me with this issue,
it would be very greatly appreciated.
Regards,
             MoggoDude
MoggoDude
2008-10-17 11:40:25 UTC
Permalink
Hi hackbod,
Thanks for your response. I just have a couple of questions
regarding your response, if you
could please answer, it would be greatly appreciated.

1) Why is this feature (Dynamic Class Loading) not supported in sdk
1.0. This is a crucial feature
required by some application.
2) Will it be supported on a target device such as the HTC G1 when it
is
lauched to the market soon.


Regards,
MoggoDude
hackbod
2008-10-19 18:10:29 UTC
Permalink
Post by MoggoDude
1) Why is this feature (Dynamic Class Loading) not supported in sdk
Because we didn't have time to implement it.
Post by MoggoDude
1.0. This is a crucial feature
   required by some application.
Sorry.
Post by MoggoDude
2) Will it be supported on a target device such as the HTC G1 when it
is
   lauched to the market soon.
No, it is not supported in 1.0.

Loading...