1

I have created for my application, some custom GUI component and used them.

Now i want to make them redistributable. I know that add the sources to another project and use them in that way, but i'd prefer to make something like a jar or similar.

I want that if an user add my library (maybe a jar??) to its application, he can add the gui component in his application as any other components (using drag and drop or simply specifying it in the application layout).

Is it possible?

Ivan
  • 4,186
  • 5
  • 39
  • 72
  • Quoting myself from elsewhere: "For the advice on how to create reusable components, see [The Busy Coder's Guide to Advanced Android Development](http://commonsware.com/AdvAndroid). If you are not a subscriber, you can find free older editions of that book on [the book's Web page](http://commonsware.com/AdvAndroid) in the "Four-to-Free Guarantee" tab." – CommonsWare Mar 02 '12 at 20:57

1 Answers1

1

Definitely....this is the whole concept of Java libraries and code reuse. You must decide on an api for your components or in a way how you intend them to use your api, and publish them in the form of a jar. Then any user who wants to use your classes will be able to include the jar in his classpath and be able to reuse your components.

MoveFast
  • 3,011
  • 2
  • 27
  • 53
  • i know that, i know how jars works, etc, my question is specific to Android gui components. Afaik if i export my gui components in form of jar, i cannot use the xml files for layout. The android gui components has also they layout into one or more xml file. – Ivan Mar 02 '12 at 19:38
  • 1
    include your xml files also in your jar...the users can do a getResource() and use the xml files as well if the jar is in their class path. – MoveFast Mar 03 '12 at 03:19