SlideShare a Scribd company logo
Simplest calculator app using android studio   android workshop
Date: 6- Feb -2015
First Android App
info@baabtra.comharis@baabtra.com
❏ Calculator APP with simple ADD
functionality
Contents
Simplest calculator app using android studio   android workshop
package com.baabtra.baabtracalc;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.EditText;
import android.widget.Button;
LoadingScreen.java
public class LoadingScreen extends ActionBarActivity implements
View.OnClickListener {
Button mButton;
EditText Txt_FirstNumber, Txt_SecondNumber, Txt_Result;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_loading_screen);
mButton = (Button)findViewById(R.id.button);
Txt_FirstNumber = (EditText)findViewById(R.id.editText);
Txt_SecondNumber = (EditText)findViewById(R.id.
editText2);
Txt_Result = (EditText)findViewById(R.id.editText3);
mButton.setOnClickListener(this);
}
public void onClick(View v) {
int int_fn = Integer.parseInt(Txt_FirstNumber.getText().
toString());
int int_sn= Integer.parseInt(Txt_SecondNumber.getText().
toString());
int int_tmp_result = int_fn + int_sn;
Txt_Result.setText("Result : " + Integer.toString
(int_tmp_result));
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is
present.
getMenuInflater().inflate(R.menu.menu_loading_screen,
menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
● Linear Layout
● Heading - Baabtranz Calculator
● three text boxes - First number, Second
Number and Result
● Thee labels - TextViews - First Number,
Second Number and Result
● One Button - Add button
Lay out of the app
Simplest calculator app using android studio   android workshop
Simplest calculator app using android studio   android workshop
Simplest calculator app using android studio   android workshop
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="match_parent" tools:context=".LoadingScreen"
>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="@string/heading"
android:id="@+id/textView3"
android:background="#ff1623ff"
android:capitalize="characters"
android:clickable="false"
android:textColor="#ff35ffb6"
android:textSize="@dimen/abc_action_bar_progress_bar_size" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text= "@string/first_number"
android:id="@+id/textView2" />
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="number"
android:ems="10"
android:id="@+id/editText" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="@string/second_number"
android:id="@+id/textView4" />
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="number"
android:ems="10"
android:id="@+id/editText2" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text= "@string/Result"
android:id="@+id/textView" />
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="number"
android:id="@+id/editText3" />
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="ADD"
android:id="@+id/button" />
</LinearLayout>
US UK UAE
7002 Hana Road,
Edison NJ 08817,
United States of America.
90 High Street,
Cherry Hinton,
Cambridge, CB1 9HZ,
United Kingdom.
Suite No: 51, Oasis Center,
Sheikh Zayed Road, Dubai,
UAE
Email to info@baabtra.com or Visit baabtra.com
Looking for learning coding or software
engineering?
India Centres
Emarald Mall (Big Bazar Building)
Mavoor Road, Kozhikode,
Kerala, India.
Ph: + 91 – 495 40 25 550
NC Complex, Near Bus Stand
Mukkam, Kozhikode,
Kerala, India.
Ph: + 91 – 495 40 25 550
Cafit Square IT Park,
Hilite Business Park,
Kozhikode
Kerala, India.
Email: info@baabtra.com
TBI - NITC
NIT Campus, Kozhikode.
Kerala, India.
Start up Village
Eranakulam,
Kerala, India.
Start up Village
UL CC
Kozhikode, Kerala
Simplest calculator app using android studio   android workshop
Simplest calculator app using android studio   android workshop

More Related Content

DOCX
Hola mundo12
PPTX
Objective c design pattens-architetcure
DOCX
PPTX
Learning Android Part 2/6
PDF
View controller life cycle
PPTX
Progressive loading with Steal
PPTX
Fun with RecyclerView
Hola mundo12
Objective c design pattens-architetcure
Learning Android Part 2/6
View controller life cycle
Progressive loading with Steal
Fun with RecyclerView

Viewers also liked (10)

ODP
Android tutorials7 calculator
PDF
Calculator 3
PPTX
PDF
Android Livecoding Series
PPTX
[IWIC2015 - PROPOSAL] CALCULATHINGS - A fully customizable calculator for any...
PDF
UtilityCostCalcCode
PDF
Getting started as an android developer
PPTX
The calculator
PDF
Sample project abstract
DOC
My Project Report Documentation with Abstract & Snapshots
Android tutorials7 calculator
Calculator 3
Android Livecoding Series
[IWIC2015 - PROPOSAL] CALCULATHINGS - A fully customizable calculator for any...
UtilityCostCalcCode
Getting started as an android developer
The calculator
Sample project abstract
My Project Report Documentation with Abstract & Snapshots
Ad

Similar to Simplest calculator app using android studio android workshop (10)

ODP
Android tutorials7 calculator_javaprogramming
ODP
Android tutorials8 todo_list
ODP
Android tutorials7 calculator_basiclayout
PDF
Android Best Practices
PDF
Android App Development 03 : Widget &amp; UI
ODP
Android tutorials8 todo_list
PDF
Improving android experience for both users and developers
PDF
Droidcon2013 android experience lahoda
PDF
How to use data binding in android
KEY
안드로이드 세미나 2
Android tutorials7 calculator_javaprogramming
Android tutorials8 todo_list
Android tutorials7 calculator_basiclayout
Android Best Practices
Android App Development 03 : Widget &amp; UI
Android tutorials8 todo_list
Improving android experience for both users and developers
Droidcon2013 android experience lahoda
How to use data binding in android
안드로이드 세미나 2
Ad

More from baabtra.com - No. 1 supplier of quality freshers (20)

PPTX
Agile methodology and scrum development
PDF
Acquiring new skills what you should know
PDF
Baabtra.com programming at school
PDF
99LMS for Enterprises - LMS that you will love
PPTX
Chapter 6 database normalisation
PPTX
Chapter 5 transactions and dcl statements
PPTX
Chapter 4 functions, views, indexing
PPTX
PPTX
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
PPTX
Chapter 1 introduction to sql server
PPTX
Chapter 1 introduction to sql server
Agile methodology and scrum development
Acquiring new skills what you should know
Baabtra.com programming at school
99LMS for Enterprises - LMS that you will love
Chapter 6 database normalisation
Chapter 5 transactions and dcl statements
Chapter 4 functions, views, indexing
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
Chapter 1 introduction to sql server
Chapter 1 introduction to sql server

Recently uploaded (20)

PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PDF
How Creative Agencies Leverage Project Management Software.pdf
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
medical staffing services at VALiNTRY
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
System and Network Administration Chapter 2
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PPTX
Essential Infomation Tech presentation.pptx
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
How Creative Agencies Leverage Project Management Software.pdf
Which alternative to Crystal Reports is best for small or large businesses.pdf
How to Choose the Right IT Partner for Your Business in Malaysia
Odoo POS Development Services by CandidRoot Solutions
Wondershare Filmora 15 Crack With Activation Key [2025
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
medical staffing services at VALiNTRY
Upgrade and Innovation Strategies for SAP ERP Customers
PTS Company Brochure 2025 (1).pdf.......
Odoo Companies in India – Driving Business Transformation.pdf
System and Network Administration Chapter 2
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Design an Analysis of Algorithms II-SECS-1021-03
Essential Infomation Tech presentation.pptx
How to Migrate SBCGlobal Email to Yahoo Easily

Simplest calculator app using android studio android workshop