After some deep digging in the Android Source code and the API documents, I finally found a method that can let me out of the Android SDK Bug. This is called: Resources.getIdentifier().

Previously, the problem I have that I can’t release the framework as a package is it must include the whole source as an Android library folder, which is not really a re-distributable solution (and keep in mind the source is changing quite often at this stage); and moreover, it will compile down the R in the library AS in the namespace of the target application, instead of the library! (As stated in the above bug). Instead of waiting for any fixes from Google, I can simply parse the raw XML attribute and retrieve the attribute using the above mentioned getIdentifier() method.

Whew, that means I have to look into the providers again and change the way they bind to the views! But this time, I’ll create a level of abstraction so that, in case, in the future Google did fixed that bug, I can switch back to that more-official way (and supposingly that will be faster since it is handled in native call, I found in the source code!)

After such big change, I think I could provide pre-alpha release of the framework as a downloadable .jar format.

Advertisements