[android-developers] Android Library Project

Showing 1-58 of 58 messages
[android-developers] Android Library Project Mark Carter 5/22/10 2:49 AM
Great to see the new Android Library Project feature in ADT 0.9.7.

http://developer.android.com/guide/developing/eclipse-adt.html#libraryProject

However, some things aren't clear to me yet:

1. In the library project, what does versionCode, versionName,
packageName now mean? I assume nothing???
2. The docs state that activities, services etc need to be declared in
the library project and also the app project. So doesn't this just
result in a load of duplication? What if the activity is declared
slightly differently in one to the other?
3. It would have been incredibly useful to allow library projects to
reference each other. I'm curious as to why this is not possible...
4. If an app references both resources and code in a library project,
then that library project needs to be added as both a library and a
project in the app's build path (in eclipse at least) - why is this?
5. I'm considering subclassing library project activities/services in
my app project. Is there any reason not to do this?

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-d...@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Android Library Project Mark Carter 5/22/10 4:21 AM
When trying to launch an activity, the console gives:

Uploading MyApp.apk onto device 'emulator-5554'
Installing MyApp.apk...
Success!
Could not find MyLibrary.apk!
Starting activity com.mycompany.MyActivity on device
ActivityManager: Starting: Intent { act=android.intent.action.MAIN
cat=[android.intent.category.LAUNCHER] cmp=com.mycompany/
com.mycompany.MyActivity }
Attempting to connect debugger to 'com.mycompany' on port 8612

And then the activity fails to start (ClassNotFoundException).

This seems to be because of the line:

Could not find MyLibrary.apk!

Any ideas?

On May 22, 11:49 am, Mark Carter <m...@carter.name> wrote:
> Great to see the new Android Library Project feature in ADT 0.9.7.
>
> http://developer.android.com/guide/developing/eclipse-adt.html#librar...
Re: [android-developers] Android Library Project Xavier Ducrohet 5/22/10 1:12 PM
On Sat, May 22, 2010 at 2:49 AM, Mark Carter <ma...@carter.name> wrote:
> Great to see the new Android Library Project feature in ADT 0.9.7.
>
> http://developer.android.com/guide/developing/eclipse-adt.html#libraryProject
>
> However, some things aren't clear to me yet:
>
> 1. In the library project, what does versionCode, versionName,
> packageName now mean? I assume nothing???

Yes, nothing.

The manifest for the library is not used besides looking at the
package name for the library.

> 2. The docs state that activities, services etc need to be declared in
> the library project and also the app project. So doesn't this just
> result in a load of duplication? What if the activity is declared
> slightly differently in one to the other?

They actually don't need to be declared in the library (yet).
We only recommend you put them in the library manifest as a reference
so that you can easily copy-paste them into the app projects that
reference them.
(In the future we will automatically merge the library manifests into
the app manifests).

> 3. It would have been incredibly useful to allow library projects to
> reference each other. I'm curious as to why this is not possible...

It was mainly that we didn't have time.
We need to figure out the order of the resources (as you may already
have read, the priority order is important as resources could override
each other).
The question is what happens when a project depends on libraries A & B
which both depend on library C. What's the library priority order? A,
B, C or A, C, B?

> 4. If an app references both resources and code in a library project,
> then that library project needs to be added as both a library and a
> project in the app's build path (in eclipse at least) - why is this?

hmm no you should not have too.
Adding the library as a project dependence (in project properties
under Android) should bring the source code of the library into the
main project.

> 5. I'm considering subclassing library project activities/services in
> my app project. Is there any reason not to do this?

Since the library project is compiled inside the app project, there's
no reason this won't work.

Xav

--
Xavier Ducrohet
Android SDK Tech Lead
Google Inc.

Please do not send me questions directly. Thanks!
Re: [android-developers] Re: Android Library Project Xavier Ducrohet 5/22/10 1:15 PM
There is something very strange here.

What is MyLibrary.apk?

I think you may be a bit confused with what libraries are.

Library projects are handled at compilation time. They are *NOT* meant
to be export as APK (I don't even know how you managed to create
MyLibrary.apk because the tools don't let you do it).

When you compile an application project that depends on a library, the
code and resources of the library are included in the app project's
apk when you compile it.

Xav
--
Xavier Ducrohet
Android SDK Tech Lead
Google Inc.

Please do not send me questions directly. Thanks!

[android-developers] Re: Android Library Project Mark Carter 5/22/10 2:48 PM
On May 22, 10:12 pm, Xavier Ducrohet <x...@android.com> wrote:
> The manifest for the library is not used besides looking at the
> package name for the library.

So, for now, the packageName is the only important thing in the
library manifest?

> The question is what happens when a project depends on libraries A & B
> which both depend on library C. What's the library priority order? A,
> B, C or A, C, B?

Why didn't you just use fully qualified resources when referring to
library resources?

So, in XML that would be "@mylibrary:string/mystring" and in Java
com.mycompany.mylibrary.R.String.mystring etc

> > 4. If an app references both resources and code in a library project,
> > then that library project needs to be added as both a library and a
> > project in the app's build path (in eclipse at least) - why is this?
>
> hmm no you should not have too.
> Adding the library as a project dependence (in project properties
> under Android) should bring the source code of the library into the
> main project.

It seems that when I was adding the library before, it wasn't being
added properly. I set it as described in the docs but for some reason
it wasn't showing up as a library under the project.

Now, I've recreated all the projects and this time the library shows
up as a child "node" of the MyApp project. So it all seems to work. I
didn't do anything different from before, but maybe starting from a
clean slate made a difference...

I think the bug mentioned in my second post was due to (additionally)
specifying the library as a project in the build path of MyApp.
Something was expecting MyLibrary.apk to exist because of that (and
because MyLibrary is an Android project). Just a guess.

Now that I don't need to specify the library in the build path, this
problem is gone.

If this is right, maybe it would be good to stop the same project from
being added in both places?

> > 5. I'm considering subclassing library project activities/services in
> > my app project. Is there any reason not to do this?
>
> Since the library project is compiled inside the app project, there's
> no reason this won't work.

Consider this pro & lite projects scenario:

Pro-specific activities go in the pro project.
Common activities go in the library.

But what about common activities that are slightly different in pro
versus lite?  Could be tricky to inject pro-specific behaviour into
those common activities (because of the way activities are
instantiated).

It seems it might be simpler to just subclass such activities...
Re: [android-developers] Re: Android Library Project Xavier Ducrohet 5/22/10 3:26 PM
On Sat, May 22, 2010 at 2:48 PM, Mark Carter <mjc...@googlemail.com> wrote:
> On May 22, 10:12 pm, Xavier Ducrohet <x...@android.com> wrote:
>> The manifest for the library is not used besides looking at the
>> package name for the library.
>
> So, for now, the packageName is the only important thing in the
> library manifest?
>
>> The question is what happens when a project depends on libraries A & B
>> which both depend on library C. What's the library priority order? A,
>> B, C or A, C, B?
>
> Why didn't you just use fully qualified resources when referring to
> library resources?
>
> So, in XML that would be "@mylibrary:string/mystring" and in Java
> com.mycompany.mylibrary.R.String.mystring etc

This would require platform changes, which means it would only have
worked on 2.2.

We wanted to make this a build change only in order to support 1.5+
(the 1.5/1.6/2.1 SDK components were updated only to update the build system)

>> > 4. If an app references both resources and code in a library project,
>> > then that library project needs to be added as both a library and a
>> > project in the app's build path (in eclipse at least) - why is this?
>>
>> hmm no you should not have too.
>> Adding the library as a project dependence (in project properties
>> under Android) should bring the source code of the library into the
>> main project.
>
> It seems that when I was adding the library before, it wasn't being
> added properly. I set it as described in the docs but for some reason
> it wasn't showing up as a library under the project.
>
> Now, I've recreated all the projects and this time the library shows
> up as a child "node" of the MyApp project. So it all seems to work. I
> didn't do anything different from before, but maybe starting from a
> clean slate made a difference...
>
> I think the bug mentioned in my second post was due to (additionally)
> specifying the library as a project in the build path of MyApp.
> Something was expecting MyLibrary.apk to exist because of that (and
> because MyLibrary is an Android project). Just a guess.
>
> Now that I don't need to specify the library in the build path, this
> problem is gone.
>
> If this is right, maybe it would be good to stop the same project from
> being added in both places?

yeah we should add a test there.

>> > 5. I'm considering subclassing library project activities/services in
>> > my app project. Is there any reason not to do this?
>>
>> Since the library project is compiled inside the app project, there's
>> no reason this won't work.
>
> Consider this pro & lite projects scenario:
>
> Pro-specific activities go in the pro project.
> Common activities go in the library.
>
> But what about common activities that are slightly different in pro
> versus lite?  Could be tricky to inject pro-specific behaviour into
> those common activities (because of the way activities are
> instantiated).
>
> It seems it might be simpler to just subclass such activities...

Yes, which is why I said it should work :)

