Android Tutorial for Beginners 7 # Adding Two Numbers App (Simple Calculator)



In this Android Video Tutorial we will see How to create an Android Application to Add two numbers or create a very simple basic Calculator. Adding two numbers in android using android studio will give you an actual feel of how the code logic works in Android.
We will write the Add Two Number Source code code to add two numbers. Android Application Development of Addition of Two number will not be very difficult. We will also see How to take input from users and add 2 numbers in android.
———————-Follow———————————————
My Website – http://www.codebind.com
My Blog – https://goo.gl/Nd2pFn
My Facebook Page – https://goo.gl/eLp2cQ
Google+ – https://goo.gl/lvC5FX
Twitter – https://twitter.com/ProgrammingKnow
Pinterest – https://goo.gl/kCInUp
Text Case Converter – https://goo.gl/pVpcwL
————————-Stuff I use to make videos ——————-
Stuff I use to make videos
Windows notebook – http://amzn.to/2zcXPyF
Apple MacBook Pro – http://amzn.to/2BTJBZ7
Ubuntu notebook – https://amzn.to/2GE4giY
Desktop – http://amzn.to/2zct252
Microphone – http://amzn.to/2zcYbW1
notebook mouse – http://amzn.to/2BVs4Q3
——————Facebook Links —————————————-
http://fb.me/ProgrammingKnowledgeLearning/
http://fb.me/AndroidTutorialsForBeginners
http://fb.me/Programmingknowledge
http://fb.me/CppProgrammingLanguage
http://fb.me/JavaTutorialsAndCode
http://fb.me/SQLiteTutorial
http://fb.me/UbuntuLinuxTutorialsBusiness Marketing Online – Finding the Time!

/> http://fb.me/EasyOnlineConverter
——————-Online Courses to learn—————————-
Java – https://bit.ly/2H6wqXk
C++ – https://bit.ly/2q8VWl1
AngularJS – https://bit.ly/2qebsLu
Python – https://bit.ly/2Eq0VSt
C- https://bit.ly/2HfZ6L8
Android – https://bit.ly/2qaRSAS
Linux – https://bit.ly/2IwOuqz
AWS Certified Solutions Architect – https://bit.ly/2JrGoAF
Modern React with Redux – https://bit.ly/2H6wDtA
MySQL – https://bit.ly/2qcF63Z

46 thoughts on “Android Tutorial for Beginners 7 # Adding Two Numbers App (Simple Calculator)”

  1. public void Sum(View view) {

    if (etfirst.getText().length()>0 && etsecond.getText().length()>0) {

    int first, second, result;

    first = Integer.parseInt(etfirst.getText().toString());

    second = Integer.parseInt(etsecond.getText().toString());

    result = first + second;

    etresult.setText(String.valueOf(result));

    }

    else {

    Toast.makeText(this, "Please Enter Value", Toast.LENGTH_SHORT).show();

    }

    }

    Reply
  2. Wow! Amazing job! I guess you could say that it's right at my level. Although not every single basic thing is explained, nearly everything that I needed to know was thoroughly explained. The text was large and clear. You didn't just write a novel and pretend that we understood, but rather, you explained what things do and how they link up. Thanks a lot! I'll continue to the next app tutorial in your series. I look forward to trying more!

    Reply
  3. HOW CAN I RUN?
    WHEN I CLICK ON RUN BUTTON I AM HANGIING A LOT AND PLEASE TRY AGAIN OR WAIT THIS KIND OF MESSAGE GETTING

    Reply
  4. EditText e1 = (EditText)findViewById(R.id.editText);
    EditText e2=(EditText)findViewById(R.id.editText2);
    TextView t1 =(TextView)findViewById(R.id.textView);
    int num1 = Integer.parseInt(e1.getText().toString());
    int num2 = Integer.parseInt(e2.getText().toString());
    int sum = num1+num2;
    t1.setText(Integer.toString(sum));
    error at line no 1.
    2. EditText
    3.TextView
    even here
    t1.setText(Integer.toString(sum));
    pls update video correctly

    Reply
  5. This man hasn't explained anything like (What is R, Why we are passing View type of argument in the function). He just kept on dictating the stuff which might be written on a paper beside him.

    Reply
  6. Can I use this tutorial in a Linux based platforms too… I have Ubuntu installed Now…. Will it be same or differ to windows users… Thank you. Appreciated…

    Reply
  7. hey ,
    can you please explain me these lines ??
    EditText a = (EditText)findViewById(R.id.editText);
    EditText a2 = (EditText)findViewById(R.id.editText2);
    TextView t = (TextView)findViewById(R.id.textView);

    thanks

    Reply
  8. Hi, can you please help me with this persisting error: "Cannot resolve symbol method ParseInt(String)". How can I add this method??
    Much appreciated!

    Reply
  9. Everything works in the 'design' section of activity_main. However, it doesn't work on the emulator. The background is black and all the text is in the left top corner. Whenever I change colours it works in the design but not on the emulator. Help.

    Reply
  10. there is problem during write public void onbuttonClick(view v) this statement create an error… after using ALT+Enter

    Reply
  11. Whenever the emulator starts, I m getting only the sum button rather than num1 and num2 texts..What would be the reason?
    Yeah..Explanation for code will also be helpful..

    Reply
  12. I added two Number text boxes and a button on the activity, they are looking fine at the time of designing but when I run them in Emulator the text boxes and button overlap. Please help me to fix it.

    Reply
  13. FOR ANYONE WHO HAS ALL THE BOTTONS AND TEXT IN THE TOP LEFT CORNER!!!!!!!!!
    To solve this you need to do the following…
    You will know that you have this problem because if you go to the text version of the xml, it will show that <EditText (or <WIDGET whatever the widget happens to be) will be underlined red
    Right-click widget-in-question > Constraint Layout > Infer Constraints:

    this will fix the problem.
    Enjoy!

    Reply

Leave a Comment