Whether you use Windows, Linux or Mac OS X applications, when the program needs to alert the user (you!) to an issue, the program displays a pop up dialog box with a warning or error message. You can easily create similar warning messages in App Inventor, as shown in this example screen:
To create a pop up warning dialog, use the Notifier control that appears in the Designer’s Palette:
Drag the Notifier icon into the app user interface design – the Notifier is used as a non-visible component, just below the user interface:
Switch to the Blocks view, click on the Notifier1 block to view the available methods. A partial list of methods is shown here – the item circled in red is the one we will use in this example:
In response to an on screen button press (btnNotifyUser’s Click event), the app displays the dialog message:
This block can be inserted anywhere a processing block is allowed such as the result of an if-then-else conditional block. You can also change the text or background color of the app to something more interesting than the “black and white” default colors shown in this example.
Notifier provides a quick and easy way to display short alert messages to the user of the app.
Very nice article. I need to offer a solution to test similar application which works on Bluetooth and via mobile the server-blutooth is configured manually.
– how can we test such bluetooth applications,
– any way to automate this setup on PC? testing this automatically. – – I’m student so please describe in detail.
thanks.
LikeLike
Alka, at this time, App Inventor lacks automated testing tools. It might be possible, I suppose, to run an app in the emulator and use an automated test tool that can then run an application automatically (say on Windows). But I have no idea if this would actually work. It is just an idea. And I have not looked in to trying to use Bluetooth feature in the emulator; Bluetooth might not work in the emulator. These are just some ideas and thoughts for further testing – for now, I am not aware of an existing automated test solution.
LikeLike
How do you make it so that clicking button1 or clicking button2 will do different things?
LikeLike
Here is an answer to what I think you are asking:
In the Blocks Editor, click on the button component located in the left hand column below “Screen1”. You will see a pop up menu of choices.
Click on and drag the item labeled When buttonname.Click over to the Blocks Editor.
Whenever the user presses the button, this “event” will be run. Put code inside this event handler to do what ever you want it to do.
Let’s say you have two buttons: Button1 and Button2. You will add two event handler blocks, like
When Button1.Click do
and
When Button2.Click do
Put the code to do whatever you want them to do inside those event handler blocks.
Ed
LikeLike
Ok – now I see that this is about the Notifier? Sorry, I should have caught that.
Add a When Notifier1.AfterChoosing event handler to your program. This eventhandler has a parameter named “choice”.
Use “get choice” (just like a variable) to get the value of “choice“. The value will be exactly equal to the text of the button.
If button 1 is “Okay” and button 2 is “Cancel”, when you press “Cancel”, the value of choice in the AfterChoosing eventhandler will be “Cancel”. Use an if-then comparison statement to determine which button was pressed and decide what action will be taken.
Does that help?
Ed
LikeLike
I’m trying to do this: [When “buttonA” click do, call “notif1″ showChooseDialog”, message”?”, title “?”, button1Text”No”, button2Text”Yes”, cancelable”false”.] Then I want to call a number when the “yes” is selected, and close the window popup if the “No” is selected. But how?????? I tried to pick a [When notif1 AfterChoosing, choice do
(1):call “XXX” MakePhoneCall
(2): set choice to “Yes” then call “XXX” Make PhoneCall
(3): and many other things but didn’t work….
((The (x): are the combinations I’we tried ))
I’ve tried everything you said but it doesn’t work….
Please help me!!
LikeLike
HELLOOOO!!!!!!!!
LikeLike
stfu
LikeLike
I think this is the best website. Also, I think app inventor sucks doo doo, Visual Basic FTW!!
LikeLike
Hi.Im a newbie..Im trying to do a messaging app for the past 1 week..but it shows “generic failure message not sent”..can u plz help me to sort this out??..I hav seen many sites and forums but the answer didnt do wel on mine..
LikeLike
Hi Monika,
Could you be more specific about what type of messaging app you are creating? Is this an app that uses email or something else to try and send a message?
Ed
LikeLike
Hello how to fix the error in app inventor 2 generated when trying to send more than one text msg at once, appears “generic failure, no message sent”
LikeLike
Hello,
I do not understand what you are trying to do – you are calling the Notifier and passing to it the text messages you want to display? And then it gives you an error “generic failure, no message sent”? That seems like an odd error.
Ed
LikeLike
hello
thanks for this helpful tutorial. i need some help if it is possible and here is my question: iam trying to develop a small app by using mit appinventor but i cant find out how to do a popup list like a menu or an options list. so would you help me please to figure out how to do it because i’ve been trying different ways but it did not work.like this one on the link http://i.stack.imgur.com/uJGlW.png. thanks
LikeLike
I think the best we can do, in App Inventor, is to use the ListPicker. However, this does not display a pop up menu, but a menu of selections on a new screen. After selection, control returns back to your other screen. I have a couple of tutorials on ListPicker components, available in this list
http://appinventor.pevest.com/?s=listpicker
Ed
LikeLike
Thanks a lot for your answer.i’ll take a look on your tutorials and see what i can do.
LikeLike