xav
--
Xavier Ducrohet
Android SDK Tech Lead
Google Inc.

Please do not send me questions directly. Thanks!

[android-developers] Re: Android Library Project Michael A. 5/23/10 7:14 AM
I'm seeing exactly the same problem as Mark Carter.

I've followed the instructions on the reference pages exactly (at
least as far as I can make out). The app project compiles fine and is
able to use and inherit classes in the library project, but trying to
run the (non-library) project in the emulator throws up the "Could not
find <name.of.android.library>.apk!" line right after installing the
non-library app.

This is using Eclipse. Exporting a signed apk for the non-library
project does not seem to work either.

It seems like the library is not being imported into the apk, but it
is not at all obvious why it is not working as everything is working
fine in the developer view.

Regards,

Michael A.

On May 22, 10:15 pm, Xavier Ducrohet <x...@android.com> wrote:
> There is something very strange here.
>
> What is MyLibrary.apk?
>
> I think you may be a bit confused with what libraries are.
>
> Library projects are handled at compilation time. They are *NOT* meant
> to be export as APK (I don't even know how you managed to create
> MyLibrary.apk because the tools don't let you do it).
>
> When you compile an application project that depends on a library, the
> code and resources of the library are included in the app project's
> apk when you compile it.
>
> Xav
>
>
>
[android-developers] Re: Android Library Project Michael A. 5/23/10 9:48 AM
On May 22, 11:48 pm, Mark Carter <mjc1...@googlemail.com> wrote:
> I think the bug mentioned in my second post was due to (additionally)
> specifying the library as a project in the build path of MyApp.
> Something was expecting MyLibrary.apk to exist because of that (and
> because MyLibrary is an Android project). Just a guess.

I try that, even with a clean project, and I just get errors in
Eclipse. No doubt there is something going wrong with the setup, but
it's just not obvious what...
[android-developers] Re: Android Library Project Lance Nanek 5/23/10 10:24 AM
The only time I've seen that "Could not find <otherproject.apk>"
warning was in the same situation as mentioned above, when the project
being run used an Eclipse, Java Build Path, Project dependency on the
other project.

If you want to double check that you don't have that, right click on
the project being run, choose Properties from the menu that pops up,
then choose Java Build Path on the left, then choose the Projects tab.
Make sure you don't have any Android projects listed there. With this
new library feature you don't specify the Android projects you depend
on in the Java Build Path section of the Properties. You do it in the
Android section of the Properties.
[android-developers] Re: Android Library Project Michael A. 5/23/10 11:45 AM
Yes - I realize that. It just doesn't work in my setup. :-(

I can see the R.java file from the library gets included in the
generated content, but i don't get access to the classes in the
library project. Very frustrating.

Regards,

Michael A.
[android-developers] Re: Android Library Project Michael A. 5/23/10 11:53 AM
Just to note that I am fully up to date with both the SDK and Eclipse
plugins, so that does not appear to be the problem.
Re: [android-developers] Re: Android Library Project Xavier Ducrohet 5/23/10 12:06 PM
When you do the link between the main project and the library (as
shown here: http://developer.android.com/images/developing/adt-props-libRef.png),
try to simply restart Eclipse (I know it's annoying) and the link
should happen.

The library source folder will appear in your main project as a new
source folder named after your library project name with a [Android
Library] tag after it. I'm trying to attach a small screenshot that
shows the connection.

Xav
[android-developers] Re: Android Library Project Mark Carter 5/23/10 12:22 PM
I'm sure that the library.apk file error was because I had added the
library project to my app project build path.

The other problem, where app project classes could not see library
project classes was due to something else.

For some strange reason, even when the android library compiles by
itself (I mean, does not show any errors in eclipse), it can give
compiler errors when used as a library in another project. In that
situation, it does not show up like "LibProject" in your png file.

In my situation, this was caused by a problem with a custom widgets I
had defined in my library. The attrs.xml file was being ignored for
some reason. Everything worked fine (i.e. the LibProject showed up as
in your png file) when I removed those custom widget (I'm not talking
about homescreen widgets) attributes from the relevant layout xml in
the library project.

Sorry all this is a bit vague. I'll try and come up with a clearer
scenario but I'm right in the middle of something now.
[android-developers] Re: Android Library Project Michael A. 5/23/10 12:30 PM
Hi,

I figured out (after fiddling around with the TTT examples) that the
problem was that the source folder is not being added to the build
path as it was in the TTT example.

Restarting eclipse after having added the library worked, though.
Thanks.

Regards,

Michael A.

On May 23, 9:06 pm, Xavier Ducrohet <x...@android.com> wrote:
> When you do the link between the main project and the library (as
> shown here:http://developer.android.com/images/developing/adt-props-libRef.png),
> try to simply restart Eclipse (I know it's annoying) and the link
> should happen.
>
> The library source folder will appear in your main project as a new
> source folder named after your library project name with a [Android
> Library] tag after it. I'm trying to attach a small screenshot that
> shows the connection.
>
> Xav
>
>
>
>  LibraryConnection.png
> 18KViewDownload
[android-developers] Re: Android Library Project Michael A. 5/23/10 1:08 PM
Typo: I mean to write as a "Source Folder" on the "Java Build Path"
view.

Unfortunately, it is very hit and miss how well this works. In some
cases, restarting Eclipse works to show the code as a new source
folder, in other cases not. And it's not very obvious (to me), why it
works for one test library and not for another. The only difference
that I can see between the two library projects is that one is version
controlled (subversion).
> You received this message because you are subscribed to the Google ...
>
> read more »
Re: [android-developers] Re: Android Library Project Xavier Ducrohet 5/23/10 2:11 PM
I'm not sure why subversion would impact it, but that's not impossible.

I've done a lot of link/unlink of library projects when we develop it
and never had a problem.
I just tried it at home and it failed to link it correctly (but
restarting eclipse made it work). I guess I'm going to have to go back
to it and see what's up.

Xav
[android-developers] Re: Android Library Project Mark Carter 5/23/10 2:47 PM
On some occasions, the debugger gets a bit mixed up and can't decide
whether the source code lives at MyApp/MyLibrary or MyLibrary. So, if
I set a breakpoint in the source code of the MyLibrary project, it
might be ignored completely, or the breakpoint is reached and, when it
does, a source-not-found type panel comes up (and its apparently
looking for the code at MyApp/MyLibrary). Restarting eclipse solved
the problem.

On May 23, 11:11 pm, Xavier Ducrohet <x...@android.com> wrote:
> I'm not sure why subversion would impact it, but that's not impossible.
>
> I've done a lot of link/unlink of library projects when we develop it
> and never had a problem.
> I just tried it at home and it failed to link it correctly (but
> restarting eclipse made it work). I guess I'm going to have to go back
> to it and see what's up.
>
> Xav
>
>
>
> >> > >> --...
[android-developers] Re: Android Library Project Michael A. 5/23/10 3:15 PM
Right. I may have managed to stumble upon the cause of the problems I
experienced.

I tend to name my projects using dot notation; e.g. "domain.project".
It seems as if this naming might have caused problems. Once I renamed
the non-functioning library project to "domain_project", the library
connection works after a restart.

I haven't got far with testing it out, but at least I can get it to
build and run on the emulator now. I do seem to have to do a restart
of eclipse each time I refactor, though - this seems to be the only
way to get rid of a "The Project cannot be built until build path
errors are resolved" issue that pops up each time I move a class from
the main project to the library project.

Regards,

Michael A.

On May 23, 11:11 pm, Xavier Ducrohet <x...@android.com> wrote:
> I'm not sure why subversion would impact it, but that's not impossible.
>
> I've done a lot of link/unlink of library projects when we develop it
> and never had a problem.
> I just tried it at home and it failed to link it correctly (but
> restarting eclipse made it work). I guess I'm going to have to go back
> to it and see what's up.
>
> Xav
>
Re: [android-developers] Re: Android Library Project Xavier Ducrohet 5/23/10 3:24 PM
hmm interesting point about the period in the project name. I'll check
it out tomorrow at work.

What's the build path error you get when you refactor a class from the
main project to the library? This really shouldn't happen!

Xav
Re: [android-developers] Re: Android Library Project Mark Carter 5/23/10 3:35 PM
FWIW, I don't use periods in project names.

As for my comment about breakpoints - it seems the workaround is to access the (and set breakpoints on) library source code in MyApp/MyLibrary rather than MyLibrary (i.e. top level).

If you set a breakpoint in a class of the top level project then the debugger may indeed suspend execution but then may bring up the MyApp/MyLibrary source code (where the breakpoint icon is not visible). Often, I found myself with two copies of the same file open in the workspace - very confusing...

Is anyone else experiencing this?
Re: [android-developers] Re: Android Library Project Xavier Ducrohet 5/23/10 3:38 PM
Ah that may be a problem with Eclipse and how it deals with linked
source folder.

I'll see if we can override the behavior, but it's unlikely.

Xav
Re: [android-developers] Re: Android Library Project Mark Carter 5/23/10 3:50 PM
@Xav - about the conflicting resource naming problem in multi-level library hierarchy... Would it not be simplest to just not allow sibling libraries to define the same resource? Just fail the compilation.

All these libraries are in-house so we've got enough control over this.

So imagine a library hierarchy. Allow the resources to bubble up. A parent resource can override a child resource etc. But at each level in the hierarchy, make sure that no two siblings have the same resource.

Actually, the bubbling up just continues to the app project. i.e. an app project can define an overring resource.
[android-developers] Re: Android Library Project Michael A. 5/23/10 4:22 PM
On May 24, 12:24 am, Xavier Ducrohet <x...@android.com> wrote:
> What's the build path error you get when you refactor a class from the
> main project to the library? This really shouldn't happen!

Non-obvious (of course).

I just get a "The project cannot be built until build path errors are
resolved" of type "Java Problem" on the project, location "Unknown".

No useful console information. Cleaning the project sometimes works to
clear the problem, though not always (the reason for the occasional
failures may be because it gets confused if several projects have to
be rebuilt? Haven't tested this exhaustively, so I'm not sure.
Restarting eclipse does the job, though).

Regards,

Michael A.
[android-developers] Re: Android Library Project Mark Carter 5/22/10 1:21 PM
Thanks Xavier.

MyLibrary is the name of my library project. I don't explicitly create
or intend to create the APK. The console shows that something is
expecting to find it.

Here's my guess:

I had to add the MyLibrary project as a dependency to MyApp project
because otherwise MyApp could not find various classes defined in
MyLibrary project. I suppose eclipse is trying to compile the
MyLibrary project because of this dependency. Could that be it?

If I don't add the project dependency (not to be confused with the
library dependency you describe in the docs), then MyApp does not
compile.

On May 22, 10:15 pm, Xavier Ducrohet <x...@android.com> wrote:
> There is something very strange here.
>
> What is MyLibrary.apk?
>
> I think you may be a bit confused with what libraries are.
>
> Library projects are handled at compilation time. They are *NOT* meant
> to be export as APK (I don't even know how you managed to create
> MyLibrary.apk because the tools don't let you do it).
>
> When you compile an application project that depends on a library, the
> code and resources of the library are included in the app project's
> apk when you compile it.
>
> Xav
>
>
>
>
>
[android-developers] Re: Android Library Project Mark Carter 5/24/10 11:18 AM
Hmmm - please ignore - seems Google Groups is doing some strange
delayed postings.
[android-developers] Re: Android Library Project Mark Carter 5/25/10 6:51 AM
For me, the biggest problem with the Android Library Project feature,
is that library source files are showing up multiple times (once for
the library project and then once for each project that uses that
library project) in:

1. The main source view
2. Call Hierarchy
3. Compiler warnings/errors

i.e. everything is duplicated making things much harder to manage.

(this is a bit more detail of what I wrote earlier - but essentially
the same problem)

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-d...@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Android Library Project Xavier Ducrohet 5/25/10 10:49 AM
Yes, this is not great.

The problem is our need to compile the library code as part of the
main project, and Eclipse only really gives us access to linked source
folder (it's so much easier in Ant because we control the input to
javac). I'm not sure there are other ways, except than replacing the
Java builder with our own (and this is not something I want to do).

Xav
--
Xavier Ducrohet
Android SDK Tech Lead
Google Inc.

Please do not send me questions directly. Thanks!
Re: [android-developers] Re: Android Library Project Mark Carter 5/25/10 11:30 AM
One thing that makes things slightly easier is to uncheck the Builders -> Java Builder of the Library project. This means that compiler errors/warnings will not be duplicated. You still need to be sure you are editing the code from MyApp/MyLibrary rather than MyLibrary.

This doesn't help the call hierarchy problem though.

Another option is just to use resource-only libraries and live with replicating the java code in the top level apps.
Re: Android Library Project Mark Carter 5/26/10 3:16 AM
I guess you've probably looked into this already, but is there any way
to make this work by adding the Android project to the build path (as
opposed to making it a library project and then adding it as a
library)?

From a developer's perspective this would be more intuitive because
projects would be referencing java projects and android projects in
the same way. This would stop the problems regarding code apparently
existing in two locations. As for the resources, couldn't your pre
compiler handle that?

For a shared Android project, the R class would be generated in the
same way as before. For an Android project referencing shared Android
projects, the R class would also include all the aggregated resources.

If there is a way to make this work, it would be ideal, because it
also supports deep nesting of Android projects.

On May 25, 8:30 pm, Mark Carter <mjc1...@googlemail.com> wrote:
> One thing that makes things slightly easier is to uncheck the Builders ->
> Java Builder of the Library project. This means that compiler
> errors/warnings will not be duplicated. You still need to be sure you are
> editing the code from MyApp/MyLibrary rather than MyLibrary.
>
> This doesn't help the call hierarchy problem though.
>
> Another option is just to use resource-only libraries and live with
> replicating the java code in the top level apps.
>
> On 25 May 2010 19:49, Xavier Ducrohet <x...@android.com> wrote:
>
>
>
>
>
> > Yes, this is not great.
>
> > The problem is our need to compile the library code as part of the
> > main project, and Eclipse only really gives us access to linked source
> > folder (it's so much easier in Ant because we control the input to
> > javac). I'm not sure there are other ways, except than replacing the
> > Java builder with our own (and this is not something I want to do).
>
> > Xav
>
> > On Tue, May 25, 2010 at 6:51 AM, Mark Carter <mjc1...@googlemail.com>

> > wrote:
> > > For me, the biggest problem with the Android Library Project feature,
> > > is that library source files are showing up multiple times (once for
> > > the library project and then once for each project that uses that
> > > library project) in:
>
> > > 1. The main source view
> > > 2. Call Hierarchy
> > > 3. Compiler warnings/errors
>
> > > i.e. everything is duplicated making things much harder to manage.
>
> > > (this is a bit more detail of what I wrote earlier - but essentially
> > > the same problem)
>
> > > --
> > > You received this message because you are subscribed to the Google
> > > Groups "Android Developers" group.
> > > To post to this group, send email to android-d...@googlegroups.com
> > > To unsubscribe from this group, send email to
> > > android-developers+unsubscribe@googlegroups.com<android-developers%2Bunsubs cr...@googlegroups.com>

> > > For more options, visit this group at
> > >http://groups.google.com/group/android-developers?hl=en
>
> > --
> > Xavier Ducrohet
> > Android SDK Tech Lead
> > Google Inc.
>
> > Please do not send me questions directly. Thanks!
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-d...@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscribe@googlegroups.com<android-developers%2Bunsubs cr...@googlegroups.com>

> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-d...@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscribe@googlegroups.com
> For more options, visit this group athttp://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: Android Library Project Xavier Ducrohet 5/26/10 11:33 AM
On Wed, May 26, 2010 at 3:16 AM, Mark Carter <mjc...@googlemail.com> wrote:
> I guess you've probably looked into this already, but is there any way
> to make this work by adding the Android project to the build path (as
> opposed to making it a library project and then adding it as a
> library)?
>
> From a developer's perspective this would be more intuitive because
> projects would be referencing java projects and android projects in
> the same way. This would stop the problems regarding code apparently
> existing in two locations. As for the resources, couldn't your pre
> compiler handle that?

We can' really do that because the Eclipse compiler doesn't handle
those projects at the source level, and instead use the output of
those projects (the generated .class files) to compile the current
project. What we need is the main project to compile the source of the
library projects, which is why we used the linked source folder.

I think it's actually useful to have it be different than referencing
Java project because the behavior is really different.

> For a shared Android project, the R class would be generated in the
> same way as before. For an Android project referencing shared Android
> projects, the R class would also include all the aggregated resources.

The problem is not so much generating the R class, it's making sure
the library project is compiled with this "composite" R class made of
all the projects (main + libs).

> If there is a way to make this work, it would be ideal, because it
> also supports deep nesting of Android projects.

Library projects depending on other Library projects is not impossible
with the current system. It's just that there are a few things to
figure out first. We'll add support for it soon hopefully.

Xav


--
Xavier Ducrohet
Android SDK Tech Lead
Google Inc.

Please do not send me questions directly. Thanks!

Re: [android-developers] Re: Android Library Project Mark Carter 5/26/10 11:58 AM
On 26 May 2010 20:33, Xavier Ducrohet <x...@android.com> wrote:
The problem is not so much generating the R class, it's making sure
the library project is compiled with this "composite" R class made of
all the projects (main + libs).

Is it essential for the library project to be compiled with the composite R class?

At each level in the library hierarchy, the R class would only include the resources of its own project and any descendant libraries. You could enforce that no two projects in the hierarchy define the same resource (otherwise give a compiler error).
Re: [android-developers] Re: Android Library Project Xavier Ducrohet 5/26/10 1:46 PM
It's essential because It's impossible to have each library handle its
resources independently.

Currently there's no way to have each library packages its resources
(and give them resources IDs) in a way that doesn't conflict with
other resources.
This means if we compile resources for 2 libraries, the first layout
in R.layout in both libraries will have the same ID.
Of course when we package the resources together for the apk, then the
ID for resources coming from the libraries will have a different ID
than if they were packaged separately.

This means the R class must be created from *all* the resources, and
the library code must be compiled with the final R class.

Now, we could implement resource namespace or multiple res packages
inside an apk so that libraries can manage their resources separately.
The big issue here is that it's a platform change which means it won't
work on older platforms.

Our goal was to support 1.5+ so implementing them purely at the build
level was chosen.

We could also have made the library code access the R.*.* values
through reflection. I would have been a bit slower, but through a
cache mechanism this could work. This would also allow people to
distribute library binaries. I feel this is less useful though, but we
may offer this as an option at some point.

> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-d...@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscribe@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

--

Xavier Ducrohet
Android SDK Tech Lead
Google Inc.

Please do not send me questions directly. Thanks!

Re: [android-developers] Re: Android Library Project Michael Thomas 5/26/10 1:55 PM
My heavens, you mean you need a resource linker? :)

Mike

Re: [android-developers] Re: Android Library Project Mark Carter 5/26/10 1:58 PM
Thank you for explaining.

With regards to the conflicting resource IDs, couldn't you just make whatever assigns those IDs keep them unique across different projects?
Re: [android-developers] Re: Android Library Project Xavier Ducrohet 5/26/10 2:04 PM
It's hard to keep them unique.

- One possibility is to make aapt (which is what compile them into
R.java and packages them into the apk) be given a different starting
value for each library. The problem is that you can have any combo of
library so which starting point do you use when compiling your library
when you don't know what's going to use it?

- Another possibility is to have aapt package all the libraries and
the main project in a single pass, so that it knows how many libraries
there are and automatically set starting values. Well, in that case
you need to store the Ids in the main project anyway, because if you
compile the same library in the scopes of 2 different projects, then
you'll get two different R.java for the same library, which means the
library must be compiled in the scope of the project that uses it...
which is what we do without bothering with different starting values
per library :)

Re: [android-developers] Re: Android Library Project Mark Carter 5/26/10 2:13 PM
With regards to the first possibility...

Rather than giving the aapt a starting value why not let it work it out for itself? Nothing else is generating those ids, so it can be sure that it doesn't give the same id to a different project.

This, of course, assumes that the aapt has some way to persist this data between calls - which I'm sure there must be.
Re: [android-developers] Re: Android Library Project Xavier Ducrohet 5/26/10 2:34 PM
well if you let aapt work it out for itself it will need to know about
the other libraries used by the project. So you're back to exporting
the library in the scope of the main project.
Re: [android-developers] Re: Android Library Project Mark Carter 5/26/10 2:51 PM
It wouldn't need to know about anything else specifically in the app project. When asked to generate ids for some library it just needs to make sure it doesn't use any IDs given before.
Re: [android-developers] Re: Android Library Project Andrew Brampton 5/26/10 12:14 PM

By compiling the library with the composite R you are allowing your
application to override a resource used by the library. Which I think
is a very good thing.

Andrew

Re: [android-developers] Re: Android Library Project Mark Carter 5/27/10 2:18 PM
Its got positives and negatives.

Bear in mind that the resources in android.R are not overridable.

There was an example given earlier where things get messy (when library nesting is allowed):

If library A depends on library B. Project C depends on both A and B then things get a little confusing when A overrides some resources in B: i.e. C would see some B resources where A might be expected.

What happens when a project defines a java class with the same fully-qualified name as in one of its libraries? Short answer: exception (in Eclipse)


--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-d...@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: Android Library Project Didier Girard 6/3/10 9:01 AM
Xavier,
I was just in front of the same problem.
If you could just add a note about restarting eclipse in the following
page it could help a lot :
http://developer.android.com/guide/developing/eclipse-adt.html
Thanks in advance,
Didier


On May 23, 9:06 pm, Xavier Ducrohet <x...@android.com> wrote:
> When you do the link between the main project and the library (as
> shown here:http://developer.android.com/images/developing/adt-props-libRef.png),
> try to simply restart Eclipse (I know it's annoying) and the link
> should happen.
>
> The library source folder will appear in your main project as a new
> source folder named after your library project name with a [Android
> Library] tag after it. I'm trying to attach a small screenshot that
> shows the connection.
>
> Xav
>
>
>
>
>
> On Sun, May 23, 2010 at 11:53 AM, Michael A. <michael.aki...@gmail.com> wrote:
> > Just to note that I am fully up to date with both the SDK and Eclipse
> > plugins, so that does not appear to be the problem.
>
> > On May 23, 8:45 pm, "Michael A." <michael.aki...@gmail.com> wrote:
> >> Yes - I realize that. It just doesn't work in my setup. :-(
>
> >> I can see the R.java file from the library gets included in the
> >> generated content, but i don't get access to the classes in the
> >> library project. Very frustrating.
>
> >> Regards,
>
> >> Michael A.
>
> >> On May 23, 7:24 pm, Lance Nanek <lna...@gmail.com> wrote:
>
> >> > The only time I've seen that "Could not find <otherproject.apk>"
> >> > warning was in the same situation as mentioned above, when the project
> >> > being run used an Eclipse, Java Build Path, Project dependency on the
> >> > other project.
>
> >> > If you want to double check that you don't have that, right click on
> >> > the project being run, choose Properties from the menu that pops up,
> >> > then choose Java Build Path on the left, then choose the Projects tab.
> >> > Make sure you don't have any Android projects listed there. With this
> >> > new library feature you don't specify the Android projects you depend
> >> > on in the Java Build Path section of the Properties. You do it in the
> >> > Android section of the Properties.
>
> >> > On May 23, 7:14 am, "Michael A." <michael.aki...@gmail.com> wrote:
>
> >> > > I'm seeing exactly the same problem as Mark Carter.
>
> >> > > I've followed the instructions on the reference pages exactly (at
> >> > > least as far as I can make out). The app project compiles fine and is
> >> > > able to use and inherit classes in the library project, but trying to
> >> > > run the (non-library) project in the emulator throws up the "Could not
> >> > > find <name.of.android.library>.apk!" line right after installing the
> >> > > non-library app.
>
> >> > > This is using Eclipse. Exporting a signed apk for the non-library
> >> > > project does not seem to work either.
>
> >> > > It seems like the library is not being imported into the apk, but it
> >> > > is not at all obvious why it is not working as everything is working
> >> > > fine in the developer view.
>
> >> > > Regards,
>
> >> > > Michael A.
>
> >> > > On May 22, 10:15 pm, Xavier Ducrohet <x...@android.com> wrote:
>
> >> > > > There is something very strange here.
>
> >> > > > What is MyLibrary.apk?
>
> >> > > > I think you may be a bit confused with what libraries are.
>
> >> > > > Library projects are handled at compilation time. They are *NOT* meant
> >> > > > to be export as APK (I don't even know how you managed to create
> >> > > > MyLibrary.apk because the tools don't let you do it).
>
> >> > > > When you compile an application project that depends on a library, the
> >> > > > code and resources of the library are included in the app project's
> >> > > > apk when you compile it.
>
> >> > > > Xav
>
> >> > > > On Sat, May 22, 2010 at 4:21 AM, Mark Carter <mjc1...@googlemail.com> wrote:
> >> > > > > When trying to launch an activity, the console gives:
>
> >> > > > > Uploading MyApp.apk onto device 'emulator-5554'
> >> > > > > Installing MyApp.apk...
> >> > > > > Success!
> >> > > > > Could not find MyLibrary.apk!
> >> > > > > Starting activity com.mycompany.MyActivity on device
> >> > > > > ActivityManager: Starting: Intent { act=android.intent.action.MAIN
> >> > > > > cat=[android.intent.category.LAUNCHER] cmp=com.mycompany/
> >> > > > > com.mycompany.MyActivity }
> >> > > > > Attempting to connect debugger to 'com.mycompany' on port 8612
>
> >> > > > > And then the activity fails to start (ClassNotFoundException).
>
> >> > > > > This seems to be because of the line:
>
> >> > > > > Could not find MyLibrary.apk!
>
> >> > > > > Any ideas?
>
> >> > > > > On May 22, 11:49 am, Mark Carter <m...@carter.name> wrote:
> >> > > > >> Great to see the new Android Library Project feature in ADT 0.9.7.
>
> >> > > > >>http://developer.android.com/guide/developing/eclipse-adt.html#librar...
>
> >> > > > >> However, some things aren't clear to me yet:
>
> >> > > > >> 1. In the library project, what does versionCode, versionName,
> >> > > > >> packageName now mean? I assume nothing???
> >> > > > >> 2. The docs state that activities, services etc need to be declared in
> >> > > > >> the library project and also the app project. So doesn't this just
> >> > > > >> result in a load of duplication? What if the activity is declared
> >> > > > >> slightly differently in one to the other?
> >> > > > >> 3. It would have been incredibly useful to allow library projects to
> >> > > > >> reference each other. I'm curious as to why this is not possible...
> >> > > > >> 4. If an app references both resources and code in a library project,
> >> > > > >> then that library project needs to be added as both a library and a
> >> > > > >> project in the app's build path (in eclipse at least) - why is this?
> >> > > > >> 5. I'm considering subclassing library project activities/services in
> >> > > > >> my app project. Is there any reason not to do this?
>
> >> > > > >> --
> >> > > > >> You received this message because you are subscribed to the Google
> >> > > > >> Groups "Android Developers" group.
> >> > > > >> To post to this group, send email to android-d...@googlegroups.com
> >> > > > >> To unsubscribe from this group, send email to
> >> > > > >> android-developers+unsubscribe@googlegroups.com
> >> > > > >> For more options, visit this group athttp://groups.google.com/group/android-developers?hl=en
>
> >> > > > > --
> >> > > > > You received this message because you are subscribed to the Google
> >> > > > > Groups "Android Developers" group.
> >> > > > > To post to this group, send email to android-d...@googlegroups.com
> >> > > > > To unsubscribe from this group, send email to
> >> > > > > android-developers+unsubscribe@googlegroups.com
> >> > > > > For more options, visit this group at
> >> > > > >http://groups.google.com/group/android-developers?hl=en
>
> >> > > > --
> >> > > > Xavier Ducrohet
> >> > > > Android SDK Tech Lead
> >> > > > Google Inc.
>
> >> > > > Please do not send me questions directly. Thanks!
>
> --
> Xavier Ducrohet
> Android SDK Tech Lead
> Google Inc.
>
> Please do not send me questions directly. Thanks!
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-d...@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscribe@googlegroups.com
> For more options, visit this group athttp://groups.google.com/group/android-developers?hl=en
>
>  LibraryConnection.png
> 18KViewDownload
Re: [android-developers] Re: Android Library Project Mark Carter 6/4/10 10:47 PM
I had to abandon the Library Project approach in the end because I was running into so many eclipse errors it was really slowing me down. This is particularly true when refactoring - which, I suppose, is the first thing people do when changing their code to use libraries.

For example, if your Library project depends on a Java project and you do things like rename packages in that Java project, then eclipse would throw up an error (unfortunately can't remember which one). Restarting eclipse didn't seem to make a difference. Workaround was to create a new package and move classes into that. Didn't isolate the problem so there might be other factors involved here - like another Android project also depending on that Java project.
Re: [android-developers] Re: Android Library Project Xavier Ducrohet 6/5/10 1:56 PM
How does your library project depend on the (standard?) java project?

From the refactoring feature point of view, both projects are Java
project (a library project, like normal Android project, is both Java
and Android projects), so I'm not sure how it's the fault of the
library feature?
(Now, after participating in this thread a couple weeks back, I have
been to busy to see if linked folders in Eclipse have poor refactoring
support, so there may be issues there. I'll try that soon hopefully)

Anytime you touch a java file in a some advanced way (renaming,
moving, extracting, refactoring) the android plug-in does nothing,
it's all the JDT.

In the end, I think dealing with the pain of refactoring might be
worth it if the library really provides benefit once the refactoring
is done, since this should be a one time thing, but you're going to
use your library many times in various projects (I would expect, or
you wouldn't need the library in the first place)

Xav

Re: Android Library Project Wenzhong 6/14/10 6:40 PM
I am also having problem with using library projects.  I refactored
two of my apps to use a shared project.  Both apps work well after
refactoring.  However they now show 2 icons each in the app view when
I click ^ button.  It happens on both my Droid running 2.1 and G1
running 1.6.  Anybody has the same issue?

Thanks
Wenzhong

On Jun 5, 1:56 pm, Xavier Ducrohet <x...@android.com> wrote:
> How does your library project depend on the (standard?) java project?
>
> From the refactoring feature point of view, both projects are Java
> project (a library project, like normal Android project, is both Java
> and Android projects), so I'm not sure how it's the fault of the
> library feature?
> (Now, after participating in this thread a couple weeks back, I have
> been to busy to see if linked folders in Eclipse have poor refactoring
> support, so there may be issues there. I'll try that soon hopefully)
>
> Anytime you touch a java file in a some advanced way (renaming,
> moving, extracting, refactoring) the android plug-in does nothing,
> it's all the JDT.
>
> In the end, I think dealing with the pain of refactoring might be
> worth it if the library really provides benefit once the refactoring
> is done, since this should be a one time thing, but you're going to
> use your library many times in various projects (I would expect, or
> you wouldn't need the library in the first place)
>
> Xav
>
> On Fri, Jun 4, 2010 at 10:47 PM, Mark Carter <mjc1...@googlemail.com> wrote:
> > I had to abandon the Library Project approach in the end because I was
> > running into so many eclipse errors it was really slowing me down. This is
> > particularly true when refactoring - which, I suppose, is the first thing
> > people do when changing their code to use libraries.
> > For example, if your Library project depends on a Java project and you do
> > things like rename packages in that Java project, then eclipse would throw
> > up an error (unfortunately can't remember which one). Restarting eclipse
> > didn't seem to make a difference. Workaround was to create a new package and
> > move classes into that. Didn't isolate theproblemso there might be other
> > factors involved here - like another Android project also depending on that
> > Java project.
>
> >> > >> > > I'm seeing exactly the sameproblemas Mark Carter.
>
> >> > >> > > I've followed the instructions on the reference pages exactly (at
> >> > >> > > least as far as I can make out). Theappproject compiles fine
> >> > >> > > > >> the library project and also theappproject. So doesn't
> >> > >> > > > >> this just
> >> > >> > > > >> result in a load of duplication? What if the activity is
> >> > >> > > > >> declared
> >> > >> > > > >> slightly differently in one to the other?
> >> > >> > > > >> 3. It would have been incredibly useful to allow library
> >> > >> > > > >> projects to
> >> > >> > > > >> reference each other. I'm curious as to why this is not
> >> > >> > > > >> possible...
> >> > >> > > > >> 4. If anappreferences both resources and code in a library
> >> > >> > > > >> project,
> >> > >> > > > >> then that library project needs to be added as both a
> >> > >> > > > >> library and a
> >> > >> > > > >> project in theapp'sbuild path (in eclipse at least) - why
> >> > >> > > > >> is this?
> >> > >> > > > >> 5. I'm considering subclassing library project
> >> > >> > > > >> activities/services in
> >> > >> > > > >> myappproject. Is there any reason not to do this?
> ...
>
> read more »
Re: Android Library Project Ratamovic 6/12/10 4:50 AM
Hi Xavier and all,

There is clearly some problems with project naming.
I usually name my projects with '-' (e.g. "Project-Lib") but that
doesn't work for my library unless I rename them (to "ProjectLib") and
restart my Eclipse. I also noticed that to create a link to a library
project, the library and application source folder Must be named
'src' (sadly I name them java since I work with the NDK...). I am not
sure weither it would work if my source folder was inside 'src' (e.g.
like 'src/java'). Also It is not working if your library src folder is
in fact an Eclipse folder link. I need a hard Linux symbolic link.
That would be really great to indicate these issues in the Android
manual page :)!

Regards.


On 5 juin, 22:56, Xavier Ducrohet <x...@android.com> wrote:
> How does your library project depend on the (standard?) java project?
>
> From the refactoring feature point of view, both projects are Java
> project (a library project, like normal Android project, is both Java
> and Android projects), so I'm not sure how it's the fault of the
> library feature?
> (Now, after participating in this thread a couple weeks back, I have
> been to busy to see if linked folders in Eclipse have poor refactoring
> support, so there may be issues there. I'll try that soon hopefully)
>
> Anytime you touch a java file in a some advanced way (renaming,
> moving, extracting, refactoring) the android plug-in does nothing,
> it's all the JDT.
>
> In the end, I think dealing with the pain of refactoring might be
> worth it if the library really provides benefit once the refactoring
> is done, since this should be a one time thing, but you're going to
> use your library many times in various projects (I would expect, or
> you wouldn't need the library in the first place)
>
> Xav
>
> On Fri, Jun 4, 2010 at 10:47 PM, Mark Carter <mjc1...@googlemail.com> wrote:
> > I had to abandon the Library Project approach in the end because I was
> > running into so many eclipse errors it was really slowing me down. This is
> > particularly true when refactoring - which, I suppose, is the first thing
> > people do when changing their code to use libraries.
> > For example, if your Library project depends on a Java project and you do
> > things like rename packages in that Java project, then eclipse would throw
> > up an error (unfortunately can't remember which one). Restarting eclipse
> > didn't seem to make a difference. Workaround was to create a new package and
> > move classes into that. Didn't isolate the problem so there might be other
> > factors involved here - like another Android project also depending on that
> > Java project.
>
> ...
>
> plus de détails »
Re: [android-developers] Re: Android Library Project Mark Carter 6/15/10 1:13 AM
On 5 June 2010 22:56, Xavier Ducrohet <x...@android.com> wrote:
How does your library project depend on the (standard?) java project?

Just a standard project dependency in the Java Build Path of the main Android project. It works fine when I'm not using Android Library projects.

I've been using shared Java projects for some time now and have had no problems with them at all. Its a real shame that there seems to be no way to specify an Android project in the build path because this would avoid all the problems lots of devs seem to be having by including it as a library.

Re: [android-developers] Re: Android Library Project Andrew Brampton 6/15/10 1:44 AM
I reported this the bug to do with the src directories:
http://code.google.com/p/android/issues/detail?id=8502
I was looking at fixing it myself but I failed to get the eclipse
plugin to compile so I gave up, admittedly without putting much effort
in.

Andrew

Re: [android-developers] Re: Android Library Project Xavier Ducrohet 6/15/10 10:09 AM
I just noticed the issue with '-' char.

The issue is that linked folder in Eclipse cannot be named with a -
char and we use the name of the project to make up the name of the
linked project.

I've fixed it for the next version to have the name of the linked
folder drop any '-' char from the project name.

As for 'src' vs. 'java' (or others), yes this is a current limitation
that I hope I can remove for the next version.

Xav

Re: Android Library Project Viktor Brešan 7/8/10 8:38 AM
I've lost whole day restarting eclipse, cleaning and rebuilding
projects just in order to make errors reporting missing class
references disappear. Without any success.

As I have projects divided in several working sets, I have a wild
guess that these working sets might cause problems as well.
Unfortunately, I have no time to explore this issue further.

Kind regards, Viktor.
Re: Android Library Project Vladimir Lebedev-Schmidthof 7/7/10 11:58 AM
Hello Mark,

I faced the same problem with attrs.xml in Library Project. Have you
finally found the solution?


On 23 май, 23:22, Mark Carter <mjc1...@googlemail.com> wrote:
> I'm sure that thelibrary.apk file error was because I had added thelibraryprojectto my appprojectbuild path.
>
> The other problem, where appprojectclasses could not seelibraryprojectclasses was due to something else.
>
> For some strange reason, even when the androidlibrarycompiles by
> itself (I mean, does not show any errors in eclipse), it can give
> compiler errors when used as alibraryin anotherproject. In that
> situation, it does not show up like "LibProject" in your png file.
>
> In my situation, this was caused by a problem with a custom widgets I
> had defined in mylibrary. The attrs.xml file was being ignored for
> some reason. Everything worked fine (i.e. the LibProject showed up as
> in your png file) when I removed those custom widget (I'm not talking
> about homescreen widgets)attributesfrom the relevant layout xml in
> thelibraryproject.
>
> Sorry all this is a bit vague. I'll try and come up with a clearer
> scenario but I'm right in the middle of something now.
Re: [android-developers] Re: Android Library Project Deborah 7/8/10 8:44 AM
Thanks for your reply! Don't worry, I will try to solve the problem ;)

I have not error in my progect, but when I run my application, in LogCat file, I obtain:

tag
dalvikvm 

Message
Could not find class 'org.apache.axis.client.
Service', referenced from ...

Regards,

Deborah
Re: [android-developers] Re: Android Library Project Mark Carter 7/9/10 11:13 AM
On 7 July 2010 20:58, Vladimir Lebedev-Schmidthof <dair...@gmail.com> wrote:
Hello Mark,

I faced the same problem with attrs.xml in Library Project. Have you
finally found the solution?

Sorry Vladimir - I stopped using the Library Project system I while ago - and never found a solution to that particular problem. 
Re: [android-developers] Re: Android Library Project Xavier Ducrohet 7/9/10 11:36 AM
Just to give an update to anyone still reading this thread.

The next version of ADT will include fixes for:
- Issue with the library needing to have a single source folder called
"src". Any number of source folder, of any name, even under other
folder (src/java).
- Issue with project name containing characters that aren't valid for
folder names.
- Libraries depending on libraries.

We've also made the link of the library source folders in the main
project much more robust.

By the way, we highly recommend to people using library projects in
Eclipse to set their workspace to automatically refresh.
This is due to Eclipse not realizing that the code inside the linked
folder (in the main app) is the same as the code in the library. Since
Eclipse considers them to be different, editing the code in one
location requires a refresh in the other location. Setting the
workspace to refresh automatically helps a lot.

Xav

> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-d...@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscribe@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

--
Xavier Ducrohet
Android SDK Tech Lead
Google Inc.

Please do not send me questions directly. Thanks!

Re: Android Library Project samspade79 7/20/10 10:40 PM
I was having similar problems to the others in this thread.
Removing the '-' character in my library project name (it was called
project-library) made the library instantly appear in the non library
project,

On Jul 9, 1:36 pm, Xavier Ducrohet <x...@android.com> wrote:
> Just to give an update to anyone still reading this thread.
>
> The next version of ADT will include fixes for:
> - Issue with the library needing to have a single source folder called
> "src". Any number of source folder, of any name, even under other
> folder (src/java).
> - Issue with project name containing characters that aren't valid for
> folder names.
> - Libraries depending on libraries.
>
> We've also made the link of the library source folders in the main
> project much more robust.
>
> By the way, we highly recommend to people using library projects in
> Eclipse to set their workspace to automatically refresh.
> This is due to Eclipse not realizing that the code inside the linked
> folder (in the main app) is the same as the code in the library. Since
> Eclipse considers them to be different, editing the code in one
> location requires a refresh in the other location. Setting the
> workspace to refresh automatically helps a lot.
>
> Xav
>
>
>
>
>
> On Fri, Jul 9, 2010 at 11:13 AM, Mark Carter <mjc1...@googlemail.com> wrote:
> > On 7 July 2010 20:58, Vladimir Lebedev-Schmidthof <dair....@gmail.com>
unk...@googlegroups.com 7/20/10 10:44 PM <This message has been deleted.>
unk...@googlegroups.com 7/20/10 10:48 PM <This message has been deleted.>
Re: Android Library Project Mica 8/3/10 1:59 PM
this is good news, do you know when next ver of ADT will be available
through Eclipse update?

On Jul 9, 2:36 pm, Xavier Ducrohet <x...@android.com> wrote:
> Just to give an update to anyone still reading this thread.
>
> The next version of ADT will include fixes for:
> - Issue with the library needing to have a single source folder called
> "src". Any number of source folder, of any name, even under other
> folder (src/java).
> - Issue with project name containing characters that aren't valid for
> folder names.
> - Libraries depending on libraries.
>
> We've also made the link of the library source folders in the main
> project much more robust.
>
> By the way, we highly recommend to people using library projects in
> Eclipse to set their workspace to automatically refresh.
> This is due to Eclipse not realizing that the code inside the linked
> folder (in the main app) is the same as the code in the library. Since
> Eclipse considers them to be different, editing the code in one
> location requires a refresh in the other location. Setting the
> workspace to refresh automatically helps a lot.
>
> Xav
>
>
>
>
>
> On Fri, Jul 9, 2010 at 11:13 AM, Mark Carter <mjc1...@googlemail.com> wrote:
> > On 7 July 2010 20:58, Vladimir Lebedev-Schmidthof <dair....@gmail.com>
Re: Android Library Project Christopher Perry 8/7/10 8:46 PM
I'm having this exact problem right now. Did you figure it out?

On Jul 7, 11:58 am, Vladimir Lebedev-Schmidthof <dair....@gmail.com>
wrote:
More topics »