I am trying to use dateslider in my android project to have a combined time set to pick a date in my gui.
The authors of the widget suggest including java and resource sources directly in my application.
First attempt to copy java and resources to the main application:
Result: The widget java classes cannot compile because the Rxxxx resource cannot be resolved.
Reason: Widget classes are implemented in the package "com.googlecode.android.widgets.DateSlider" and my application has a different namespace "my.namespace.myApp", so resources come from my.namespace.myApp.R.xxx.
To fix , I would have to touch each source of the javas widget to import my.namespace.myApp.
Is there a way to have 2 sets of resources with different namespaces so that my.namespace.myApp.R.xxx and com.googlecode.android.widgets.DateSlider.R are in the main application?
The second attempt to put the java + resources widget in a separate jar / library:
result: all compiled. but after appstart i get runtimererror: runtime cannot resolve widget resource ids from jar / lib.
Note. I can call methods from the bank if they do not need resources.
So my question is: what is the best way to use a reusable gui element with resources in android?
I am using android 2.2.
Note: Android: how do I create reusable components? doesn't help, because it tells you how to create library projects.
update 16.3.2012
Since the current version of 16/17-pre from eclipse adt-tools does not support jar resources (like from try 2), what is the best / easiest way to use them until there is support for this?
update 4.4.2012
With the new R17 tools, I was able to use library projects with the resources that the bank creates. Android-Lint helped me find out what needs to be changed in lib to make it usable.
However, I still can not use only DateSliberlib.jar
This parameter can be compiled, but the application crashes because it cannot find lib resources.
[update 2014-11-17]
6 months ago, I switched from eclipse / ant -build to the android-studio / gradle assembly, which included * .aar files, which are jar files with android resources.
android-studio / gradle build can handle resources in libs.