C#使用Xamarin開發(1)


很早就嘗試了移動開發,曾用Android studio學習了一下. 

一直沒有開發的動能. vs2017開始直接可以Xamarin進行移動開發,開始嘗試一下.

什么是Xamarin?Xamarin

From Wikipedia, the free encyclopedia
Xamarin is a Microsoft-owned  San Francisco, California-based software company founded in May 2011 [3] by the engineers that created  Mono, [4]  Mono for Android and  MonoTouch, which are  cross-platform implementations of the  Common Language Infrastructure (CLI) and Common Language Specifications (often called Microsoft .NET).

With a C#-shared codebase, developers can use Xamarin tools to write native AndroidiOS, and Windows apps with native user interfaces and share code across multiple platforms, including Windows and macOS.[5]According to Xamarin, over 1.4 million developers were using Xamarin's products in 120 countries around the world as of April 2017.[6]

On February 24, 2016, Microsoft announced it had signed a definitive agreement to acquire Xamarin.[7]

Hello world!

.Hellow world

按Vs2017導引,順利創建一個空白Andriod項目,在畫面放入一個Button

在 MainActivity創建時:

Button helloButton = FindViewById<Button>(Resource.Id.buttonHello);
helloButton.Click += delegate { Toast.MakeText(this, "Procedimento de logon ", ToastLength.Long).Show(); };

 

.發布至模擬器

在設備管理中,增加一個模擬手機.第一次啟動與真機一樣慢.

啟動后,在IIS的調試選項上看到這個ADV了

 

.發布至Android手機

我是華為手機,連到電腦,在設置中,打開關於手機,在型號處連擊五下,進入開發者模式.

在設置中,打開開發者選項,打開調試模式.

電腦順利認到,還是相當方便

重新打開iis,在調試選項上看到世界名牌華為了.click 運行.手機正常下載安裝.

click button.正確的回應

太棒了

 

.發布到Ios手機

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM