Skip to content

JonathanMoreno14/Calculator-App-Xamarin-Android

Repository files navigation

Calculator-App-Xamarin-Android

This is a Calculator application created using C#, Xamarin, and Visual Studio.

The application computes basic arithmetic that consist of addition, subtraction, multiplication, division, and modulus arithmetic.

Main Screen Numbers/Computation Error Handling

main screen | numbers| error

###Getting Started

To get started with the mobile application you can clone or download the Zip file. Please note Xamarin Platform uses C# for the application development This Link is another repository that contains the basics of Object Oriented Programming in C# to get you started

  $ git clone  https://github.com/JonathanMoreno14/Calculator-App-Xamarin-Android.git

####How to Use

Once the repository has been downloaded you can use Xamarin Studio or Visual Studio. Visual Studio 2015 Community Edition contains Xamarin Starter Edition that is Free to use. Although it is free there are some limitations, you can create, build, and publish applications using Xamarin Starter Edition, as I found out you are limited with basics features. You are not allowed to use Libraries from Xamarin Components References.

Build Limitations

####For Windows and Mac OSX users

You must download Xamarin for your machine in order to utilize the platforms capabilities.

####Android Emulator

Similar to Andriod Studio and Eclipse, Xamarin has a version of an Android Emulator that you can utilize for your development.

##Addendum ####Computations Computations for this basic calculator application are simplistic that they can be done with other object-oriented programming languages.

The computation consist of the user input in a form of a string the input is then converted to a specific Data Type most if not all object-oriented programming languages have these specific data types double, int, long ...etc each programming language has special methods for converting integers and strings ; vice versa. Once the strings have been converted to the specific data type then you can compute the numbers and finally depending on the result you can converted back to string

####C Sharp

double a, b, c;

 protected  void addBtn()
        {    

            addButton.Click += delegate  //Delegates the button click for the addButton
            {
                try
                {
                  
                  a = double.Parse(firstValue.Text);   //converts string from edittext firstValue into double
                  b = double.Parse(secondValue.Text);   //converts string from edittext secondValue into double
                  c = a + b;  //computes both doubles 
                  result.Text = c.ToString();  
                  //Then converts the double back into a string using method ToString(); it is displayed in the results edittext
                   
                  
                }
                catch (Exception ex)  //This method catches an exception and the error results are displayed in the edittext
                {
                    

                    firstValue.Text = "Input Number(s)";
                    secondValue.Text = "Input Number(s)";
                    result.Text = "Invalid Operation";
                }
            };

About

Calculator application created using C#, Xamrarin, and Visual Studio

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published