I've been trying to use @CommonsWare's answer over here to make an Android project (in Eclipse ADT) which I can share without giving all my code to people I share it with (the code has proprietary stuff to connect to our servers and we don't want to make it easy for people to connect to our servers without this component).
My project is currently a simple control (a button) which when pressed will do some stuff, including playing a tone and sending information to our server (there's an interface for the user to provide the information).
As a normal included library project it works well, and I can put most of the logic in a separate JAR I made without any resources in yet another project. But ideally I would like to have the entire code (the button onClick method etc) also wrapped up away from prying eyes and only leave the actual resources open (since I understand that is unavoidable)
I may have misunderstood what Mark wrote in his answer but what I did was build the project, then select "Export", select "Java|JAR File", then select inside the working project the bin directory and the classes underneath that I want to export (also some JARs under "libs"). The classes I chose from "bin" seem to be there in the JAR but packed inside a second JAR like so:
JAR
|
META-INF
libs
bin----
|
R.txt
jarlist.cache
myprojectname.jar
AndroidManifest.xml
(The classes referring to the button are inside "myprojectname.jar") When I import he project (using the main outsde JAR and no source code as suggested in the solution) my main project does not recognize the button type.
Anyone know what I am doing wrong?
Unfortunately I cannot work with an AAR as I have to be compatible with Eclipse users for now.