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.
Prerequisites
- Visual Studio 2015 Update 3.
The steps, given below, are required to be followed in order to insert data in SQLite Data Base 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
Next, go to the Solution Explorer and select Resource-->Layout-->double click to open main.axml page.

Step 4
After opening, the main.axml file will open the main page designer. In this page, choose which type you want so you can design this page.

Next, delete the default "hello world" button from the source panel by deleting the button coding. Next, delete the C# button action code from MainActivity.cs page.
Step 5
In this step, add SQLite-net NuGet Package from Nuget Package Manager.
Go to Solution Explorer-->Your Project-->Right Click-->Manage Nuget Packages.

Step 6
Now Browse to search the SQLite Nuget Package. You need to select the SQLite-net and click Install.

Step 7
Now click ok to Install.

Step 8
In this step, design your app. Now, go to the toolbox window.and scroll down. You will see all the tools and controls.
You need to drag and drop the Button.

Step 9
Now, go to the Properties window. You need to edit the Button Id Value and Text Value(EX:android:id="@+id/btninsert" android:text="INSERT").

Step 10
In this step, go to the Main.axml page Source Panel. Note the Button Id Value.
Main.axml
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:minWidth="25px" android:minHeight="25px">
- <Button android:text="INSERT" android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/btninsert" /> </LinearLayout>

Step 11
Add one layout called Insert.axml.
Go to Solution Explorer-->Resource-->Layout-->Right click-->Add-->New Item(Ctrl+Shift+A).

Step 12
Now, select Android Layout and give name (Insert.axml).

Step 13
Now, go to the toolbox window and drag and drop two Plain Text (EditText).

Step 14
You need to drag and drop the Button.

Step 15
Now, go to the Properties window. You need to edit the PlainText(EditText) Id Value(EX:android:id="@+id/txtname").

Step 16
You need to edit the PlainText(EditText) Id Value(EX:android:id="@+id/txtemail").

Step 17
And also, edit the Button Id Value and Text Value (EX:android:id="@+id/btnsave" android:text="STORE").

Step 18
In this step, go to the Main.axml page Source Panel. Note the Button Id Value and EditText Id Values.
Insert.axml
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent">
- <TextView android:text="Store Data" android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/textView1" android:gravity="center" />
- <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/txtname" android:hint="NAME" />
- <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/txtemail" android:hint="[email protected]" />
- <Button android:text="STORE" android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/btnsave" /> </LinearLayout>

















Joss BossPosted Jan 18, 2018, 12:49 PM
Easy to understand for beginners
Pratik ShirsePosted Dec 4, 2016, 2:39 AM
Helpful info for mobile development for beginner....
Madhanmohan DevarajanPosted Nov 22, 2016, 12:40 PM
Very easy to understand the step by step guide, thanks!!