A brief introduction to Xamarin

Source: Internet
Author: User
Tags android sdk manager

1. installation

1) Use the standard installation process (JDK1.6--Android SDK, NDK--, Xamarin studio, and Xamarin Visual Studio)

2) Android SDK Manager Change source, can keep up to date, a mirror source address: mirrors.neusoft.edu.cn;ubuntu.buct.cn;port:80,android SDK directory Structure Introduction, Some related resources for Android (http://ubuntu.buct.edu.cn/android/repository/).

3) Windows side hack process Two steps: Replace IDE DLL, two locations, one is under the common of VS, under the bin of Xamarin Studio, replace corresponding version of Mandroid.exe and Mtouch.exe

4) Mac side hack process, Mac side only responsible for iOS-related things, regardless of the development of Android on the Mac side, the first thing to install include: monoframework-mdk-3.12.1.3.macos10.xamarin.x86.pkg; monotouch-8.8.2.4.pkg; xamarinstudio-5.8.2.7-0.dmg; (version number note to match, now this series of version numbers matches the Windows side of the 3.9.525)

After the installation of the main to replace three things:/developer/monotouch/usr/bin/mtouch-64;

After the Mtouch-64 is replaced, the command must be executed at the terminal: chmod a+x/developer/monotouch/usr/bin/mtouch-64

Then replace the/applications/xamarin Studio.app/contents/resources/lib/monodevelop/addins/xamarin.ide/xamarin.components.ide.dll

Finally replace

/applications/xamarin.ios Build Host.app/contents/monobundle/xamarin.components.ide.dll

2. Analog Device

1) You can use Xamarin Android player without using Android's standard emulator, which is said to perform better, but the copyright reason hasn't been tested yet.

2) If you use a standard emulator, you can configure hardware acceleration

A) First, your CPU must support Intel Virtualization technology if it supports the Biso open

b) Use the Android SDK to download the system image for the corresponding x86 architecture

c) Download the latest HAXM virtual engine on Intel's website or download it directly from the SDK

d) need to install manually after downloading, if double-click installation is invalid, run cmd with administrator privileges, execute the bat file under the installation directory, if the prompt does not support Intel virtualization technology, but we confirm that it is open, it may be because the operating system installed Hyper reason, Uninstall hyper Restart and try again

e) Enter the AVD to create a X86-based virtual machine

3. The file structure referenced by Android

Folder

Role

Components

Login to the Xamarin account to download some of its official components directly to use

Assets

Store a range of local resources such as fonts, local databases, configuration files, etc.

Properties

In addition to the General Assembly version number and other information, including the Android program's permission description file Androidmanifest.xml

Resources

Package good strings,images, layout and other resources folder, note the program's view interface is also under the folder, also includes a AboutResources.txt resource description file

4. Android Apps the logical Structure
Android apps are different from traditional apps, there is no single point of entry, the app is tied to the Android operating system, and the operating system can load the application process into a memory-activated app at any time. So there is an activity concept in the application, and an application consists of a lot of activity.
Characteristics of activity:
  
Label: Tell the operating system which program this class belongs to, and it will go to the androidmanifest.xml to match.
Mainlauncher: tells the operating system which page to activate after opening the program.
Life cycle of activity:
Created, started and paused, resumed and destroyed, and so on.
Implement your own logic by overriding the life cycle method of the base class, such as: OnCreate (the application is loaded into memory Si cho once), Onresume (triggered when the activity returns to the device interface after the device performs another task), OnPause (the device will perform other tasks, Triggered when the activity leaves the device interface)
   
5. xamarin.forms related 1) Introduction

Can cross-platform build user interaction related things, in short, write a set of code three platform generic, on this basis can be combined with the unique Xamarin local code of the platform.

Forms, in addition to the cross-platform benefits of unexpected, also support the XAML authoring user interface, without the help of third-party framework such as Goft.Mvvm.light support data binding.

2) using pre-conditions

Android4.0 above;

IOS6.1 above;

development environment VS2013;

The solution must be. Net4.5 above,PCL template, Vs2013update2 can use Sharedproject.

3) Applicable program

Xamarin.Forms

Xamarin.ios & Xamarin.android

With simple data display as the main

The program will use a special interaction

Rapid prototyping, Concept class program

Interface UI is well-designed program

Only a small number of platform special features (APIs) are used

will use a lot of platform special functions (API)

Shared code is more important than user UI

User UI is more important than shared code

4) Xaml related

Forms to make the interface fine-tuning for each platform Onplatform

5) Formsfqa

The first time you run the forms program will prompt "Cannot link to remote server", see here for details

Verify the project is selected to being deployed in the solution Configuration Manager. Look at the details here.

6. MVVM related

Three sets of frames: Mvvmcross, Mvvmlight, Xamarinformslab

Http://blog.galasoft.ch/posts/2014/05/mvvm-light-v4-4-with-xamarin-android-support/?utm_source=tuicool

Mvvmlight for Android requires Android version above 2.3 (API10)

7. FQA

1) A long-entangled problem, the Android design interface layout can not be loaded, reported what network error, the original because Android The SDK upgrades the latest tools to 24.3, the newest version of the SDK will cause this error on Xamarin, if using the latest Xamarin has fixed this error, if you do not want to update Xamarin will need to do the SDK downgrade operation

2) Limit the screen rotation function, specify that the program can only use a vertical screen or a horizontal screen, refer to "Xamarin Forms Preview Edition 2", chapter fifth, (PDF 101) page.

8. Other Resources

Install, crack: http://www.jianshu.com/p/c67c14b3110c

A brief introduction to Xamarin

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.