Introduction
Xamarin is a platform to develop cross-platform and multi-platform apps (for example, Windows phone, Android, iOS). In Xamarin platform, the code sharing concept is used. In Xamarin Studio, Visual Studio is also available. Create SQLite database with ADO.NET.
Prerequisites
- Visual Studio 2015 Update 3.
The steps, mentioned below, are required to be followed in order to create ADO.NET database in the Xamarin Android app, using Visual Studio 2015.
Step 1
Click File--> select New--> select Project. The project needs to be clicked after opening all the types of projects in Visual Studio or click (Ctrl+Shift+N).

Step 2
After opening the New Project, select Installed-->Templates-->Visual C#-->Android-->choose the Blank app (Android). Now, give your Android app; a name (Ex:sample) and give the path of your project. Afterwards, click OK.

Step 3
Now, go to Solution Explorer. In Solution Explorer, get all the files and source code in your project. Now, select Resource-->Layout-->double click to open main.axml page. You need to select the source to write XAML code. Choose the Designer Window, if you want to design it, and you can design your app.

Step 4
After opening main.axml, file will open the main page designer. You can design the page, as per your desire.

Now, delete Default hello world button, go to the source panel and you can see the button coding. You need to delete it. After deleting XAML code, now delete C# button action code. Go to MainActivity.cs page. You need to delete the button code.
Step 5
Now, go to the toolbox Window. In the toolbox Window, get all the types of the tools and controls. You need to go to the toolbox Window. Now, scroll down. You will see all the tools and controls.
You need to drag and drop the button.

Step 6
You need to drag and drop the TextView.

Step 7
You need to drag and drop the TextView.

Step 8
Now, go to the properties Window. You need to edit the button's Id value and Text Value (EX: android:id="@+id/btnCreateDB" android:text="Create Database").

Step 9
Edit the TextView's Id value and Text Value (Ex: android:id="@+id/textView1"android:text="Results").

Step 10
Also, edit the TextView's Id value (Ex: android:id="@+id/txtResults").

Step 11
In this step, go to Main.axml page Source Panel. Note, the button's Id value.and also note TextView Id values.
Main.axml
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:weightSum="1">
- <LinearLayout android:orientation="horizontal" android:minWidth="25px" android:minHeight="25px" android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/linearLayout1" android:layout_weight=".2" android:gravity="center">
- <Button android:text="Create Database" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/btnCreateDB" /> </LinearLayout>
- <LinearLayout android:orientation="vertical" android:minWidth="25px" android:minHeight="25px" android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/linearLayout2" android:layout_weight=".6" android:layout_marginLeft="5dp" android:layout_marginRight="5dp">
- <TextView android:text="Results" android:textAppearance="?android:attr/textAppearanceMedium" android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/textView1" android:textColor="#fff" />
- <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/txtResults" android:layout_marginTop="5dp" /> </LinearLayout>
- <LinearLayout android:orientation="horizontal" android:minWidth="25px" android:minHeight="25px" android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/linearLayout3" android:layout_weight=".2" /> </LinearLayout>













Join the conversation! Your thoughts help the community grow.