Android app in xamarin for beginner’s part 1



What is xamarin ?
Xamarin provide cross platform technology to write apps for android,ios and mac in c# .
     Let’s start create our first android app by using xamarin
   
2. After installation you will get the xamarin studio .
3. For create new project navigate file->new ->solution and select
Android application from android under c#,then give your project name on name field  .


4. You will get a window like this
In this ” MainActivity.cs” is for writing our c# codes
This line is information about the project name, whether it is main or not  and the project icon 

5. Select  Main.axml  under layout folder

6. Drag a button from toolbox to the “Main.axml” and right click for properties  

7. Change button id and text




8.Go to MainActivity.cs  create a delegate
 
This code of line for finding our button from  Main.axml” file
Write this code for working button click (actualy it is delegate for button clik)

And create event for button click by using this block of codes
Toast.MakeText (this"hai welcome"ToastLength.Short).Show ();

This line code using toast message of “hai welcome"
Build your application (build your application after every modification in layout)



9. Then take a short breath: p and we are going to launch our first android application by xamarin
Run with pre created virtual machine of galaxy mobile
Yup now galaxy is starting
...........................................
After waiting some moments open my machine J  .click find button to see “hai welcome ”

If you have any query or doubt don’t hesitate to comments :)
Happy coding




Share on Google Plus

About h

Please leave your valuable comments !!
    Blogger Comment
    Facebook Comment

2 comments :

  1. Interesting article on Android app in xamarin for beginner.

    Helpful to become Xamarin Developer.

    Thank you for the giveaway!



    ReplyDelete