How it works...
You invoke the Android() method of the android module to create an object called app. It is through this app object that you will communicate with Android. You show a dialog box prompting the user to enter his/her name. The name entered by the user is assigned to the name variable. You invoke the dialogDismiss() method to dismiss the dialog or make it invisible once the user presses the Enter key after entering a name, or presses the OK button.
Thereafter, you welcome the user by displaying an alert box that shows Hello, followed by the name of the user. To keep the alert box visible until the user sees it, a dialog box is displayed with the OK button in it. The welcome message will be visible until the user presses the
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access