Now that we are well versed with Activity, Layout, Views etc its time to get our hands dirty, and create our second application. This application will have a science quiz, and user will have option to answer in True or False. Based on what the user enters, we will show the user, whether they selected the correct option or not by simply showing a message saying Correct or Incorrect.
ScienceQuizand company domain as
com.studytonight.quizand Click on Next.
Phone and Tabletfor this application. And in the dropdown saying Minimum SDK choose
API 16: Android 4.1 (Jelly Bean), this means our App will work on all the Phones and Tablets with Android Version 4.1 till 7(the latest version). Click on Next button.
Empty Activityfrom the avilable options. And click on Next.
ScienceActivity, and Android Studio will automatically fill the layout file name. It is a standard practice to add suffix Activity in the Activity names and we will follow it. And for layout XML file, it is all words in small and in reverse order, separated by underscore
_. Click on Finish to create the project.
activity_science.xmlfile will be open and in the Preview tool window you will see the preview for your app. If the Preview tool window in not open, go to View → Tool Windows → Preview, and the preview window will show up on the right side.