How to access android resource in java native extension....??

hi..
i want access android resource..
for example, res/menu/menu.xml, res/values/strings.xml ... etc...
- R.java -
/* AUTO-GENERATED FILE.  DO NOT MODIFY.
* This class was automatically generated by the
* aapt tool from the resource data it found.  It
* should not be modified by hand.
package com.flash.extension.nativelib;
public final class R {
    public static final class attr {
    public static final class drawable {
        public static final int icon=0x7f020000;
        public static final int notification_icon=0x7f020001;
    public static final class layout {
        public static final int main=0x7f030000;
    public static final class string {
        public static final int extension_app_name=0x7f040001;    -> "hi extension"
        public static final int extension_hello=0x7f040000;
so i used getResourceId("string.extension_app_name");
but it's not work.. throw NotFoundException error..
so i used context.getString(R.string.extension_app_name);
it's work, but return incorrect value.. -> return value is "0.0.0".. it's versionName in actionScript Client Project..
why can't access android resource in native extension?
how to get android resource in java natvie extension..??
Is there anyone who has a sample source??
help.. me.. please..

Hello,
I am facing the same issue with the native extension i am using follwing code to get the resource id
         Intent inte = new Intent(context.getActivity().getApplicationContext(),SecondActivity.class);
          inte.putExtra("layout",context.getResourceId("layout.secondactivity"));
          context.getActivity().startActivity(inte);
i am getting this exception "android.content.res.Resources$NotFoundException:layout.secondactivity"
I have included activity in the native manifest file as well as flex's manifest file for android.
please help me with this or an example will be great thanks.

Similar Messages

  • How to access another resource in Groupwise

    Could anyone tell me or direct me to a sample of some code, that shows how to access another resource in Groupwise with VB.
    The main goal is to send a appointmentsfrom another resource by accessing this resource that you have authority from own mailaccount
    or from an account I have access to.
    This so far I have come:
    Dim objApp
    Dim objAccount As Account
    Dim objDraftMsg
    objApp = CreateObject("NovellGroupWareSession")
    ' objAccount = objAccount.ObjType.egwResource
    objAccount = objApp.Login("", "") 'My own account but want to access either the account that owns the resource or from my own
    ' objAccount = objApp.objtype.egwresource("Schema")
    objDraftMsg = objAccount.WorkFolder.Messages.Add("GW.MESSAGE.APP OINTMENT")
    Dim date1 As New Date(2013, 5, 2, 8, 30, 0)
    objDraftMsg.StartDate = date1
    objDraftMsg.Duration = 1.5 / 24 ' duration
    objDraftMsg.OnCalendar = True
    objDraftMsg.Subject.PlainText = "Testar schema" ' Subject
    objDraftMsg.BodyText.PlainText = "Hlsar Giggi" ' Body
    objDraftMsg.Recipients.Add("XX")
    objDraftMsg.Send()
    Thank you un advance
    Giggi

    On 4/30/2013 1:26 PM, giggi wrote:
    >
    > Could anyone tell me or direct me to a sample of some code, that shows
    > how to access another resource in Groupwise with VB.
    >
    > The main goal is to send a appointmentsfrom another resource by
    > accessing this resource that you have authority from own mailaccount
    >
    I don't have time to write code but as I recall you have to PROXY into
    the account. There's a proxy method IIRC that returns an Account from
    which you can send mail if you were granted rights to do so.

  • Access System Resources using Java Applet via Java Script

    Hello
    I can access my Applet public methods (and this methods access system resources) via Java Script if I do the following: System.setSecurityManager(null);However, I'm making this post because I don't like this solution.
    Supposedly, setting the SM to null is like making the Applet (which is signed and was accepted by the user via a prompt from the browser) behave like a normal Java program that has no restrictions. (http://java.sun.com/docs/books/tutorial/essential/environment/security.html, second paragraph)
    However, this feels like a workaround of something that is supposed to be there (the SM).
    Also, if I make the methods invocation from inside the applet (using swing buttons and textboxes for example) I can use the standard SM without no problems.
    From my readings, the problem regarding Java Script invocation, comes from the fact that the Java Script is not a secure (not signed) source (because you can invoke public methods the way you wish from it i guess) on the contrary to the applet methods invoked by the buttons.
    Possible solutions I found in the web range from using the public static Object doPrivileged(PrivilegedAction action) method or imaginative things like creating new threads on the public method that call the private methods that access the system resources (supposedly because the new thread runs under the safe environment of the applet)
    I almost got a glimpse of hope with this post http://forums.sun.com/thread.jspa?threadID=5325271&tstart=0
    However, none of these solutions worked, the only results were with the setResourceManager(null)So, any one can contribute with a solution for this? Should I keep trying to find a solution other then the one I already have?
    Regards
    Cad

    1. yes
    2. yes
    Note for 2. the converter will run the applet with SUN jre for sure if the user has IE.
    IE will use the ActiveX technology to run the applet (as with Macromedia Flash).
    For Netscape I am not sure, but I would think Netsape will use the plug in provided by
    SUN.
    Note for SUN jre 1.3. If this applet is to be used within a company that uses a proxy with
    ntlm authentication the 1.3 applet cannot connect (to the Internet) through this proxy since
    ntlm athentication is supported since j2re1.4.2_03. There is one version before that but
    that one will pop up a window asking for the user's domain account and password wich
    is both lame and crappy.
    As for the IE settings, IE has a default setting that askes users the "do you trust"
    queston for AciveX controls within the Internet securety zone (tools -> internet options
    -> security).
    Sincy anybody can make ActiveX controls (allso sign them) a user that has a problem
    to find the "no" button will sooner or later install a malicuous ActiveX control (spy ware
    or a virus).
    If this user's desktop is within your company's network it will cause serious harm.
    This is why most company's disable this by changing the default internet expolorer
    settings. Since I assume you are writhing this applet to be used by a company I allso
    assumed that company has someone to maintain the desktops. In that case I
    assume that person would want to control the security within the SUN jre instead of
    letting the user deside what to trust and what not.

  • How to use R.resource in Java from ANE?

    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;

    I don't think its a bug with AIR 3.5. I'm using FB 4.7 and the latest Eclipse for the native side and AIR 3.6 overlaid onto Apache Flex 4.9.1. I've created my .ane and my test app runs fine until I request a native side resource. I've unpacked the .ane and it all looks good - my resources are there. I'm making correct calls through context.getResourceId().
    Turns out I wasn't stepping back far enough. I next unpacked my apk, and low and behold, when FB packages it up it strips apart the .ane, throws away its resources, and bundles in new ones.
    Next step is to find out why. Going to see if Flash Pro CS6 builds bad apk's as well. If so, I suppose I'll try and find docs on adt and aapt and see if I can build batch files to build the apk's myself. Also need to clean my path of any adobe folders, and add the ones I need in the batch files to insure I'm not accessing stuff from an older SDK somewhere. And I'll also check against other SDK's - perhaps my overlay isn't working out like I'd first thought.

  • How to access system registry through java program

    Friends
    I have to access System registry of Windows 2000 by Java program. I don't know how to access the registry by using java code. Please help me. Else
    I want to create a setup file for my application. before setup my application i have to check whether the system has JVM or not. If its not then i have to install JVM first and then my application. so i need to access system registry. please give me a solution for this.
    Thanks in advance
    Ramesh

    I don't know how to access the registry
    by using java code. You can't, without using a native interface (JNI type) library.
    This is one, there are others, do a Google search:
    http://www.bayequities.com/tech/Products/jreg_key.shtml

  • How to access NTFS entries using Java

    I want to access and read the attributes of a file stored in the Master File Table of NTFS.
    How should I do it using Java. Is using native code and using JNI the only way or is there a package in Java that supports this?
    Thanks

    WebSphere Application Server has a bunch environmental variables such as log locations. These are held at the "server", "node", and "cell" level.
    To access them, you have to get the right context. Something like this, I believe...
    InitialContext initialContext = new InitialContext();
    initialContext.lookup("foo:bar/baz/blah"); //correct context hereGo to the IBM website for WAS and do a search on namespace bindings. That should give you some more information.
    Good luck.

  • How to access variables declared in java class file from jsp

    i have a java package which reads values from property file. i have imported the package.classname in jsp file and also i have created an object for the class file like
    classname object=new classname();
    now iam able to access only the methods defined in the class but not the variables. i have defined connection properties in class file.
    in jsp i need to use
    statement=con.createstatement(); but it shows variable not declared.
    con is declared in java class file.
    how to access the variables?
    thanks

    here is the code
    * testbean.java
    * Created on October 31, 2006, 12:14 PM
    package property;
    import java.beans.*;
    import java.io.Serializable;
    public class testbean extends Object implements Serializable {
    public String sampleProperty="test2";
        public String getSampleProperty() {
            return sampleProperty;
    }jsp file
    <%@ page contentType="text/html;charset=windows-1252"%>
    <%@ page import="java.sql.*,java.util.*"%>
    <html>
    <head>
    <title>Schedule Details</title>
    </head>
    <jsp:useBean id="ConProp" class="property.testbean"/>
    <body>
    Messge is : <jsp:getProperty name="msg" property="sampleProperty"/>
    <%
      out.println(ConProp.sampleProperty);
    %>
    </body>
    </html>out.println(ConProp.sampleProperty) prints null value.
    is this the right procedure to access bean variables
    thanks

  • How to access calendar rules via java

    Hi to all,
    We have a process in which we need to set a Timer, but the date must be validated against Calendar Rules. We searched in forums, webs, documentation and we couldn't find a way to do this.
    I know it is possible to set an expiration date based on Business Calendar on a Human Task (deadline tab in Human task editor), but this is not what we need.
    We actually need a way to set a variable date in the process that can handle only business days. e.g.: 'now' + 2 business days.
    Right now we are setting the Timers with this expression from a Business Rule: Duration.from string("PT48H")
    Then I associate the business rule output with a Time type variable(deadlineTime) doing: 'now' + deadlineTime
    So right after that I can use the Time variable on a timer attached to the human tasks I need. * We need to use business rules because the customer may want to change the times accordingly to their needs through BPM Composer. *
    The problem is that this solution does not take into account Saturday and Sundays (holidays are a concern too).
    We need to set the expiration time to timers attached to human tasks, but the time should consider working days only. We consulted with experts from Oracle and told us that functionality is available in the PS 6 version. At the moment it is impossible to migrate to that version. I need to know how to access via Java APIs to the calendar rules for checking programmatically.
    JDeveloper version: 11.1.1.6
    Any suggestion?
    Thanks in advance
    Marcelo

    Hi Yarner,
    Once you have all your dll included in a jar and used the nativelib tag, you have to use, at the beginning of you application, the command System.loadLibrary to load all the dll you need. Including the ones called by the others you have direct access.
    The dll�s have to be explicitly loaded in the order they are called.
    For example: you use lib1.dll and lib2.dll. The lib1.dll needs lib0.dll.
    Even if you don't use lib0.dll directly, once its called by lib1.dll you have to put then in the order.
    System.loadLibrary("lib0.dll");
    System.loadLibrary("lib1.dll");
    System.loadLibrary("lib2.dll");
    I hope it may help you, good luck.
    Mario

  • How to use foreground dispatch system of android NFC with AIR native extension?

    Hello,
    I'm developping an AIR application which invokes NFC on android, via AIR native extension (ANE).
    I would like to enable foreground dispatch system of NFC (see http://developer.android.com/guide/topics/nfc/advanced-nfc.html#foreground-dispatch), but unfortunately it has not been achieved so far.
    [Problem]
    For enabling foreground dispatch system of android NFC, we need to listen some android native events e.g.) Activity.onNewIntent(), Activity.onPause() and Activity.onResume(). But I have no idea how to dispatch them to ANE. Could anyone tell me how to get it?
    I know there is an available ANE for android NFC as follows:
    http://code.google.com/p/ane-lab/source/browse/#svn%2Ftrunk%2Fmobile%2Fandroid%2Fjava%2Fnf c1
    But it is not fit for our use case, as it just uses "intent dispatch system" (another way to use android NFC).
    Maybe AIR must be extended for this case, but any information is welcome.
    Thanks.

    Hello
    My name is Sadao Tokuyama.(http://twitter.com/tokufxug)
    Is the person who is to manage the sample code in experimental AIR
    Native Extension.
    If you want to achieve the de-patch system foreground NFC, it is
    necessary to consider the following points.
    1.Create FREFunction for initial processing. processing of onCreate.
    2.can be obtained in onResume Event.ACTIVATE. After issuing
    Event.ACTIVATE, call the FREFunction to run in onResume.
    3.can be obtained in onPause Event.DEACTIVATE. After issuing
    Event.DEACTIVATE, call the FREFunction to run in onPause.
    4.onNewIntent can be obtained at InvokeEvent.INVOKE. After issuing
    InvokeEvent.INVOKE, call the FREFunction to run onNewIntent.(Gets the
    Intent of the scanned NFC. : FREContext.getActivity().getIntent())
    I have committed the sample code. Your reference.
    http://code.google.com/p/ane-lab/source/browse/#svn%2Ftrunk%2Fmobile%2Fandroid%2Fjava%2Fnf c-foreground-dispatch
    Thanks.

  • How to access assemly code in java

    dear i want to access assembly code in java . plz help me. thanx.

    Assembly, C, C++, Fortran, etc. can be accessed most directly via the Java JNI facility. For assembly, you'll have to write a native C/C++ layer to accept the JNI call and forward it to the assembly code. If the assembly code is C-callable (i.e. it conforms to the C calling conventions on your platform) then the job is really no more difficult that calling any C routine.
    Chuck

  • How to access Android Market with OS 2.0.0.7971

    It is not obvious to me how to access the Android Market with the latest Playbook software update.  Would someone please enlighten me?

    There is no access to the full Android Marketplace, instead, developers repackage their android apps and submit them to Blackberry's App World. So to the end user, there is no difference between an android app and a true blackberry app.

  • How to access vc dll with java

    I need to access vc dll with java. Now I only have *.h,*.lib, *.dll,no *.cpp,because the dll is from others. I cann't modify the *.cpp files for java. so what should I do .
    Best wishes.

    Create a JNI wrapper for rhe dll:
    1)Create a java class that defines methods that correspond to the methds in the c++ dll
    2)compile this, and compile it with the jni compiler to get the c++ header files.
    3)Create a C++ file that implements the methods defined in the header file, calling the c++ code as necesssary and using the JNI helpess to translate parameters from java form to C++ from.
    4)Perform any initialisation of th c++ dll by adding a DllMain() or equivalent under unix/linux
    5)create a makefile to build a dll from the above, linking to your import (.lib) library
    6)make sure both DLLs are with your java class files when you run the java app.

  • How to access sharepoint logs using Java?

    Is there a way to access Sharepoint logs using Java from a remote machine? 
    Any help / pointers would be appreciated. Thanks.

    Hello,
    I am not aware about any client modal class for log but if you create your own service and host in SP server then you can call this web service in JAVA. (i am not sure whether JAVA supports .NET web service or not).
    You can refer this for web service:
    http://www.arboundy.com/2010/12/centalised-view-of-sharepoint-uls-log-files/
    Hope it could help
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • How to access Websphere variables using java

    Hi
    I want to access Websphere variables using java.
    Any help is appreciated!!
    Thanks
    P

    WebSphere Application Server has a bunch environmental variables such as log locations. These are held at the "server", "node", and "cell" level.
    To access them, you have to get the right context. Something like this, I believe...
    InitialContext initialContext = new InitialContext();
    initialContext.lookup("foo:bar/baz/blah"); //correct context hereGo to the IBM website for WAS and do a search on namespace bindings. That should give you some more information.
    Good luck.

  • Including resources in your native extension package

    This question was posted in response to the following article: http://help.adobe.com/en_US/air/extensions/WSf268776665d7970d-2e74ffb4130044f3619-7ff8.htm l

    Hey,
    It's fairly simple, once you find out how to search the resource tree. We wrote some code to do it which I've just put up here: http://labs.distriqt.com/post/1245
    Once you grab the class there you should be able to access the application resources wherever your code is executed:
    int iconId = Resources.getResourceIdByName( context.getPackageName(), "drawable", "icon" );
    Cheers,
    Michael

Maybe you are looking for

  • Toggling an Image attached to an Item using Javascript

    Hi, Hoping someone can assist, I have the following html in the Post Element section of a page item, i.e: NOTE: I have had to remove angle brackets - can't seem to get the formatting right. td colspan="1" rowspan="1" align="top" onClick="getMAGDets()

  • Proxy settings in NWDS 7.1 EHP1 for accessing ES workplace

    hi I have done the service registry settings in NWDS to access the ES workplace.  i have selected the option "direct connection to internet" in the general-> network connections settings.when i am working from my home this is working fine. but the sa

  • Problems while applying Manifest Patch on Linux - 11.5.10 CU2

    Hi, We're migrating our Application Tier (11.5.10 CU2) from HP-UX 11.23 to Linux RedHat 5 (32 Bits). While applying Manifest Patch , I've got the the following Error Messages : Starting link of rg executable 'RGSSRQ' on Wed Jan 12 16:21:41 IST 2011 g

  • My iMac takes 15 minutes to start up

    My iMac is taking 15 minutes to start up.  I have tried starting in Safe Mode and it is still the same.

  • The 3 new blurs in CS6 no longer work properly

    There used to be a circle onscreen that you could turn to change the amount of blur. And there were lines and or oval areas that could be made bigger or smaller to influence the area of blur. And while there are still pins that can still be placed to