|
Directory tree of a typical Android project (at least those created by the "android
create project" command) looks like this:

As you may have seen the directory structure of countless J2SE projects, there is
a directory to store the 3rd party class libraries of the project. Under the "lib"
directory, you can place your Java class libraries in JAR format and they will be
added to the classpath when the Android application is running.
Or will they?
If you remember the APK format, there is no such thing as directory for libs
in JAR format, particularly because the Dalvik VM is simply not able to execute
ordinary Java class files in those JARs. You can find JARs on the device but these
JARs contain class files in DEX format (Dalvik VM's class file format) inside so
the extension of these files is misleading. Then where are those JARs from the lib
directory that we "added to the classpath"?
You might have guessed it: these JARs are unpacked, processed by the dx tool just
like the classes under the src directory and are placed into the same classes.dex
file where the application resides. One application is one DEX file and JARs containing
Java class files are not "added to the classpath", they are converted into DEX format
and added to the DEX file of the application. Unlike in OSGi, an Android installable
package cannot share code with other system components, only services.
Source:
mylifewithandroid
|
How to display a JPG...
Is that posible to zoom in and drag p...
Making a custom Andr...
Cool - I will use it carefully i promise
How to display a JPG...
problem in image loading - i have exe...
Introducing Calculon...
Thank You for your contribution - Hi,...
Debug a Native Appli...
Never mind, I somehow overlooked the ...