10-24-2011 06:57 PM
Hi everyone,
I am developing an application which will alert the user when the data is pushed. I want to send a dialog like alert to users home screen without opening the the actual application. The dialog will display the information to the user and if he selects OK it will open the app and if he selects close it will just ignore the message.
So far i have done this when the push is initialized
blackberry.app.requestForeground()
var ss = ["OK", "Close"];
blackberry.ui.dialog.customAsk("push data push data", ss, 0, true);The problem is it opens up the whole app and then displays the dialog. I dont want to hog users whole screen; just want to display the dialog on home screen. Any ideas how can i accomplish that fellas?
10-24-2011 07:53 PM
Hi zed_one,
I'd reccomend using the showBanner API - https://bdsc.webapps.blackberry.com/html5/apis/bla
This will add an indicator just like your native email or BBM. This way your app will feel just like a native app.
button below the post(s)10-24-2011 08:15 PM
Hi effheifetz,
Good advice but i really need to implement this. The app is for news and only the stories of very high importance will be pushed which will happen like maybe twice or thrice a week. I got this idea from AP's news app and i really need to implement this feature in my app. I hope there is a way to do this.
10-25-2011 11:06 AM
I was able to display a dialog box on home screen with the help of this.
but i cant figure out how to implement this in webworks. Help me please.
10-25-2011 01:10 PM
you can write an extension that implements this code and use it from javascript
10-25-2011 04:04 PM
how can i do that?
the class is as follows:
public class HelloWorld extends Application
{
public static void main(String[] args)
{
HelloWorld theApp = new HelloWorld();
UiEngine ui = Ui.getUiEngine();
Screen screen = new Dialog(Dialog.D_OK, "Look out!!!",
Dialog.OK, Bitmap.getPredefinedBitmap(Bitmap.EXCLAMATION), Manager.VERTICAL_SCROLL);
ui.pushGlobalScreen(screen, 1, UiEngine.GLOBAL_QUEUE);
theApp.enterEventDispatcher();
}
}
10-26-2011 11:23 AM
Hi zed_one,
If you take a look at the barcode extension on our community repo, you'll see the scanBarcodeAction does just this, it creates a screen and pushes it. If you modify the code with your own it shouldn't be too hard to get working.
button below the post(s)10-27-2011 08:22 PM