Simple App with Basic features
Hi friends in this post we are going to learn about how to
create a App which get two values from the user and perform the arithmetic
operations according to user specified, ie. Simple calculator.
Basic UI features required for this App is,
·
2 EditText ->To get Input.
·
4 Button -> Arithmetic operations denoting
Add, Sub, Mul, Div.
·
1 TextView -> Display Output.
- Create a New App similarly done in previous post, and Design the UI based on above features.
- First insert two EditText to get numbers from the user by drag and drop from the palette Text Fields column. Since we are going to perform arithmetic operations choose the EditText whose Input type as Number (Recommended). You may also able to select it in the properties column of the EditText, which will appear on right side of our SDK.
3. Insert four buttons (Add, Sub, Mul, Div)
similarly in the Layout, it should be functioned as by pressing each button you
may get corresponding result of the operation. We will set the buttons easily in
order by changing the layout to linear layout (Horizontal) it will provide us great
flexibility to set the buttons in a single horizontal row which looks better.
- · Drag and Drop four buttons to the layout from palette Form Widgets
- Change the Layout to Linear layout (Horizontal) for particular buttons by dragging Linear Layout(Horizontal) from palette
- Now you can able to set 4 buttons horizontally one another inside the Linear Layout (Horizontal) .
Thus the design part get over and show your own logic in the coding and finish your second app with some basic features.
0 comments:
Post a Comment