HelloAndroid, pick a folder, click Create.HelloAndroid/ ├── Platforms/ │ ├── Android/ │ │ ├── MainActivity.cs # Android entry point │ │ └── AndroidManifest.xml # Permissions & metadata │ ├── iOS/ and Windows/ ├── Resources/ │ ├── AppIcon/ # All icon sizes │ └── Images/ ├── App.xaml # App-wide resources ├── AppShell.xaml # Navigation structure ├── MainPage.xaml # Your first UI page └── MainPage.xaml.cs # Code-behind
<ContentPage> <VerticalStackLayout Spacing="24" Padding="32" VerticalOptions="Center"> <Label Text="Hello, Android! 👋" FontSize="32" FontAttributes="Bold" HorizontalOptions="Center" /> <Button Text="Tap me!" Clicked="OnButtonClicked" HorizontalOptions="Center" /> </VerticalStackLayout> </ContentPage>
public partial class MainPage : ContentPage { int count = 0; public MainPage() => InitializeComponent(); void OnButtonClicked(object s, EventArgs e) => ((Button)s).Text = $"Tapped {++count} time{(count==1?"":"s")}!"; }
Figure: Running the first Android UI on the emulator.