Justicle
Justicle

Reputation: 15143

Making a redistributable component or library for Android

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.

Upvotes: 9

Views: 2261

Answers (3)

hacken
hacken

Reputation: 2145

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.

Upvotes: 3

silmx
silmx

Reputation: 486

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

Upvotes: 3

Andy White
Andy White

Reputation: 88345

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)

Upvotes: 1

Related Questions