On Thu, Jan 26, 2012 at 11:25 AM, Klier Rainer <[email protected]> wrote:
> ahh, do you mean like suggested here:
> http://blog.sofisoftware.com/post/2011/10/05/Android-Library-projects-and-Jars
Considering that's referencing some of my early work on the subject, yes. :-)
> you mean i should replace for example all
> R.layout.identifier_1
> to
> getResources().getIdentifier("identifier_1", "layout",
> "full.package.name"); ?
Yes, thiough you can call getPackageName() to fill in for the third
parameter, IIRC.
> is it this book you are talking about?
>
> http://www.amazon.de/Coders-Guide-Advanced-Android-Development/dp/098167805X/ref=sr_1_cc_1?s=aps&ie=UTF8&qid=1327592129&sr=1-1-catcorr
Yes, though the Warescription digital edition is newer.
> is the 2nd edition offered by amazon.de new enough?
Yes.
>> 1. Create an Android library project, with your source code and such –
>
> you mean with source code AND resources?
> like any usual library project.
Yes.
>> 2. Compile the Java source (e.g., ant compile) and turn it into a JAR file
>
> would a Project/Clean... build from eclipse also produce the required
> jar? (menu "Project", menu-entry "Clean..." in eclipse)
AFAIK, no.
It's possible you can create the JAR from Eclipse. I usually slap a
"jar" task in my build.xml and do it from the command line. I prefer
command line for distribution-related tasks, despite nowadays using
Eclipse for mainline development.
> i tried this whith the TicTacToeLib example from
> http://developer.android.com/resources/samples/TicTacToeLib/index.html
> and it produced a file tictactoelib.jar under bin directory in the
> TicTacToeLib project.
> this contains only .class files.
>
> would that be the required jar file?
Presumably, yes, but I have no way to tell from here.
>> Personally, I'd just wait a bit. I am hopeful that the official
>> support for library-projects-as-JARs will be available soonish.
>
> ok, how soon whould you expect?
> hours?
> days?
> weeks?
> months?
> years?
Well, I have no way of knowing for certain. I'm hoping its "weeks".
> but as you said, i first have to create an Android library project
> including everything anyway.
> so i can start with this.
>
> or will that step not be necessary any more, when official support for
> library-projects-as-JARs will be available?
The plan, as I understand it, would avoid the whole
getResources().getIdentifier() nonsense, and you wouldn't have to
manually create the JAR and the "distribution" library project that
uses it.
--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy
Android Training in DC: http://marakana.com/training/android/
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en