很早就嘗試了移動開發,曾用Android studio學習了一下.
一直沒有開發的動能. vs2017開始直接可以Xamarin進行移動開發,開始嘗試一下.
什么是Xamarin?Xamarin
With a C#-shared codebase, developers can use Xamarin tools to write native Android, iOS, 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手機