WebWorks invoke

is it possible to launch the media player invoke. JavaArguments using http://blackberry-webworks.github.com/WebWorks-API-Docs/WebWorks-API-Docs/view/blackberry.invoke.Jav... ?

I tried following method without success:

function launch_media_player()
{
Try
{
var params = new Array();
params [0] = 'http://somesite.com/somefile.mp3
var args = new blackberry.invoke.JavaArguments ('net_rim_bb_mediacontenthandler', params);
BlackBerry.Invoke.Invoke (blackberry.invoke.APP_JAVA, args);
}
{} catch (e)
Alert ('exception (launch_media_player): "+ e.name +"; ") "+ e.message);
}
}

launch_media_player();

No, this is not possible.  The reason why is most of the applications created by RIM (e.g. media player) do not allow the 3rd party applications feed settings.  This is why the blackberry.invoke.APP_MUSIC constant has been provided so that you may directly rely on the media player (but unfortunately no params).

With your code, I could expect the media player can be opened, by targeting the module directly, but it would not start playing somefile.mp3.  What do you see?

You are targeting BlackBerry 7?  If so, you can use the HTML5 audio element instead.

Tags: BlackBerry Developers

Similar Questions

  • invoking the application/Gallery bb10 webworks app camera app

    Hello

    in my application that is based on its targeted and webworks for Blackberry10 OS, how to invoke enforcement camera and Gallery.

    can I somehow call it using blackberry.invoke.invoke api pointing to the camera or a gallery, please let me know.

    You can use the invoke of verification on the next page for more details:

    -Camera: https://developer.blackberry.com/html5/documentation/camera.html

    -Gallery: it's a little more complicated, but you can usually call it through the target of the application as follows:

    -action: 'bb.action.OPEN', target: 'sys.pictures.app '.

    If you wish, you can use the card for the camera as defined here:

    - blackberry.invoke.card.invokeCamera

    - https://developer.blackberry.com/html5/apis/blackberry.invoke.card.html

  • Start/Invoking third-party apps from the WebWorks app

    Hi all

    Just a quick question. Is it possible to start/call a third party on a blackberry java application 7 from a WebWorks app?

    I did some research and it seems that it is impossible. I did the opposite and opened a WebWorks app from java application successfully but hope that it is possible.

    Thank you all for your time.

    Rob

    Unfortunately BBOS was not as flexible as BlackBerry 10 invocation framework and what was available on the side of Java is not inherently available in WebWorks.

    You can use the ApplicationManager:
    http://www.BlackBerry.com/developers/docs/7.0.0api/NET/rim/device/API/system/ApplicationManager.html

    Launch an application, if you know the information on the module itself.

    launch
    http://www.BlackBerry.com/developers/docs/7.0.0api/NET/rim/device/API/system/ApplicationManager.html...

    launchApplication
    http://www.BlackBerry.com/developers/docs/7.0.0api/NET/rim/device/API/system/ApplicationManager.html...

    runApplication
    http://www.BlackBerry.com/developers/docs/7.0.0api/NET/rim/device/API/system/ApplicationManager.html...
    http://www.BlackBerry.com/developers/docs/7.0.0api/NET/rim/device/API/system/ApplicationManager.html...

    However, if you want to access these in WebWorks, you create a custom extension to call the native API (Java).
    https://github.com/BlackBerry/WebWorks-community-APIs/tree/master/Smartphone/template

  • Invoke WebWorks app in the background

    Hello

    I develop an application that must call another application I created. The application that should then be called to start a task update that updates its data in the database. I don't want my application called to be visible to the user. Is this possible? Otherwise, what's my alternative?

    I posted a sample here for opening discussion pushes client-side. Let me know if you have any questions.

    http://supportforums.BlackBerry.com/T5/Web-and-WebWorks-development/client-side-push-Inititator/TD-p...

    EDIT: The receiver push aside customer would be the work in the usual way.

    https://github.com/BlackBerry/BB10-WebWorks-samples/tree/master/pushCapture

  • How browserfield opportunity to invoke phonegap script on java application, not webwork?

    Hi guys,.

    I'm confused with phonegap integration to blackberry java application, I know phonegap only support blackberry webwork, so my question is java application may not support javascript on browserField2 phonegap, is it possible to apply or widget support only on webwork request right?

    Thank you guys.

    I had resolved.

  • Cannot install Webworks - Windows DLL failed to load - 10 Windows

    Hello

    Try to install 2.2 on Windows 10 Webworks but fails with this message:

    Flexeraawm$ aaa: cannot load Windows DLL
    at Flexeraawm.af (unknown Source)
    at Flexeraawm.aa (unknown Source)
    at com.zerog.ia.installer.LifeCycleManager.init (unknown Source)
    at com.zerog.ia.installer.LifeCycleManager.executeApplication (unknown Source)
    at com.zerog.ia.installer.Main.main (unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (unknown Source)
    at java.lang.reflect.Method.invoke (unknown Source)
    at com.zerog.lax.LAX.launch (unknown Source)
    at com.zerog.lax.LAX.main (unknown Source)

    Any help is appreciated.

    There is a problem with the installer WebWorks and recent updates of Java on Windows 10 1.8.  The workaround is to use Java 1.7.

  • Invoke a voice recorder

    Based on this page: http://developer.blackberry.com/html5/documentation/v2_0/voice_note.html

    I am trying to invoke the speech recorder.  You need a working example?

    Using WebWorks 2.0, I created a new project with:

    C:\webworks> webworks create invokeRecorder
    

    I then added the extension invoke :

    C:\webworks\invokeRecorder> webworks plugin add com.blackberry.invoke
    

    I emptied the www folder only have my index.html file ( config.xml file was located in the parent folder). My gaze to index.html as follows file:

    
    
      
        
        Invoke
      
      
        
    
        
        
      
    
    

    I then ran this on my device (connected via USB, in developer mode) with the command:

    C:\webworks\invokeRecorder> webworks run
    

    And was able to successfully invoke the speech recorder.

  • Set the Lockscreen Wallpaper (WebWorks)

    Hey,.

    is it possible in any way to set the wallpaper of the Lockscreen from Webworks application?

    The plugin system allows me only to regular wallpaper (blackberry.system.setWallpaper).

    We badly need this feature

    PS: it seems to be possible if I invoke the pictureeditor with option setwallpaper (she gives the Selector screen), but I will not have the option 'Save a copy' in there... is possible to refuse this option?

    ... it would be cool to have the same option for lockscreen as blackberry.system.setWallpaper.

    I would like to write my own plugin, but I can't c + c++ code / native

    Thank you

    I guess. @twindsor done made a great plugin model that might get you in the right direction at least. I would use the Yeoman version of generator.

    He talks more about it in this blog-> http://devblog.blackberry.com/2015/09/cordova-5-x-for-blackberry-10/

  • Event invoked not pulling

    I am currently using the WebWorks 2.0.0.71 SDK with the 10.2.1.1925 simulator and my physical device and I have some difficulty.

    I tried for hours detect the event invoked using document.addEventListener ('called', onInvoked); but I can't seem to detect it.

    The app normally opens very well and can also be invoked (as a map) as expected, but I don't get any invoked event (the rest of the code works fine).

    I even tried to directly copy the example of http://developer.blackberry.com/html5/apis/v2_0/blackberry.invoked.html but no luck.

    Any help would be greatly appreciated!

    Additional checks showed that the right solution is:

    document.addEventListener ('called', this.onInvoked, false);
    onInvoked: {function (onInvokedInfo)}

    The underlined part was not necessary (I didn't not test properly variations to achieve this) and the patch removed (onInvokedInfo) of the function addEventListener call.

  • WebWorks Push Client

    Hello

    I'm sort of stuck in the logical process to receive a push message in an application webworks. The sample application works fine and I can receive messages with him. I guess I understand something wrong.

    What I understand so far is:

    1. create pushservice

    2. create the event listener

    3 activate the application to launch on push

    4 create the channel

    and everything should be good... or not? Lets talk about code:

    config. XML (part)

    
        post_notification
        _sys_use_consumer_push
        read_device_identifying_information
    
    
        APPLICATION
        
            bb.action.PUSH
            application/vnd.push
        
    
    

    JavaScript :

    function createPushService() {
      try {
    
            ops = { invokeTargetId : 'bert.pushcapture.invoke.push',
                    appId : 'XXX-XXXX...',
                    ppgUrl : 'http://cpXXX.pushapi.na.blackberry.com'
            };
    
            blackberry.push.PushService.create(ops, successCreatePushService, failCreatePushService, onSimChange, onPushTransportReady);  
    
      }
      catch (err) {
        alert(err);
      }
    } 
    
    function successCreatePushService(service) {
        //alert("Created Push service");
        // check this **bleep**
        pushService = service;
        blackberry.event.addEventListener("invoked", onInvoke);
        launchApplicationOnPush(true, launchApplicationCallback);
    }
    
    function failCreatePushService(result) {
        alert("Error: Received error code (" + result + ") after " + "calling blackberry.push.PushService.create.");
    }
    
    function onPushTransportReady(result) {
        if (result == blackberry.push.PushService.SUCCESS) {
                    alert("successful Configuration");
            } else {            
    
                if (result == blackberry.push.PushService.INTERNAL_ERROR) {
                    alert("Error: An internal error occurred while calling launchApplicationOnPush. " + "Try restarting the application.");
                } else if (result == blackberry.push.PushService.CREATE_SESSION_NOT_DONE) {
                    alert("Error: Called launchApplicationOnPush without an " +
                    "existing session. It usually means a programming error.");
                } else {
                    alert("Error: Received error code (" + result + ") after " + "calling launchApplicationOnPush.");
                }
            }
    }
    
    function launchApplicationCallback(result) {
        if (result == blackberry.push.PushService.SUCCESS) {
                    alert("successful Configuration");
            } else {
    
                if (result == blackberry.push.PushService.INTERNAL_ERROR) {
                    alert("Error: An internal error occurred while calling launchApplicationOnPush. " + "Try restarting the application.");
                } else if (result == blackberry.push.PushService.CREATE_SESSION_NOT_DONE) {
                    alert("Error: Called launchApplicationOnPush without an " + "existing session. It usually means a programming error.");
                } else {
                    alert("Error: Received error code (" + result + ") after " + "calling launchApplicationOnPush.");
                }
            }
    }
    
    function onSimChange() {
        alert("SIM card is changed!");
    }
    
    function createChannelCallback(result, token) {
        if (result === blackberry.push.PushService.SUCCESS) {
            alert("channel created");
        } else if (result === blackberry.push.PushService.INTERNAL_ERROR) {
            alert("channel failed");
    
        }
    }
    
    function onInvoke (invokeRequest) {
            if (invokeRequest.action != null && invokeRequest.action == "bb.action.PUSH") {
                if (pushService == null) {
                    setTimeout(function() { onInvoke(invokeRequest); }, 750);
                } else {
                    var pushPayload = extractPushPayload(invokeRequest);
                    pushNotificationHandler(pushPayload);
                }
            }
    }
    
    function pushNotificationHandler (pushpayload) {
        var contentType = pushpayload.headers["Content-Type"];
        if(!contentType) {
            contentType = pushpayload.headers["content-type"];
            if(!contentType) {
                contentType = "text/plain";
            }
        }
    
        db.transaction(
            function(tx) {
                tx.executeSql("INSERT INTO Data (title) values(?)", [ "PUSH"], null);
            });
    
        //alert("PUSH RECEIVED");
        pushpayload.acknowledge(true);
    
    };
    

    I call following functions thanks to a button:

    1 createPushService();

    2 pushService.createChannel (createChannelCallback);

    and I get a 'alert ("channel created");"and it means to me that the PushService and the channel was created successfully.

    Given that I have create an event for a 'called' via 'blackberry.event.addEventListener ("called" onInvoke),"the"onInvoke"function should be called when receives a new thumb. Fix?

    Unfortunately it does not work and I get no response or error.

    Any help or advice is appreciated. I'm really stuck here...

    The best

    bert2002

    Hello

    A couple of things to ask you.  Not sure if they are related to your problem, but it's worth a shot.

    1. you call extractPushPayload below when dealing with a thrust to invoke.  But, when this function is defined?  You must call pushSevice.extractPushPayload somewhere.

    2. you should not the setTimeout function need more if you add the event listener for the "called" event in your call to success blackberry.push.PushService.create.  Our sample no longer use setTimeout.

    3. in your code, you call launchApplicationOnPush and createChannel every time.  You only really need to call them once.  After graduating launchApplicationonPush and reminders of createChannel successfully the first time, then you are ready to receive the impulses.  You just do it again if you make a destroyChannel somewhere.  Do you need to call blackberry.push.PushService.create each time however.

    4. are you setting the tag in your config.xml file?

    Hope that helps,

    Matt

  • Call my app when clicking on a specific URL in the BB10 webworks

    Hi all

    I want to register my application to open a specific URL (like: http://www.xyz.com) on impact on the browser. Below is the contents of the config.xml file, I tried. This does not work for me.

    
    
        
            APPLICATION
            
                bb.action.OPEN
                text/plain //tried with * also
            
            
        
    

    I tried several configuration in the config.xml file, but no luck. Also researched a lot on forums and found below URL for native code.

    http://supportforums.BlackBerry.com/T5/native-development/how-to-invoke-my-app/m-p/2734705#M57010

    Is this possible in BB10 Webworks?

    Finally found the solution which shows pop up to open my application by hitting a specific URL in the browser. Here's the changes to make in the config.xml file.

    
            APPLICATION
    
            
              bb.action.VIEW
              *
              
            
    
            
              activetext:
            
    
        
    
  • How do I send the email from BB10 webworks app

    I want to have a module in my BB10 WebWorks app that will allow users to compose a message by entering the information in a form, which will then be sent by e-mail to an e-mail address.

    I guess this could be done by using the EmailComposerOptions API, but I don't know how to use it.

    Any help will be appreciated.

    Have you looked at the code example in the API document?

    https://developer.BlackBerry.com/HTML5/APIs/BlackBerry.Invoke.card.html#.invokeEmailComposer

    < script="text/javascript">
    //simply invoke email composer, with no options and callbacks
    blackberry.invoke.card.invokeEmailComposer();
    
    //invoke email composer with subject, body, to, cc and attachment options
    blackberry.invoke.card.invokeEmailComposer({
        subject: "Email subject",
        body: "Email body",
        to: ["[email protected]", "[email protected]"],
        cc: ["[email protected], [email protected]"],
        attachment: ["/path/to/an/attachment.txt", "path/to/another/attachment.txt"]
    }, function (done) {
        console.log(done);
    }, function (cancel) {
        console.log(cancel)
    }, function (invokeError) {
        console.log(invokeError);
    });
    
    

    Once the function is called, map of composer email will slip into the view with all pre-filled fields and the user can then click on send.

  • BlackBerry WebWorks app via a URL with the parameters of launch?

    I have an application of WebWorks I want to start with a URL to the browser and pass parameters to query URL to the application in this way. Is this possible? How? I would be happy to use HttpFilterRegistry or API call, but I don't see how to use these approaches to get my WebWorks App settings, even if I write a custom extension. Example of code would be very useful, especially to consume the parameters. Or at least an indication of which API (s) for this.

    This should be supported by the framework. What I would like to recoemmend is simply invoke the application according to the normal and placing the parameters in the URL to the standard '&' "?" rating.

    Then take advantage of the class UTIL. JS out of the parameters passed required...

    https://bdsc.webapps.BlackBerry.com/HTML5/APIs/BlackBerry.utils.URL.html

    (If you need help, citing the app, it is done as invoke any other java application on the device)

    R

  • WebWorks app with part without head

    I'm devolopping a webworks SDK-based application.

    I want to develop a plugin that communicate with a native service without a head.

    I used the sample of The Headless Service sample that shows how to create a long service life without a head.

    Also, I used the model of the creation of a plugin of cordova for communication between JavaScript and native part.

    2 samples of separately work fine, I have not found how to configure make them work together. I mean How to invoke the service without a head form Javascript side.

    As BlackBerry Webworks Extension Native and native headless service project have the same structure of project, I don't have how to configure my Webworks and my native project without head to communicate with each other.

    Help please?

    Hello

    WebWorks 2.1 has a «create headless» CLI command This operation generates a sample application in which the momentics project built directly in the project WebWorks. It illustrates invocation of WebWorks for headless.

    http://developer.BlackBerry.com/HTML5/documentation/v2_1/creating_a_ww_app_with_headless_app.html

  • How can I call the stream media player in webworker.

    Hi all.

    I need a few snipets of invoke media player from the webworker blackberry

    How can I call it stream media player in webworker please help me.

    You should be able to:

    location.href = 'mymediaurl';
    

Maybe you are looking for