Create a simple browser app that allows the user to enter a number, and then press a button to learn if that number is prime. The app’s main activity should have the following:
-
A field for the user to enter a number.
-
A button for the user to press.
-
An output field that displays whether or not the entered number is a prime number.
-
The app should not crash if the user enters something other than a number. It should behave gracefully, perhaps by
preventing the user from entering non-numeric characters, or showing an error message if it couldn’t understand the input.For example, if the user enters a 2, 3, 5, or 7, the app should display “Yes” or “True” or something similar. If the user enters a 4, 9, or 15, the app should display “No” or “False” or something similar.