The Eclipse plugin source code is available.  If you are familar with
RCP development, import this plugin into Eclipse.  The plugin monitors
resources in projects that have an Android nature and will regenerate
the R file whenever a change is made to res/ folder resources.  I
think in order for you to achieve what you want, you will have to add
a custom eclipse nature to your project (that the autogenerator plugin
will look for -- currently it will look for Android nature and that is
not what you want).   Customize the plugin to generate the R file.
You will also have to write a layer that does the actual resource
loading.  Android creates a binary format of everything in the res
directory that then gets shoved into the .apk.  You will have to write
a layer that actually retrieves the Image or String that application
code can then call like the sample api below:

Resource.getImage(R.drawable.youImage);
Resource.getString(R.string.sampleString);

Its a good idea that you have.  I don't think it would be terribly
hard to do what you are trying to achieve.  I do agree that the
generation of a static class that can be referenced in application
code is nice (removes the dependencies on mistyping) and makes
resource loading such as images a synch.

Good luck.

Nik



On May 20, 7:00 am, Johan de Koning <[EMAIL PROTECTED]> wrote:
> I really like the R.java file as reference to the resource strings
> (arrays etc) inside the XML files. This way i can check easily if
> resources are not used (because Eclipse will underline those which are
> not used).
>
> Does somebody know if it also possible (with the use of a plugin) to
> use this resource structure inside a java application (normal java
> application or based on Eclipse Rich Client Platform). Or is the
> source available of the Android plugins, to develop a plugin by my own?
--~--~---------~--~----~------------~-------~--~----~
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]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to