Android Application Build
In android applications you can thing of an object as an item on the screen. Every component on the screen is added by adding coding into your XML file. The EditText component is how we gather user input which is the first three lines on my screenshot. There is also another component called TextView which just shows a text to the user which are the last 3 lines you see on both images. In this example I am asking for user first name, last name and email. Once they submit their information they would click on the purple register button and the information they entered is displayed on the TextView on the bottom.
Since the images/user input or text on the screen are just objects I had to figure out how do I make a connection to these objects so I can tell the app the logic on what to do if information is entered or if the register button is clicked. The way you make this connection is by assigning an ID to every single object on the screen. Once you do that in your XML file you use a method in your Java class to create an object of these items on your screen. There is a method that is called findViewById that you call to make a connection to the objects on the screen. Once you make this connection you can use them in your methods that will provide logic to these items in case they are interacted with. Android Studio has many built in methods that are already in place that you can call on in case a button is clicked, user enters information and so much more. I am excited to keep learning and building on my skills.
Can't wait to see more.
ReplyDelete