- Xamarin Blueprints
- Michael Williams
- 124字
- 2021-07-08 11:48:22
Setting up the SpeechTalk.Droid project
Let's do the same for Android and set up Xamarin.Forms
accordingly. Inside our Android project, open the MainActivity.cs
class and look at the OnCreate
function:
[Activity (Label = "SpeechTalk.Droid", Icon = "@drawable/icon", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)] public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsApplicationActivity { protected override void OnCreate (Bundle bundle) { base.OnCreate (bundle); global::Xamarin.Forms.Forms.Init (this, bundle); LoadApplication (new App ()); } }
The MainActivity
class must inherit Xamarin.Forms.Platform.Android.FormsApplicationActivity
; we must call the super class OnCreate
method before we initialize Xamarin.Forms
and load in our new instantiated app class. That's all, we can now run the Android application and see the exact same results, a blank page. Congratulations, you have just shared your first Xamarin.Forms
interface.
推薦閱讀
- Visual FoxPro程序設計教程(第3版)
- The Android Game Developer's Handbook
- PHP 從入門到項目實踐(超值版)
- 機械工程師Python編程:入門、實戰與進階
- 程序員修煉之道:通向務實的最高境界(第2版)
- Terraform:多云、混合云環境下實現基礎設施即代碼(第2版)
- Android項目實戰:手機安全衛士開發案例解析
- Node Cookbook(Second Edition)
- Python爬蟲、數據分析與可視化:工具詳解與案例實戰
- Learning iOS Security
- JSP程序設計與案例實戰(慕課版)
- Java Web開發基礎與案例教程
- 零基礎PHP從入門到精通
- AI輔助編程Python實戰:基于GitHub Copilot和ChatGPT
- Java語言GUI程序設計