Xamarin Android, xamarinandroid

Source: Internet
Author: User

Xamarin Android, xamarinandroid
Preface:

It has been more than two years since I registered in the blog Park. It is almost three years. You have registered this account in the blog garden since you started learning this line. So far, I have not written any essays. Most of the time I dive in the garden, read articles written by Daniel, and learn.

Blog writing is a summary of your own learning. Xamarin, which was learned since January last October, has no Android Foundation, so it has only been written for two years. net basics. Then I started to use it for commercial projects, just me. My God,

It's crazy to torture people, but so far we have finished the first and the second.

Andriod Development Environment Configuration:

I am using VS2015 update2. At this year's Build2016 conference, Microsoft announced free Xamarin, which is undoubtedly a benefit for c # developers. Attached VS2015:

Ed2k: // | file | cn_visual_studio_enterprise_2015_with_update_2_x86_x64_dvd_8510289.iso | 7633639424 | E0AFC01631C37BD3046EDBBC30FAB8CC |/
SHA1: 93651E6653EB39D6B01EFE8543EA2204B7B0EBD3
 
If you need the SDK, you can download the SDK and install the SDK using FQ. We recommend that you download the android SDK separately. Find some domestic images.
The first Android program:
1. Create and select a blank APP

 

Open a Resource folder, which contains three folders: drawable, layout, and values.

Drawable: stores some resource files and fragments.

Layout: XML file for screen layout (or part of the screen)

Values: XML files for many types of resources,

Colors. xmlDefines the color drawable and the color string value (color string values ).

Strings. xmlDefines the string value.

Styles. xmlDefine a style object.

2. Open the Main. axml file and you will find the following interface. Ugly. We will discuss how to beautify the interface later. This article only shows how to run the first AndroidAPP.

Click the source at the bottom of the interface to find the following interface layout file. If you have WPF programming, you should be familiar with it. Although Xamarin supports manual Drag Control,

However, I personally think it is too low. Many nice-looking interface la S should be compiled by myself.

3. Since main. axml is introduced, next we will introduce the corresponding Activity. The interface layout is called Main, and the corresponding Activity layout name must be MainActivity.

4. How to run it? Since it is an Android APP, it cannot always run on the Iphone or WIndowsPhone. Naturally, an android phone is needed.

If not, you can use the android simulator. For simulators, we recommend that you use GenyMotion or Microsoft Emulator, Google's virtual machine.

It's called a trap. Who knows it. The official Genymotion address is included at http://www.genymotion.net/. you can download the package at registration, and assign it to your personal and Enterprise Edition for free.

PS: We recommend that you use a virtual machine. If you debug a real machine, you have to install a mobile phone driver.

Attached is a Genymotion startup diagram:

If you can see the interface, congratulations, at least you have configured the Android environment correctly.

5. Try to debug the program and place a breakpoint on the button. click of MainActivity. You will find that the program has been debugged.

 

Summary

Developing android with C # is so simple. We hope that C # developers can provide great support and expand the ecosystem.

This is also the first time that the younger brother wrote a blog post. I really don't know how to arrange it. Sorry. Later, I will write some articles on Xamarin android,

I will write my own learning about Android from scratch and use it for business projects, and some problems.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.