Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Jar libraries

Tags:

android

jar

How do you setup a project that can result in a jar library file that can be used for android? I want to create a custom library across all projects.

Few other questions:

  1. Does it need to be compiled against a specific version of android sdk?
  2. When an android package is compiled against a jar library does the classes necessary to work with the code get compiled with main code into the apk or does the entire jar get included?
  3. Any notable optimizations or pitfalls I need to know about with using a jar instead of integrating the code directly?
  4. Does the jar have to be signed like the apk needs to?
like image 537
Jeremy Edwards Avatar asked Dec 31 '09 02:12

Jeremy Edwards


People also ask

Can I use Java libraries in Android?

To use a Java library (JAR file) inside your Android project, you can simple copy the JAR file into the folder called libs in your application. *. jar files in this folder are included into the compile classpath via the default build.

Can you run jar files on Android?

In our tests, we found the JBED app to be the best of the lot to open jar files on Android devices. It's basically a JAVA emulator which you can use to install JAR/JAD/JAVA/J2ME/MIDP apps & games on your Android device.

Where is the lib folder in Android Studio?

How to find the libs folder in Android Studio? If you are unable to find the libs folder in Android studio then open your android project in “Project” mode If the project is already opened in the “Android” mode. Then go to Your Project Name > app > libs and right-click on it and paste the downloaded JAR files.


1 Answers

Google just release a new version of the SDK that handles Shared Libraries!

https://developer.android.com/tools/projects/projects-eclipse.html#SettingUpLibraryProject

ADT 0.9.7 (May 2010)

Library projects:
The ADT Plugin now supports the use of library projects during development, a capability that lets you store shared Android application code and resources in a separate development project. You can then reference the library project from other Android projects and, at build time, the tools compile the shared code and resources as part of the dependent applications. More information about this feature is available in the Developing in Eclipse with ADT document. If you are not developing in Eclipse, SDK Tools r6 provides the equivalent library project support through the Ant build system.

like image 64
ddcruver Avatar answered Oct 08 '22 17:10

ddcruver