regarding loading class and external resources...

Tutorials with advanced 'difficulty' and more Lines of Code.

regarding loading class and external resources...

Postby sit06603 » Wed Sep 24, 2008 10:58 am

hi,

My application require some others library... which I download
dynamically from internet and load into system...
In SDK 0.9 my coding is work fine... but when I port it to SDK 1.0...
I having some problem below...

can anyone guide me to port it???

1) PathClassLoader loader = new PathClassLoader(
"/data/data/org.beo/beo.mylib/myLib.apk",
ClassLoader.getSystemClassLoader());

Class calledClass = null;

calledClass = loader.loadClass("beo.mylib.beoware");

I fail to load into system...


2) AssetManager constructor not longer visible... how can I load???

AssetManager assetManager = new AssetManager();
assetManager.addAssetPath("/data/data/org.beo/beo.mylib/myLib.apk");


can anyone guide me to port this two branch of problem??? so that I
can continue my develop???

please...



wesley.
sit06603
Junior Developer
Junior Developer
 
Posts: 22
Joined: Thu May 15, 2008 11:22 am

Top

Postby ninor » Wed Sep 24, 2008 7:59 pm

AssetManager is still in the Android libraries. It hasn't changed a bit, so I don't know why aren't you finding it.
Maybe your problems are with Eclipse and upgrading?
Have you cleaned your emulator with -wipe-data? And properly updated the libs in Windows-Preferences, and the plugin in Help-Soft Updates?
http://code.google.com/android/intro/upgrading.html

And, although I haven't used any, why do you use ClassLoader directly? Why dont' you use any of the subclasses?, like:

PathClassLoader, SecureClassLoader, or URLClassLoader
http://code.google.com/android/reference/java/lang/ClassLoader.html
User avatar
ninor
Moderator
Moderator
 
Posts: 180
Joined: Thu Aug 14, 2008 6:30 pm
Location: Barcelona, Spain

Postby sit06603 » Thu Sep 25, 2008 3:25 am

hi,

thanks for the replay...

1) AssetManager is not longer visible means... the constructor already changed from public to private or protected...
I wondering is there any others solution to solve my problem???

2) PathClassLoader, SecureClassLoader, or URLClassLoader interesting... can u provide some simple example how can I used it???

can anyone guide me to port this two branch of problem??? so that I
can continue my develop???
Thanks...


wesley
sit06603
Junior Developer
Junior Developer
 
Posts: 22
Joined: Thu May 15, 2008 11:22 am

Postby ninor » Thu Sep 25, 2008 7:44 am

sit06603 wrote:1) AssetManager is not longer visible means... the constructor already changed from public to private or protected...
I wondering is there any others solution to solve my problem???

Maybe they added some properties to that class to use instead of the constructor. Have you checked the existence of any new property?
Or maybe the new class is obtained in a different way; i.e. as a result.

sit06603 wrote:2) PathClassLoader, SecureClassLoader, or URLClassLoader interesting... can u provide some simple example how can I used it???

I suppose that if those classes are derived from ClassLoader, maybe the usage is almost identical.
And, I haven't tried them, I only searched the android docs, so I cannot provide any example, sorry.
User avatar
ninor
Moderator
Moderator
 
Posts: 180
Joined: Thu Aug 14, 2008 6:30 pm
Location: Barcelona, Spain

Top

Return to Advanced Tutorials

Who is online

Users browsing this forum: No registered users and 5 guests