2

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?

  • 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 Answers2

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
  1. First thing is to have the full library-project ( example : FullProject).
  2. 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)
  3. in the copy, i removed the source code.
  4. in the app-project i added the source-less-library-project as android library
  5. 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 » ).
  6. in the build path of the app project, in "order and export", check the .jar exported
  7. update the manifest file of the app project with all views of the library project .
  8. clean the app project
  9. It’s all !
abdessamed
  • 11
  • 4