Xamarin Certification Trivia 3 — Questions and Answers
Question 1: What is the primary purpose of the Xamarin.Essentials library?
- Database access
- Cross-platform native device APIs (Correct answer)
- UI component library
- Dependency injection
Correct answer: Cross-platform native device APIs
Xamarin.Essentials provides a single cross-platform API for accessing native device features like GPS, sensors, and secure storage.
Question 2: In Xamarin.Forms, which layout positions children in a single row or column?
- AbsoluteLayout
- RelativeLayout
- StackLayout (Correct answer)
- GridLayout
Correct answer: StackLayout
StackLayout arranges child views in a single line, either horizontally or vertically.
Question 3: What file extension is used for Xamarin.Forms XAML files?
- .xf
- .xaml (Correct answer)
- .xml
- .forms
Correct answer: .xaml
Xamarin.Forms uses the .xaml file extension, the same as WPF and UWP XAML files.
Question 4: Which binding mode in Xamarin.Forms updates the source when the target property changes?
- OneWay
- TwoWay
- OneWayToSource (Correct answer)
- OneTime
Correct answer: OneWayToSource
OneWayToSource binding updates the source (ViewModel) when the target (UI) property changes.
Question 5: What is the Xamarin.Forms equivalent of a native iOS UITableView or Android RecyclerView?
- TableView
- ListView (Correct answer)
- CollectionView
- ScrollView
Correct answer: ListView
ListView is the traditional Xamarin.Forms control for displaying scrollable lists of items, analogous to platform list views.
Question 6: Which attribute in Xamarin.Android is used to register a class as an Android Activity?
- [Register]
- [Activity] (Correct answer)
- [Service]
- [Export]
Correct answer: [Activity]
The [Activity] attribute in Xamarin.Android registers a C# class as an Android Activity in the manifest.
Question 7: What is Hot Reload in the context of Xamarin development?
- A way to restart the app faster
- Live updating of XAML changes without rebuilding (Correct answer)
- Reloading NuGet packages
- Refreshing API data at runtime
Correct answer: Live updating of XAML changes without rebuilding
XAML Hot Reload allows developers to see UI changes reflected live in the running app without a full rebuild.
What is the primary purpose of the Xamarin.Essentials library?