views:

695

answers:

3

Hi Folks,

I'm just starting out on Android and Java programming, coming in from a C++ background. I was wondering - whats the best way to go about making a library/UI widget/component that I can license to third-party developers?

In C++ I'd ship the customers my headers and *.a files, but I don't know the equivalent in Java.

Are there any good resources or links about this, maybe even from general Java development standpoint.

+1  A: 

Not sure about how Android handles this, but the typical distribution of Java code is a .jar file. A .jar is basically a zip file containing all of the compiled .class files in a Java project. There might also be resource/text/etc. files within the .jar. There is no concept of a header file in Java, so all you need are the .class files, and possibly a manifest file to provide some additional meta info about the .jar.

http://java.sun.com/docs/books/tutorial/deployment/jar/

(This is just a general Java answer, it may or may not apply to Android)

Andy White
+2  A: 

you can define activities/services that are available for any other application running on android:

"A central feature of Android is that one application can make use of elements of other applications (provided those applications permit it). For example, if your application needs to display a scrolling list of images and another application has developed a suitable scroller and made it available to others, you can call upon that scroller to do the work, rather than develop your own. "

http://developer.android.com/guide/topics/fundamentals.html

silmx
+3  A: 

Activities and services have some use but there is a whole class of functionality (fancy table viewer for sql) that isn't covered. You can do jars but I don't think you can have android resources in that file. The work around would be to have a Jar and require the user to copy and paste some text into the apps resource directory. You can look at the admob.com android SDK for an example of this.

hacken
Thank you, I will look into jar files first and then see how they apply to Android.
Justicle