#BUILD SIMPLE ANDROID APP CODE#
The end result of the above few lines of code will look like this: This is what the app would look like Changing the colours of the AppĪdditionally, let’s change the colours to the app, these will be visible on the title bar when we run the app, and when the EditText is selected. We have set the inputType attribute of the EditText to ‘textMultiLine’ this will allow the user to input multiple lines of text.
Basically, they are used to set the constraints (boundaries), positioning of elements relative to each other. : These attributes are specific to elements in a ConstraintLayout. You’ll observe a lot of attributes here, here is a description of what they do: EditText allows the user to enter text input it could be anything – email, password, numeric input etc.īutton provides a clickable interface for performing certain actions. We’ve added two widgets: EditText and Button. Now, for the Button, add the following code right after the EditText code.: Ideally, it should be big and have lots of space since it is the main part of our app. I’ll be illustrating the code part of it since it is easy to explain in a textual tutorial.įirst, the EditText. Android Studio provides an intuitive drag and drop interface to design app visuals. As you might have observed earlier, the designing part of an activity is done using XML. Let’s move forward to the designing part. In this app, we’ll be working with a single activity. Java File Building the interface of the scratchpad app in Android.
#BUILD SIMPLE ANDROID APP HOW TO#