I have been working on how to access the 3rd-party-jar-bundled resource files ( xml files, images , referred here ) from an android module. Is it possible to do this?
Because these resource files are called by the compiled-3rd-party jar files, which means, I am not able to use TiRHelper.getApplicationResource
method in the native java code unless I:
- de-compile the jar files to java code.
- replace all the native resource reference to TiRHelper.getApplicationResource
- re-compile the 3rd-party java source code to jar file.
(This third party project is https://github.com/ShareSDKPlatform/ShareSDK-for-Android/tree/master/Sample, I can easily compile & run it. You can see there are resource files in /res folder, and one of the jar files used these resource files. )
I searched a whole day but found no answer.
I got some clues from the official document , tried but not success. the error show that the resource is not accessbile by the java code from titanium module.
also, this same question( http://developer.appcelerator.com/question/178857/unable-to-load-resources-from-3rd-party-librarys-resourced-in-android-module ) is not answered.
this answer( http://developer.appcelerator.com/question/49671/android-r-references-in-appcelerator-module#answer-266726 ) gives me a clue that the methods:
getResource() gives an Error
getAndroidResource() gives an Error
but getApplicationResource() DOES work
and there is a clue that the 'apklib' may be useful, but after read some posts, I found it has been deleted from maven official website. and now Google recommends use 'aar' file instead. But according to this Titanium official issue (https://jira.appcelerator.org/browse/TIMOB-18565 ), it is not supported by titanium yet.
so, I want to know, is it possible to let the java code ( e.g. an activity) access its 3rd-party-jar-bundled resource files ( value/string.xml or so ) from Titanium module? if so, is there any sample code that I can refer to?
thank a lot!
android/res
folder of a native android project. I have found the answer. anyway, thanks for your attention! – Aside