Quantcast
Channel: Adobe Community : Popular Discussions - Archived Discussions
Viewing all articles
Browse latest Browse all 21156

How to use R.resource in Java from ANE?

$
0
0

Hello,everyone,sorry for my poor English..

I want to ask "What is the appropriate way to manage resource in ANE"??

 

I have exported jar-library,and made ANE then called from Air Mobile.

(I check include-resource-option when I export from eclipse.)

When I debug on device,it seems that the Java's R.resource is overrided by R.resource air made.

 

Forexample,I have added FREFunction returns resource-value.

If I refer and display string.app_name,It shows string.app_name of Air-Project's.

After I added string.test to resouce in Java,and display it in Air,there is no value.

 

What is the appropriate way to manage resource in ANE.

 

Reference:

http://www.adobe.com/devnet/air/native-extensions-for-air/extensions/vibration.html

 

 

public class Native_xxxxxxx implements FREFunction {

 

    private Resources res;

 

    public FREObject call(FREContext arg0, FREObject[] arg1) {

 

        try {

 

            Activity activity = arg0.getActivity();

 

            res = activity.getResources();

 

            return FREObject.newObject(res.getString(arg0.getResourceId("string.app_name ")));

 

            //return FREObject.newObject(res.getString(arg0.getResourceId("string.test"))) ;

 

            //return FREObject.newObject(res.getString(R.string.test));

 

        } catch ( Exception ex ) {

 

        }

        return null;

 

    }

 

}


Viewing all articles
Browse latest Browse all 21156

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>