AndroidHow To

Learn how to Develop Basic Rectangular App for Android

Hello all,

Today, I introduce one more Android tip, a basic simple Android Application, basic rectangular. I will develop a simple application to calculate the parimeter and the area of a rectangular.

Purpose of this application:

  • Be familiar with Android environment development.
  • Be familiar with an Android project organization.
  • Create an Android project, basic layout.
  • Know about basic java.
  • Know about three basic widgets: TextView, EditText and Button.
  • Know about Click event for Button.

Let’s do it

I. IN ACTIVITY_MAIN.XML

  • Create 2 Edit Text for 2 values: Length and Width

 

 

  • Create a Button to calculate the perimeter and the area

 

  • Create a Text View to show the result.

 

II. IN MAINACTIVITY.JAVA

  • Create Text View, Edit Text and Button.

 

  • In btn_result, add setOnClickListener event for the button.

 

  • In onClick class, I create length and width variables, get the values from Edit Text and add to length and width variables.

 

  • Create perimeter and area variables.

 

  • Final, I add the result to the Text View.

sdsd

About author

Articles

Morris is a Technology enthusiast and a writer by night. He has been a part of TheTechly for quite some time and he contributes knowledgeable news articles from the Technology niche.
Related posts
How To

How to Make Aging Easier for Those in Their Senior Years

Aging is an inevitability in everyone’s life. It is a time when our mind and body begins to slow…
Read more
How To

Hiring for a Startup: How to Find the Right Hires

For startups, the right hires can make a huge difference. They can be the foundation upon which you…
Read more
BusinessHow To

How Long-Tail Keywords Unlock Small Business Search Traffic

‘Men’s shoes’. ‘Buy men’s shoes’. ‘Shoes for men’. The head term keywords that…
Read more
Newsletter
Become a Trendsetter

Sign up for TheTechly’s Daily Digest and get the latest and trending technology updates.

[mc4wp_form id="729"]