Xamarin Android's Starter Chapter

Source: Internet
Author: User

Preface:

Registered in the blog park has been more than 2 years, almost three decades. From the beginning to learn this line began to register in the blog Park this account. So far has not written an essay, most of the time is in the garden diving, read the article Daniel wrote, study.

Blog is not why, is their own study of a summary. Xamarin, which has been studying since last October, has only written 2. NET Foundation without an Android foundation. And then just start using it for a commercial project, just me alone. Oh, my God.

To torture people crazy, but so far, has done the first one, began the second one.

Andriod Development Environment Configuration:

I'm using the VS2015 update2 version, and Microsoft announced the free Xamarin at this year's Build2016 conference, 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
 
Need friends can download, installation needs FQ, recommended to download ANDROIDSDK separately. Look for some domestic mirrors.
First Android App:
1. New Select Blank App
 
 

Open will find a resource folder, there are drawable,layout,values three folders

Drawable: Storing some resource files, tablets

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

Values: XML files of many kinds of resources,

colors.xml defines a string value (color string values) of color drawable and colors.

The strings.xml defines a string (string) value.

Styles.xml defines a style object.

2. Open the Main.axml file, you will find the following interface. It's ugly. I'll talk about how to beautify the interface later. This article is only for how to run up the first Androidapp.

Click on the source below the interface to find the following interface layout files, with WPF programming students, should look and familiar. Although Xamarin supports manual drag-and-drop controls,

But personally feel too low, a lot of good-looking interface layout or to write their own.

3. Since the introduction of Main.axml, followed by the corresponding activity, the interface layout is called Main, the corresponding activity layout name is definitely mainactivity.

4. What is the next step to get it running? Since it's an Android APP, it's not always possible to run on iphone,windowsphone, which naturally requires an Android phone.

If not, you can use the Android simulator. Simulator, I recommend you use: Genymotion or Microsoft's emulator, Google's virtual machine

It's called a pit, who knows who it is. Attached Genymotion official address: http://www.genymotion.net/, need to register to download, personal free version and Enterprise Edition.

PS: It is recommended to use virtual machine, real machine debugging, you have to install mobile phone driver, trouble.

Attach a genymotion start chart:

If you can see the interface, congratulations, at least your Android environment is at least configured.

5. Try to debug the next program, in the mainactivity Button.Click break breakpoint, will find into the debugging.

Summarize

The development of Android in C # is so simple, I hope that the vast number of C # developers can support, can well expand the biosphere.

This is the first time I wrote a blog, the format does not know how to row, forgive me. Later will be writing some of the Xamarin Android articles,

Will write yourself from scratch to learn Android and use it for business projects encountered problems, and some problems encountered.

Xamarin Android's Starter Chapter

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.