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

Tags: BlackBerry Developers

Similar Questions

  • GPS apps in the background

    I have an iPhone 6 s upgraded to iOS 10 the day it came out last week and I noticed that applications using GPS are failing in the background when several applications are in use. I ran to the Waze to check the traffic and Google Maps at the same time to check something on Friday and has noticed that if she was in the background would tend to turn off after a few moments. When I turn back, she will have to acquire the road again. I also have a Fitbit load HR, which uses the GPS on the phone via bluetooth to create a map of my route. I have it worked out with my usual Runkeeper app (which normally works perfectly) and noticed that Runkeeper would be closed after a mile or more. When I went to him to my podcast app after my race, Runkeeper would start up and missed the last two miles of my race. In addition, the road saved by Fitbit seemed jumped all over the place. I know that it is not unusual for GPS from blip, especially when moving through areas with weak signal or cell mutation or all through the streets of the city with tall buildings, but it seems that the problems have become more coherent. I have not tried to run with a single application to see if I have the same problem, but will try tomorrow. I used only a single app for navigation (Waze) yesterday evening and he seemed also to close after it is placed in the background for a while. Has anyone else seen anything like this?

    Hello alexhoward,

    Thank you for using communities of Apple Support. It is my understanding GPS apps do not work in the background, after the update to iOS 10. I use GPS every time I travel. I know that it can be crucial for applications GPS running in the background. I'm happy to help you

    I recommend first restart your iPhone. This can solve many unexpected behaviours. Follow the steps below.

    1. Press and hold the sleep/wake button until the Red slider appears.
    2. Drag the slider to turn off your device completely off.
    3. Once the device turns off, press and hold the sleep/wake button again until you see the Apple logo.

    Restart your iPhone, iPad or iPod touch

    If the problem persists, reset your location service. This resets all settings at default location. Apps will be stop using your location until you grant them permission again. Go to settings > general > reset > reset the card and privacy. Here is some additional information on location Services.
    On privacy and location in iOS Services 8 and later versions

    See you soon!

  • Detect the app in the background

    How will I know that my request was sent in the background? Is there some kind of listener for it?

    the deactivate method is called

  • Toast in-app in the background

    In a simple way, I want the app to display the toast for some event when minimize. Is this possible?

    No, you can either update the ActiveFrame with your message...

    http://developer.BlackBerry.com/native/documentation/Cascades/UI/active_frames/

    Or send a notification to the hub...

    http://developer.BlackBerry.com/native/documentation/Cascades/device_comm/notifications/

  • Super App, link the calendar to my webworks app.

    Hello

    I was wondering if someone can suggest and approach to achieve the following objectives. I am writing a webworks app that will add appointments to the native blackberry calendar. In field notes would be a link that allows you to jump into the webworks app. for example

    http://MyApp.com/showclient/10

    This link should be webworks out of the background applications and bring to the foreground and then show customer number 10 details.

    I started to address this problem by using a httpfilter for the domain "myapp.com.

    HttpFilterRegistry.registerFilter ("myapp.com", "mypackage.filters", true);

    in the Protocol.java method of the file openFilter filter I can see the name of the url (for example the action and the customer number etc.), but where I'm stuck is to identify mechanisms to invoke the JavaScript on my webworks app to bring to the forefront and to charge the customer.

    My current setup is an app of webworks with a native extension that records the httpfilter. At this point, I tried store away a reference to the scripting engine, the reference to javascript to call as a parameter to the method of extension, but when the URL is intercepted and I try to read read the script engine or the javascript reference, they are zero. I suspect that the httpfilter is picked up in a space of different application or something? S

    If someone can tell me how to leave a httpfilter to call my webworks app and give him the necessary information to pass to the right pages.

    Managed to fix this using using the ApplicationManager and post a global event and have a global event listener in my webworks application manage just incase of anyone trying to do something similar

  • To access the URL in webworks app

    Hi all

    What is the best practice to access a web page from a webworks app

    The argument of browser

    for example:

    var args = new blackberry.invoke.BrowserArguments ('http://www.google.com');
    BlackBerry.Invoke.Invoke (blackberry.invoke.APP_BROWSER, args);

    Also set your config file. XML

    -------------------------------------------------------------------------------------------------------------------------------------------------------------

    Don't forget to press the button I like accept as solution to help others so this post can help

  • Add WebWorks App to share the map

    Dear community,

    How can I add my Webworks App for the ShareCard?

    I want exaclty:
    I want to 'share' link from the browser native of my application, but I can't find a solution how to add my application to share the maps.

    Someone knows how to do this?

    I believe that this sample application shows how to do this.

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

    Above all, you will be interested the app "Remained" in this repo.

  • Make the text selectable in WebWorks App

    I created a PlayBook application using WebWorks, HTML and CSS and the app offers a great HTML textarea. For some reason, the user cannot select text to copy or paste text in.

    Is there something special that needs to be done to enable text selection? I checked my code and see nothing that prohibits text selection.

    Thanks for any advice.

    I tracked the solution (thanks to geniuses behind the app preview PlayBook). Check it out here: http://www.willw.net/enabling-copy-and-paste-in-a-webworks-app-for-the-blackberry-playbook/

    This simple solution that I was kicking myself for not understanding earlier!

  • How to identify a webworks app launches for the first time...

    I am designing my webworks app to prompt the user to accept a license agreement before using the application for the first time. If they accept that the application works as usual, if they decline the application does not load and it ends.

    Is to do it in a Webworks app without the use of a store like the SD card anyway?

    I don't want to use the SD card as a store because it limits the number of users who can use the app (even if these SD cards are now pretty much standard).

    Does anyone have any suggestions?

    EC

    You can store the information using the API file on the local file system IO... You don't need to use the SD card... just a local path on the file system of the device.

  • Run the application in the background and receive updates of geolocation

    Is it possible to run an application in the background (for example all doing other things such as the use of browser, mail, etc) and always receive updates HTML5 geolocation?

    If you make your application in the "background" and do not close, the watchPosition should go on the provision of data within your App App in the background means you open the app and ample bottom to somehow minimize, for example. to open another app or something like that. As long as he remains upwards in the list of open applications it should "look at the position.

  • Start the Widget in the background

    Hello

    Is it possible to start a Widget app in the background, when the unit starts as if it was in Java applications using the entry point?

    Kind regards

    Nallo

    Hi all

    Here are the steps that I use to configure a widget to auto-run using VS 2008.  It seems to work with simulators as well as when the widget is deployed through BES 5.0.   Please try it and let me know if it works for you.

    1. Create a new BlackBerry Widget project in VS 2008.  Name it "AutoRunWidget".
    2. Build the solution with the Build-> order generate the Solution or F6.
    3. Use windows Explorer to navigate to the project folder and the forest down to the bin\OTAInstall folder.
    4. Find the AutoRunWidget.jad file in the OTAInstall folder.
    5. Right-click on the AutoRunWidget.jad file and select the copy"" command.
    6. Navigate to the top of two levels in the main project folder (one of the contains index.htm and config.xml).
    7. Paste the AutoRunWidget.jad file in the main project folder.
    8. In VS 2008 solution Explorer, click the button "show all files".  You should now see the file AutoRunWidget.jad previously the file config.xml and index.htm in the list (Fig 1).
    9. Make a right click on the AutoRunWidget.jad element and the select "include in project" menu command (Fig 2).
    10. In the Properties window, change the "Build Action" attribute for the file AutoRunWidget.jad ' Compile ' (Fig 3).
    11. Double-click the AutoRunWidget.jad file to display it in the editor VS 2008.
    12. In the content of the AutoRunWidget.jad file, change the line that reads "RIM-MIDlet-flags-1: 0" to "RIM-MIDlet-flags-1: 1"(Fig. 4). "»
    13. Save and close the AutoRunWidget.jad file.
    14. Clean the solution with the Build-> command clean the Solution.
    15. Rebuild the solution with the Build-> order regenerate the Solution.

    That's all!   Please note that whenever you modify the config.xml file, you will need to repeat steps 4 to 15 so that these changes are reflected in the .jad file.

    Coming up:

    -How to set up a widget to auto-run using Eclipse.

    -How to deploy a widget on the homescreen device instead of the folder "downloads".

    Fig 1.

    Fig 2.

    Fig. 3.

    Fig 4.

  • 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

  • HTML5 App - See the pop-up message window when in the background

    Hello

    I need my application to display a popup to the user even if the application is in the background.

    How can I do this if my application is built with html5 and JavaScript?

    Thanks for any help

    Hello Wadi,

    This has proved to be a bit of a monster post. If you have any questions at a stage any post, do not hesitate to ask. Let's dive.

    There are a few issues I see with the code you provided.

    PopupExtension.java


    • Creates an AlertNamespace object, your class is called PopupNamespace.

    PopupNamespace.java


    • getField is not implemented. \

    PopupFunction.java


    • A lot of import declarations are missing.

    I'll show you a comparison of my files, I managed to get the dialog box displayed from in my WebWorks app; No matter whether the application is in the foreground or background.

    For reference, the creation of my java files is based on the examples of code available here:

    https://bdsc.webapps.BlackBerry.com/HTML5/documentation/ww_developing/using_javascript_extensions_18...

    For starters, I have SandboxExtension.java. It is the equivalent of your PopupExtension.java.

    package sandbox.extension; 
    
    import net.rim.device.api.browser.field2.BrowserField;
    import net.rim.device.api.script.ScriptEngine;
    import net.rim.device.api.web.WidgetConfig;
    import net.rim.device.api.web.WidgetExtension;
    import org.w3c.dom.Document;
    
    public final class SandboxExtension implements WidgetExtension {
        String _widgetNameForFutureUse;
        BrowserField _browserFieldForFutureUse;
    
        public String[] getFeatureList() {
            String[] result = new String[1];
            result[0] = "sandbox.popup";
            return result;
        }
    
        public void loadFeature(String feature, String version, Document doc, ScriptEngine scriptEngine) throws Exception {
            if (feature.equals("sandbox.popup")) {
                scriptEngine.addExtension("sandbox.popup", new SandboxScriptable());
            }
        }
    
        public void register(WidgetConfig widgetConfig, BrowserField browserField) {
            _widgetNameForFutureUse = widgetConfig.getName();
            _browserFieldForFutureUse = browserField;
        }
    
        public void unloadFeatures(Document doc) {
        }
    }
    

    Main differences


    • I've updated my package to sandbox.extension it is unique (less chance that it has already been used.)
    • In getFeatureList, I and by using the function sandbox.popup; It was purely a personal choice I made during the implementation of the example. There is no real functional difference.
    • Subsequently to the first point, I also refer to sandbox.popup in my remaining code; more precisely within loadFeature.
    • My method of register sets two corresponding member variables.
    • I create a new SandboxScriptable object as opposed to your object of AlertNameSpace.

    The following file is SandboxScriptable.java. It is the equivalent of your PopupNamespace.java file. Note that this class must refer to the object that is created in the file above. In my case, I created an object of SandboxScriptable , so I'm now implement SandboxScriptable.java to define this object.

    package sandbox.extension;
    
    import net.rim.device.api.script.Scriptable;
    
    public final class SandboxScriptable extends Scriptable {
    
        private SandboxPopup _sandbox;
    
        public SandboxScriptable() {
            _sandbox = new SandboxPopup();
        }
    
        public Object getField(String name) throws Exception {
            if(name.equals("doPopup")) {
                return this._sandbox;
            }
            return super.getField(name);
        }
    }
    

    Main differences


    • Slight changes to naming to accommodate my variable names.
    • The getField function is (and must) be implemented. In fact, when a method is called, I check to see if it is the doPopup method. If so, I returns a SandboxPopup object. This would be your PopupFunction class. If the user does not call the doPopup method, I just pass back the default behavior via the super object.

    The final class is SandboxPopup.java. It is the equivalent of your PopupFunction.java. Above, we create and return an object of SandboxPopup , so in this file that we actually apply this that the object is actually.

    package sandbox.extension;
    
    import net.rim.device.api.script.ScriptableFunction;
    import net.rim.device.api.system.Application;
    import net.rim.device.api.ui.UiEngine;
    import net.rim.device.api.ui.Ui;
    import net.rim.device.api.ui.Screen;
    import net.rim.device.api.ui.component.Dialog;
    import net.rim.device.api.system.Bitmap;
    import net.rim.device.api.ui.Manager;
    
    public final class SandboxPopup extends ScriptableFunction {
        public Object invoke(Object obj, Object[] args) throws Exception {
            synchronized(Application.getEventLock()) {
                UiEngine ui = Ui.getUiEngine();
                Screen screen = new Dialog(Dialog.D_OK, "Hello World!", Dialog.OK, Bitmap.getPredefinedBitmap(Bitmap.EXCLAMATION), Manager.VERTICAL_SCROLL);
                ui.pushGlobalScreen(screen, 1, UiEngine.GLOBAL_QUEUE);
            }
            return "UNDEFINED";
        }
    }
    

    Main differences

    • I added all declarations of import for the different Classes of the RIM used.
    • I return a default value 'Not DEFINED' string regardless of the success.

    And that is the essence of the java files. Basically, it is a string of three classes; the first refers to the second, and the second refers to the third. In your example, the chain is slightly broken, however can be fixed fairly quickly based on the notes above.

    The next part that needs to be done is to associate your Javascript Extension with WebWorks. This can be done in two different ways.

    • Package your extension with your application. Described in the Javascript Extension guide link above.
    • Integrate your extension with your SDK WebWorks.

    I opted for the latter, I find this approach a little simpler. The first thing we need to do is to copy our java files in the extension folder. The extension root folder that I used is as follows:

    C:\Program search in Motion\BlackBerry 2.3.0.9\ext\ SDK WebWorks

    In this case, I created a folder sandbox.extension to House my extension:

    C:\Program search in Motion\BlackBerry 2.3.0.9\ext\sandbox.extension SDK WebWorks

    I then copied the folder src housing my files java to get the following file structure:

    Note that the CBC/sandbox sand/extension path is no coincidence because sandbox/extension's folder as dictated by the package structure that I used in my java files. More precisely:

    package sandbox.extension;

    The last thing missing is a library.xml file. I used the library.xml files available on Github WebWorks community API page as a starting point and made a few modifications for the following.

    
        
            sandbox.extension.SandboxExtension
        
        
            
                
            
        
        
            
                
            
        
        
            
        
    
    

    Key information

    • The is set to point to the class that implements WidgetExtension. In this chain of three java files, it would be the first file.
    • Under , I set path = 'src' since the real package begins in the src subfolder.
    • Under I've set the id to sandbox.popup.

    This file has been created under the sandbox.extension root folder, specifically:

    C:\Program search in Motion\BlackBerry 2.3.0.9\ext\sandbox.extension SDK WebWorks

    And that's all for the configuration of the SDK. Now, when I have an application that relies on this extension, I don't no need to include something more in my real application because this feature is now integrated directly with my SDK. To use this feature, I need to:

    • Include the feature in my file config.xml .
    • Call the function in my Javascript.

    My file config.xml looks like as follows.

    
    http://www.w3.org/ns/widgets" xmlns:rim="http://www.blackberry.com/ns/widgets" version="1.0.0">
        Sandbox
        Oros
        
    
        
    
    

    Very basic. The element indicates index.html will be our main entry point. The important thing here is that I have included the item with id = "sandbox.popup". " You will notice that it is the same id that we have defined in library.xml.

    Finally, here is a small sample application that gives the user a button. Once this button is clicked, a timer is called during 5 seconds. At the end of those 5 seconds, the extension (and in turn a popup dialogue) is called.

    
    
        
        
        
            
    
            
        
    
    

    As you can see, we add a to our page which, when clicked, will trigger the function of fire . The function of fire calls setTimeout with a founter of 5000 milliseconds.

    The reason for this is to give you the opportunity to stay within the application, or limit its application with the red end call button. No matter whether you are in the application or the application is reduced, after 5000 milliseconds, the invokeExtension function is called.

    In invokeExtension, you can see call us sandbox.popup.doPopup. sandbox. Popup is the object, we defined in library.xml and put subsequenty implement within our java files. doPopup is the function we defined to be processed in the java files.

    Still, if you have any questions about the foregoing, please let me know.

    Erik Oros

    BlackBerry Development Advisor

  • BlackBerry app Push Notifications using PushWoosh does not receive notifications when closed and in the background

    I'm developing an application of crossed with phonegap and Jquery mobile platform. I'm trying to implement push notifications for the blackberry application using PushWoosh.

    I noticed that I'm not able to receive notifications when the application is in the background, or when it is closed. I get notifications only when the application is in the foreground.

    Any suggestions on this problem?

    I can use all the help.

    The app is a phonegap application Webworks.

    Thank you.

    Info:

    PhoneGap 2.8.0

    jQuery 1.9.1

    jQuery 1.3.1 Mobile

    SDK WebWorks

    PushWoosh

    Hello

    We just push our BB HTML5 / Webworks sample to our github repo:

    https://github.com/shaders/push-notifications-SDK/tree/master/SDK%20Sample%20Projects/BlackBerry-htm...

    Team Pushwoosh

    www.pushwoosh.com

Maybe you are looking for