Call APP_TYPE_CAMERA on 4.5 os RuntimeException

try {
    Invoke.invokeApplication(Invoke.APP_TYPE_CAMERA, new CameraArguments());
} catch (Exception e) {
    Dialog.inform("Could not start camera.");
}

Hello!

Such a code, I try to start on 4.5 JDE (8700g Simulator).

EI As RuntimeException exception with message: could not start...

and Simulator not having a native camera.

How will I know programmatically, on my device unsupported?

(class Invoke supported since 4.0.0 and APP_TYPE_CAMERA since 4.2.0)

Thanks in advance

Use the DeviceInfo.hasCamera () method

Tags: BlackBerry Developers

Similar Questions

  • Error in the instance of SIDES-RMS: cannot call method returnTypes MBean

    Summary of the problem
    ---------------------------------------------------
    Error in the instance of SIDES-RMS: cannot call method returnTypes MBean

    Description of the problem
    ---------------------------------------------------
    By clicking on the "card Manager", you get the following error:

    Application exception: java.lang.Exception: cannot call MBean method returnTypes... at com.retek.rib.management.adapters.model.AdapterTypes.getAdapterTypesList (AdapterTypes.java: 161) at com.retek.rib.management.adapters.model.AdapterTypes.getAllAdapterTypes (AdapterTypes.java: 185) to side_adapter__manager._jspService (_rib__adapter__manager.java: 130) to com.orionserver.http.OrionHttpJspPage.service (OrionHttpJspPage.java: 59) at oracle.jsp.runtimev2.JspPageTable.service (JspPageTable.java: 462) to oracle.jsp.runtimev2.JspServlet. internalService (JspServlet.java: 594) at oracle.jsp.runtimev2.JspServlet.service (JspServlet.java: 518) at javax.servlet.http.HttpServlet.service (HttpServlet.java: 856) to the com.evermind.server.http. ServletRequestDispatcher.invoke (ServletRequestDispatcher.java: 713) at com.evermind.server.http.ServletRequestDispatcher.forwardInternal (ServletRequestDispatcher.java: 370) at com.evermind.server.http.HttpRequestHandler.doProcessRequest (HttpRequestHandler.java: 871) at com.evermind.server.http.HttpRequestHandler.processRequest (HttpRequestHandler.java: 453) at com.evermind.server.http.AJPRequestHandler.run (AJPRequestHandler.java: 313) to com.evermind.server.http.AJPRequestHandler.run (AJPRequestHandler.java: 199) to $ oracle.oc4j.network.ServerSocketReadHandler SafeRunnable.run (ServerSocketReadHandler.java: 260) at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket (ServerSocketAcceptHandler.java: 234) to oracle.oc4j.network.ServerSocketAcceptHandler. access to $700 (ServerSocketAcceptHandler.java: 29) to at java.lang.Thread.run (Thread.java: 595)

    System Exception message: java.lang.Exception: cannot call method returnTypes MBean...

    We followed the steps described in the article "Unable to change" orion-ejb - jar.xml "and get Exception of application while Adapters tab by clicking [ID 739489.1]" without positive results.

    What happens in our test environment. In addition to the steps described in the article "Unable to change" orion-ejb - jar.xml "and get Exception of application while Adapters tab by clicking [739489.1 ID]", we tried to cancel their deployment and SIDES reploy but got no positive results.

    From Management.rib.log:

    2013-05-03 12:20:40, 355 DEBUG [Timer-7] org.apache.commons.beanutils.BeanUtils - copyProperty (com.retek.rib.j2ee.ErrorHospitalRetryTimerTask @1d00beb, used, SUB)
    2013-05-03 12:20:40, 360 [Timer-7] ERROR com.retek.rib.j2ee.TimerAdapterCaller - could not start timer sub_hosp_0
    java.lang.IllegalArgumentException: no positive period.
    at java.util.Timer.schedule(Timer.java:221)
    at com.retek.rib.j2ee.TimerAdapterCaller.startTimer(TimerAdapterCaller.java:126)
    at com.retek.rib.management.adapters.mbeans.external.levels.adapters.AbstractTimerAdapterMgmtBean.start(AbstractTimerAdapterMgmtBean.java:236)
    at com.retek.rib.j2ee.ManagedAdaptersFactory.getTimerDrivenElements(ManagedAdaptersFactory.java:611)
    at com.retek.rib.j2ee.ManagedAdaptersFactory.getHospMBeans(ManagedAdaptersFactory.java:197)
    to com.retek.rib.monitor.engine.MBeanRegisterServletContextListener$ 1.run(MBeanRegisterServletContextListener.java:94)
    at java.util.TimerThread.mainLoop(Timer.java:512)
    at java.util.TimerThread.run(Timer.java:462)
    2013-05-03 12:20:40, 365 [Timer-7] com.retek.rib.alert.Alert DEBUG - $Header: /cvs/Integration/RIB/Rib_Support/src/com/retek/rib/alert/Alert.java,v 1.6 2007-04-16 03:45:28 dikshih Exp $
    2013-05-03 12:20:40, 377 [Timer-7] DEBUG com.retek.rib.util.RibProperties - value (com.retek.rib.alert.impl.EmailAlertPublisher, com.retek.rib.alert.impl.JmxAlertPublisher) of key property (alertPublisherImpl).
    2013-05-03 12:20:40, 393 [Timer-7] DEBUG com.retek.rib.util.RibProperties - value (cmcasarrayp01) of key property (mail.smtp.host).
    2013-05-03 12:20:40, 393 [Timer-7] com.retek.rib.util.RibProperties DEBUG - value (25) key (mail.smtp.port) of property.
    2013-05-03 12:20:40, 394 [Timer-7] DEBUG com.retek.rib.util.RibProperties - value of property key (mail.smtp.from) ([email protected]).
    2013-05-03 12:20:40, 394 [Timer-7] DEBUG com.retek.rib.util.RibProperties - value of the property key (mail.smtp.to.list) ([email protected], [email protected]).
    2013-05-03 12:20:40, 395 [Timer-7] com.retek.rib.alert.AlertPublisherFactory - the following implementation of AlertPublisher DEBUG has been defined in sides - system.properties and will be used: com.retek.rib.alert.impl.EmailAlertPublisher
    2013-05-03 12:20:40, 397 [Timer-7] com.retek.rib.alert.AlertPublisherFactory - the following implementation of AlertPublisher DEBUG has been defined in sides - system.properties and will be used: com.retek.rib.alert.impl.JmxAlertPublisher
    2013-05-03 12:20:40, 397 [Timer-7] com.retek.rib.alert.impl.EmailAlertPublisher DEBUG - $Header: /cvs/Integration/RIB/Rib_Support/src/com/retek/rib/alert/impl/EmailAlertPublisher.java,v 1.7 2008-02-15 22:29:44 borapra Exp $
    2013-05-03 12:20:40, 398 [Timer-7] com.retek.rib.alert.impl.JmxAlertPublisher DEBUG - $Header: /cvs/Integration/RIB/Rib_Support/src/com/retek/rib/alert/impl/JmxAlertPublisher.java,v 1.3 2007/04/16 03:38:37 dikshih Exp $
    2013-05-03 12:20:40, 399 [Timer-7] DEBUG com.retek.rib.alert.AlertPublisherFactory$ AlertPublisherProxy - method invocation in AlertPublisher com.retek.rib.alert.impl.EmailAlertPublisher of implementation
    2013-05-03 12:20:40, 399 [Timer-7] com.retek.rib.alert.impl.EmailAlertPublisher DEBUG - trying to send by e-mail to [email protected], [email protected]
    2013-05-03 12:20:41, 820 [Timer-7] ERROR com.retek.rib.alert.impl.EmailAlertPublisher - send e-mail to [email protected], [email protected]
    2013-05-03 12:20:41, 822 [Timer-7] DEBUG com.retek.rib.alert.AlertPublisherFactory$ AlertPublisherProxy - method invocation in AlertPublisher com.retek.rib.alert.impl.JmxAlertPublisher of implementation
    2013-05-03 12:20:41, 823 com.retek.rib.management.adapters.mbeans.external.levels.adapters.AbstractTimerAdapterMgmtBean [Timer-7] ERROR - cannot call the start-up operation
    java.lang.IllegalArgumentException: no positive period.
    at java.util.Timer.schedule(Timer.java:221)
    at com.retek.rib.j2ee.TimerAdapterCaller.startTimer(TimerAdapterCaller.java:126)
    at com.retek.rib.management.adapters.mbeans.external.levels.adapters.AbstractTimerAdapterMgmtBean.start(AbstractTimerAdapterMgmtBean.java:236)
    at com.retek.rib.j2ee.ManagedAdaptersFactory.getTimerDrivenElements(ManagedAdaptersFactory.java:611)
    at com.retek.rib.j2ee.ManagedAdaptersFactory.getHospMBeans(ManagedAdaptersFactory.java:197)
    to com.retek.rib.monitor.engine.MBeanRegisterServletContextListener$ 1.run(MBeanRegisterServletContextListener.java:94)
    at java.util.TimerThread.mainLoop(Timer.java:512)
    at java.util.TimerThread.run(Timer.java:462)
    2013-05-03 12:20:41, 824 [Timer-7] com.retek.rib.monitor.mbeans.DynamicMBeanBase DEBUG - check if the notification is enabled for com.oracle.rib.rib - rms.sub_hosp_0.runtimeState.failed
    2013-05-03 12:20:41, 825 [Timer-7] ERROR com.retek.rib.j2ee.ManagedAdaptersFactory - no positive period.
    2013-05-03 12:20:41, 825 [Timer-7] ERROR com.retek.rib.monitor.engine.MBeanRegisterServletContextListener$ 1 - cannot call ManagedAdaptersFactory sign up.
    java.lang.RuntimeException: no positive period.
    at com.retek.rib.j2ee.ManagedAdaptersFactory.getTimerDrivenElements(ManagedAdaptersFactory.java:615)
    at com.retek.rib.j2ee.ManagedAdaptersFactory.getHospMBeans(ManagedAdaptersFactory.java:197)
    to com.retek.rib.monitor.engine.MBeanRegisterServletContextListener$ 1.run(MBeanRegisterServletContextListener.java:94)
    at java.util.TimerThread.mainLoop(Timer.java:512)
    at java.util.TimerThread.run(Timer.java:462)
    Caused by: java.lang.IllegalArgumentException: no positive period.
    at java.util.Timer.schedule(Timer.java:221)
    at com.retek.rib.j2ee.TimerAdapterCaller.startTimer(TimerAdapterCaller.java:126)
    at com.retek.rib.management.adapters.mbeans.external.levels.adapters.AbstractTimerAdapterMgmtBean.start(AbstractTimerAdapterMgmtBean.java:236)
    at com.retek.rib.j2ee.ManagedAdaptersFactory.getTimerDrivenElements(ManagedAdaptersFactory.java:611)
    ... 4 more
    2013-05-03 13:44:28, 947 DEBUG [UnDeployerRunnable Thread for sides-rms] com.retek.rib.monitor.engine.MBeanRegisterServletContextListener - contextDestroyed start.

    2013-05-03 12:20:40, 355 DEBUG [Timer-7] org.apache.commons.beanutils.BeanUtils - copyProperty (com.retek.rib.j2ee.ErrorHospitalRetryTimerTask @1d00beb, used, SUB)
    2013-05-03 12:20:40, 360 [Timer-7] ERROR com.retek.rib.j2ee.TimerAdapterCaller - could not start timer sub_hosp_0
    java.lang.IllegalArgumentException: no positive period.

    Looks like you have a typing error in the configuration of the rib-rms - adapters.xml, check in your $RIB_HOME/application-Assembly-home/side-rms.

    Should look like this, if it does, check the items before and after and see if you have errors. You can compare with the file from another environment where the error occurs and make a diff to see what is different.







  • Problem with 'Invoke.invokeApplication' on 7.1 OS later

    We find that problems with:

    Invoke.invokeApplication(Invoke.APP_TYPE_PHONE, call);
    

    throw

    java.lang.RuntimeException:Could not start internal application
    

    on 7.1 OSes such as 7.1.0.1098 and especially on a variety of devices * when the device is locked password (but not when locked screen).  We have seen this on earlier versions of 7.1 (such as 7.1.0.821 and below).  I see no changes documented between for example invoke 7.0.0 and 7.1.0 - anyone any idea?

    * including 9320, 9360 and 9790

    Which seems to be the case, this is the option "Allow outgoing calls so that locked" (in the Options / security / password), which was just a way to allow users to launch manual calls for password locked screen, now also applies to applications as well.  Definition of this indicator in options (assuming that you are not prevented to do so by BES policy) allows applications to make calls when the password locked again.

  • java.lang.RuntimeException called by the event no thread

    Hi all

    Please help me.

    I download my application Suiloidi OTA. When I have my application rum, it throws an error "untrapped Exception: java.lang.RuntimeException called by the event no thread", please let me know if anyone with no work around for this problem.

    I'm really in trouble.

    Ashutosh

    Thank you

    I got a d solution.

    Your steps were correct.

  • java.lang.RuntimeException:pushModalScreen called by a thread of non-event

    I am trying to alert the message using Dialog.alert (). The following exception comes

    java.lang.RuntimeExceptionushModalScreen called by a thread of non-event

    When this error comes and what scenario?

    Thank you

    Bala

    you don't know. You can find the details in the developer's guide.

    However a short explanation:
    all user interface work is performed in a separate thread, the thread of the event.
    If you do something in the user interface, for example in the display method, the instance is already on the thread of the event.
    If you do something outdoors, for example in a separate thread, you must place your changes on the thread of the event.
    only the thread the event is allowed to change the user interface.

  • Error 104 when call pushscreen

    Hi all

    I am a beginner with RIM API, and I am developing a small application with Eclipse.

    In fact, I have a 'class hand screen', which shows my home screen, no problem for it.

    I have a button when I click on, it displays a menu with many items, I would like that this element (called 'send') show me a new screen, simply. Yes, it's simple I know but I ' v still a real problem with one exception and I don't understand why...

    Here, the function in my 'main' class who attempts to call one method from another class

    public boolean onSend(){
    
    testecran te = new testecran();
    te.affiche();
    return true
    

    and there, my class 'testecran '.

    public class testecran extends UiApplication {
    
            public void affiche() {
    
                testecran theApp = new testecran();
                theApp.enterEventDispatcher();
    
                };
    
                public  testecran(){
    
                    pushScreen(new UserInterscreen());
                }
    
        }
    
        final class UserInterscreen extends MainScreen{
    
            HorizontalFieldManager _fieldManagerTop;
            VerticalFieldManager _fieldManagerMiddle;
            HorizontalFieldManager _fieldManagerBottom;
            BitmapField _bitmap;
            Bitmap _logoImage;
            BasicEditField _input;
            int displayed = 0;
    
            public UserInterscreen() {
            super();
            LabelField title = new LabelField("Welcome",
            LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH);
            setTitle(title);
    
            }}
    

    I tried to call an alert of dialogue and it is work... then there is a problem with my "pushscreen" function, I think...

    When I try to run in the Simulator, when I click on my question, in my menu, i ' v this error exactly:

    App error 104

    Eception: RuntimeException

    After many changes, I don't know why it does not work...

    Like SImon, I'm confused by the code you are using.

    I'm working on writing some tutorials designed to initiate people in the development of Java on the BlackBerry.  Attached are the first two (in fact, there is an introduction one but you don't need that).  Remember that they have not officially reviewed by anyone yet so treat with caution.  But I hope that you find them useful and they explain some of the concepts that you seem to be missing.

    At least, I think they will help.

    Please read, review and comment on tutorials and if they answer your questions.

    See you soon

    Edit:

    Attachments deleted.  I hope I can publish soon.

  • Cannot call ESC key two times of the key event

    Hello, this is my second post here...

    lately im trying to call the camera application via:

    UiApplication.getUiApplication () .addFileSystemJournalListener (new fileJournal());
    Invoke.invokeApplication (Invoke.APP_TYPE_CAMERA, new CameraArguments());

    and when the user to take a photo, then the application will grab the location of the file and close the camera application. but when I try to close the camera application using:

    Inject the EventInjector.KeyEvent = new EventInjector.KeyEvent (EventInjector.KeyEvent.KEY_DOWN, Characters.ESCAPE, 0);
    Inject.post ();

    Inject.post ();

    Simply call the inject.post () once and jump down (when I tried it on a simulator its works well but when I tried it on gemini 8520 is not working as the Simulator). I put the inject.post () at the end of my FileSystemJournalListener class.

    is there anyone who can help me please, thank you

    I had to use it to simulate the copy / paste before, it is what I did to get permission to use:

    ApplicationPermissionsManager apm = ApplicationPermissionsManager.getInstance();
    ApplicationPermissions ap = new ApplicationPermissions();
    
    if(apm.getPermission(ApplicationPermissions.PERMISSION_INPUT_SIMULATION) == ApplicationPermissions.VALUE_DENY) {
         ap.addPermission(ApplicationPermissions.PERMISSION_INPUT_SIMULATION);
        ReasonProvider rp = new ReasonProvider() {
            public String getMessage(int permissionID) {
                if(permissionID == ApplicationPermissions.PERMISSION_INPUT_SIMULATION) {
                    return "";
                }
    
                return null;
            }
        };
        try{
            apm.addReasonProvider(ApplicationDescriptor.currentApplicationDescriptor(), rp);
    
        }
        catch(IllegalArgumentException e) {
    
        }
    
        apm.invokePermissionsRequest(ap);
    }
    
  • Call Dialog.ask in the Thread Run method

    "in I want to call Dialog.alert and using following code but its exception to throw the wire.

    "Exception occurs java.lang.RuntimeException: pushModalScreen called by a thread of non-event."

    synchronized (Application.getEventLock ())

    {

    if (Dialog.ask ("catalog is obsolete. You want to keep it? ", choices, select, select [0])(==1)"

    {

    Run the required functionality

    }

    }

    pls help me

    I keep saying this, so forgive me of repeating myself, but:

    synchronized (Application.getEventLock ()) {}

    should only be used when nothing else will work for you or you make a very simple, very fast UI update.

    A Dialog.ask is not very fast!

    In this case, you have several options, but the most obvious solution is to ask the question before starting the Thread.  So, if that is your treatment

    Thread catUpdateThread = new Thread() {}

    public void run() {}

    Dialog.ask (...)

    Other treatments

    }

    }

    catUpdateThread.start ();

    What should do the same and works OK. :

    UiApplication.getUiApplication.invokelater (new Runnable() {}

    public void run() {}

    Dialog.ask (...)

    If (result == Yes) {}

    Thread catUpdateThread =...;

    catUpdateThread... Start();

    }

    }

    });

  • Odd screens RuntimeException

    Using Eclipse, targeting devices and better 8330, OS 4.5 & better...

    import java.util.Vector;
    import net.rim.device.api.ui.UiApplication;
    
    public class ScreensApp extends UiApplication {
    
        public static Vector screenV;
    
        public ScreensApp() {
            screenV = new Vector();
            pushScreen( new Screens2() );
        }
        /**
         * @param args
         */
        public static void main(String[] args) {
            // TODO Auto-generated method stub
            ScreensApp app = new ScreensApp( );
            app.enterEventDispatcher(); //point of no return
        }
    
    }
    
    import net.rim.device.api.ui.component.Dialog;
    import net.rim.device.api.ui.component.LabelField;
    import net.rim.device.api.ui.container.MainScreen;
    
    public class Screens2 extends MainScreen {
    
            public Screens2() {
    
                if (ScreensApp.screenV.isEmpty()) {
                    try {
                        Dialog.alert("screenV is empty!");
                    } catch ( RuntimeException e) {
                        System.out.println(  e.toString() );
                    }
                }
    
                LabelField label = new LabelField( "screens2 label" );
                add( label );
    
            }
    }
    

    These two classes are the essence of a problem, in that I am running.  I'm developing a simple, single-threaded (no requirement of network) application. The dialog box throws a RuntimeException [1], and I don't know why.  As Screens2 is pushed in the screen of ScreensApp stack and not running in parallel with ScreensApp, I thought he had run on the thread of the event and I wouldn't need to use invokelater or syncronize to get alert dialog to display.  If it's wrong, can someone please explain why (and how) that became a multi-threaded application (or whatever else happens to cause the RuntimeException)? Thank you in advance!

    [1] the error is "java.lang.RuntimeException: pushModalScreen called by a thread of non-event."

    Your problem is that you are trying to instantiate a modal dialog (your alert dialog box) to the constructor of the class Screens2. At the time when this constructor is running, the application has not yet entered the event dispatcher.

    The app is not in the dispatcher of events up to this after the Screens2 object is instantiated.  Get rid of the Dialog.alert here in the constructor.

  • Runtime Exception to when calling ApplicationEntryPoint.run ()?

    Hi Iam using JDE 4.5.0, jdk 1.6

    At the opening of the app in the Simulator iam getting error below in the debug window. And it's show RuntimeException occurs when calling ApplicationEntryPoint.run (). below the class implements ComponentVO Persistable.

    Class 'com.adea.blackberry.ComponentVO' multiply defined. Error starting zawyademo: 'com.adea.blackberry.ComponentVO' multiply defined class.

    Please help me I hit here.

    Concerning

    Sunil.G

    You have this class defined more than once in your applications or libraries?  I recommend also clean.bat running in the directory of Simulator to reset the BlackBerry Simulator returns to its default state.  This will remove all the applications and could clean up old libraries that you use no more.

  • Timer task - throws RunTimeException

    In my application, I need to verify a method returning a Boolean value (this method connects to a Web using Httpconnection service method). I used the timer and TimerTask, but RuntimeException is thrown and the timer is automatically cancelled. I plan in the constructor like this

    timer =  new Timer();
    timer.schedule(new checkConnection(), 180000, 180000);
    

    In every 3 minutes, I get a message stating the return value of the web service method.

    private class checkConnection extends TimerTask
    {
        public checkConnection()
        {
        }
    
        public void run()
        {
           if(checkWebConnection(Login.strTechCode, Login.strTechPin))
          Status.show("Connection Exists");
           else Status.show("Connection Lost");
        }
    }
    

    After the delay, it shows JVM error 104 Eception: RuntimeException. I commented on the fi and other parts in the run method, but the exception remains the same. Why my program does not show even a message special intermittently?

    You should use invokelater autour UI calls, in your case status.show, only.

    networking of any kind must run on a separate thread.

    If checkWebConnection directly uses the networking, I suggest that surround you everything with a new Thread and use invokelater only around status.show parts.

  • Camera to call and wait for the photo?

    Hello world

    First post on these forums, but I've been lurking here for a while. I have a simple question that can have a simple answer, and I hope someone here can enlighten us on this issue.

    I'm looking to call the camera of my application, I can do it quite easily. In addition, I have a listener of filesystem implemented seeking a .jpg file saved after that the user takes a photo. Here are the relevant lines of code (more or less):

    Listener = new FileSystemJournalListener() {}

    public void fileJournalChanged() {}

    Long USN = FileSystemJournal.getNextUSN ();

    for (long I = USN - 1; i > = lastUSN; i--) {}

    Entry FileSystemJournalEntry = FileSystemJournal.getEntry (i);

    If (input! = null) {}

    If (entry.getEvent () == FileSystemJournalEntry.FILE_ADDED: entry.getEvent () == FileSystemJournalEntry.FILE_CHANGED: entry.getEvent () == FileSystemJournalEntry.FILE_RENAMED) {}

    If (entry.getPath () .indexOf (".jpg")! = - 1) {}

    lastUSN = USN;

    photoPath = entry.getPath ();

    }

    }

    }

    }

    lastUSN = USN;

    }

    }

    UiApplication.getUiApplication () .addFileSystemJournalListener (listener);

    Invoke.invokeApplication (Invoke.APP_TYPE_CAMERA, new CameraArguments());

    My problem is I want to access and extract the image from the camera in a way series application, then I would like my request for locking/blocking/wait until what the auditor has identified a new image file. I believe that this is possible, but I'm not familiar with how to do it. In my debugging experience, at least on the Simulator, invokeApplication is threaded (asynchronous) and my request is still ongoing in the background, even if the camera application is active and on the foreground. I tried to add a dummy while loop after the call to Invoke that checks whether my application is in the foreground (using isForeground) but has not lead me on the path.

    I'm working with JDE 4.6.1 and 4.7. Any help would be greatly appreciated!

    Best,

    Wire update

    Hi Peter,.

    Thanks again for your response. I'm really not in one of the videos/images . You can always check my github profile (www.github.com/filmaj), which also contains my range of PhoneGap - it contains the latest code of BlackBerry for our project. In addition, PhoneGap is completely open source and under license by virtue of the MIT, which is pretty liberal, so feel free to grab the code and play with it / use it at your leisure!

    Thanks for the info on the thread of events, which is very insightful. And Yes, almost all PhoneGap runs on the event Thread (except for the recovery of the resource - two resources the application external or local-unit, i.e. the pages html, css, js, images, etc.). It is indeed a difficult situation, but I think I have the solution, but it does not actually the code Java of BlackBerry. I think I can actually solve this problem as soon as the end of JavaScript.

    For context, here's a brief overview / example of how PhoneGap works on a BlackBerry:

    1. developer making an app with PhoneGap called something like navigator.camera.getPicture (success, failure) of JavaScript on the access to its Web site, with the 'success' and 'failure' based on the handles to reminders for image retrieval success or failure, respectively.

    2 some PhoneGap JavaScript wrapper code sets a cookie (document.cookie = "foobar"-call with a particular PhoneGap message format, in this case for the camera.)

    3. We then carry on native code of BlackBerry. Object BrowserField, that displays web application pages and executes the JavaScript Shell, then intercepts this cookie-setting event (via the eventOccured to the RenderingApplication method and Event.EVENT_SET_HTTP_COOKIE event type) and numbers which native device to recover/call feature.

    4. the specific device feature is called and returns a string from a combination of code JavaScript logic and JSON (code object for data transport representation). This string is stored in a Java vector, which is a member of class PhoneGap.

    5. at this point, the cookie-setting event method has finished running, execution returns to the wrapper of PhoneGap JavaScript function. Now, we get the contents of JS document.cookie. As done previously, using the same approach, catch us the event "getCookie" and fill it with the contents of the Java vector we populated earlier. It finally passed into the web page's JavaScript.

    6 back in the land of JavaScript, the last step is to eval() the contents of the cookie, fill data members and call reminders on the right.

    So my solution is to simply ask document.cookie (and therefore indirectly on the contents of the Java vector election) in a defined - for example, every second - interval instead of immediately after the launch of the functionality of the device and only once. In this way, the app will be keep polling the vector object to the new answers PhoneGap and evaluate constantly.

    In all cases, you can not directly solved my problem, but you led me in the right direction! Congratulations to you, Sir!

    Thanks again,

    Wire update

  • RunTimeException when you use the timer and TimerTask.

    In the switchNext() method, it changes an image and some text in a Vertical management. When I run the application, I get a RunTimeException. However, when I have not used the timer and tested the method switchNext() with just a button method worked perfectly. How can I make it work with timer or another class that he will call every 30 seconds?

     time = new Timer();
    TimerTask task = new TimerTask()
    {
    
    public void run()
    {
    
        switchNext();
    }
    };
    time.schedule(task, 10000);
    

    It would be useful to know what Exception you actually get.

    However, I think that it is indeed related to the fact IllegalStateException the TimerTask is running in the "bottom", and you try to update your User Interface.

    If you change the code as follows, it will work the method on the event Thread and so he has access to update the user interface.

    public void run()
    {
    UiApplication.getUiApplicat () .invokeLater (new Runnable()

    public void run() {}
    switchNext();

    }});
    }

    You can find more information on the event thread here:

    http://supportforums.BlackBerry.com/T5/Java-development/what-is-the-event-thread/Ta-p/446865

  • Invoke.APP_TYPE_CAMERA

    I try to use Invoke.APP_TYPE_CAMERA to call app photo on JDE 4.5.0. It works well, but I would like to call using recorder option void. Now any time I change manually. Is there a way?

    Thank you

    Stefano

    This gives a shot:

    try {    int moduleHandle = CodeModuleManager.getModuleHandle("net_rim_bb_videorecorder");
        ApplicationDescriptor[] apDes = CodeModuleManager.getApplicationDescriptors(moduleHandle);
        ApplicationManager.getApplicationManager().runApplication(apDes[0]);
    }
    catch (ApplicationManagerException e) {
        System.out.println("Oh noes!!!");
    }
    
  • Impossible to deploy Composite EM. java.lang.RuntimeException: could not compile BPEL execlets

    Hi all

    I tried to solve this problem, I am facing currently, but have failed so far. I am trying to use a jar file imported into my incorporation of java activity, but whenever I try to deploy the composite on EM I get the following error:

    Suitcase BPEL deployment by mistake.

    "error during the attempt to deploy the BPEL component file" / / app/oracle/middleware/domains*/ * / servers /*/dc/soa_759f9834-e1f3-438f-9a9c-d69a269c6568 "; the reported exception is: java.lang.RuntimeException: failed to bring the execlets of BPELProcess1

    I followed this guide Oracle SOA: how to call a Java method inside a BPEL process using the Java activity on how to import a jar file and use it.

    Already added in the libraries/classpath and added in the SCA-INF/lib folder. I use JDeveloper 11 g

    I also tried to place the JAR file in the soa_ext_11.1.1 folder and capabilities using ANT typical random on SOA: adding the jars/classes customized to Weblogic server-how it works

    I use BPEL2.0

    Here's my import declarations:

      <import location="java.io.*" importType="http://schemas.oracle.com/bpel/extension/java"/>
      <import location="java.util.*" importType="http://schemas.oracle.com/bpel/extension/java"/>
      <import location="java.net.*" importType="http://schemas.oracle.com/bpel/extension/java"/>
      <import location="test.HelloWorldJava" importType="http://schemas.oracle.com/bpel/extension/java"/>
      <import location="oracle.soa.common.util.Base64Encoder" importType="http://schemas.oracle.com/bpel/extension/java"/>
    
    

    Here is the java class that is in the JAR file that I try to use the integration of Java:

    package test;
    
    
    public class HelloWorld {
        public HelloWorld() {
        }
    
    
        public static void main(String[] args) {
            HelloWorld helloWorld = new HelloWorld();
            System.out.println(helloWorld.getGreetings("aaAAaa"));
        }
       
        public String getGreetings(String name) {
            return ("ehhhhhh" + name);
        }
    }
    
    

    This is the java code used in the integration of Java:

    HelloWorld hello = new HelloWorld(); 
    String greetings = hello.getGreetings("Yatan"); 
    
    setVariableData("greetings",greetings);
    
    

    Am I missing something else? And installation of weblogic does matter? Because I'm using a cluster implemented. Any help would be greatly appreciated. Thank you!

    Yes, your import statement was a stupid mistake. Your HelloWorld class but you are importing a class called HelloWorldJava? It's something irrational to me.

    Import your HelloWorld class and other classes are not necessary to import.

Maybe you are looking for