I am developing android library project.I don't want share my source code.I want to create something like jar file.But i can't create jar file as it includes xml layouts.so is there any way to build project without including source code?
Asked
Active
Viewed 1,470 times
2
-
you can make your project a library project. http://developer.android.com/tools/projects/index.html and this http://developer.android.com/tools/projects/projects-eclipse.html – Raghunandan Jul 01 '13 at 08:48
-
possible duplicate http://stackoverflow.com/questions/5014128/create-an-android-jar-library-for-distribution – Plato Jul 01 '13 at 08:51
2 Answers
0
I can give you an example of such library. Open Android SDK manager and download Google play services library.
This library contains 'libs' folder with google-play-services.jar which contains all the source code. Also there is 'res' folder and android manifest file to be able to add this library to every android project.

Flavio
- 6,205
- 4
- 30
- 28
0
- First thing is to have the full library-project ( example : FullProject).
- Then I import the full library project (FullProject) in a new workspace and check “Copy Projects into workspace”. This new project must have the same name ( FullProject)
- in the copy, i removed the source code.
- in the app-project i added the source-less-library-project as android library
- in the app-project i added the .jar file with all the binary classes from the full library-project ( right clic on directory “source” of the full library-project, export as jar and check « Add directory entry » ).
- in the build path of the app project, in "order and export", check the .jar exported
- update the manifest file of the app project with all views of the library project .
- clean the app project
- It’s all !

abdessamed
- 11
- 4