This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PeopleRepository | |
{ | |
private SQLiteConnection db = null; | |
protected static PeopleRepository me; | |
static PeopleRepository() | |
{ | |
me = new PeopleRepository(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsApplicationActivity | |
{ | |
protected override void OnCreate(Bundle savedInstanceState) | |
{ | |
base.OnCreate(savedInstanceState); | |
global::Xamarin.Forms.Forms.Init(this, savedInstanceState); | |
// This will load all tests within the current project | |
var nunit = new NUnit.Runner.App(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Test] | |
public void one_new_person_inserted_adds_one_new_row() | |
{ | |
// given | |
var person = new Person() | |
{ | |
Name = "A", | |
LastName = "B" | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public SQLiteAsyncConnection InMemorySqliteConnection; | |
[OneTimeSetUp] | |
public void Init() | |
{ | |
InMemorySqliteConnection = new SQLiteAsyncConnection(":memory:"); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void ListView_ItemClick(object sender, AdapterView.ItemClickEventArgs e) | |
{ | |
var person = _peopleList[e.Position]; | |
var uri = Android.Net.Uri.Parse("tel:" + person.PhoneNumber); | |
var intent = new Intent(Intent.ActionDial, uri); | |
StartActivity(intent); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void _btnPeople_Click(object sender, EventArgs e) | |
{ | |
var intent = new Intent(this, typeof(PeopleActivity)); | |
StartActivity(intent); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void _btnPeople_Click(object sender, EventArgs e) | |
{ | |
var intent = new Intent(this, typeof(PeopleActivity)); | |
var msgContent = "Hello! This is a secret sent from MainActivity! Don't tell anyone!"; | |
intent.PutExtra("secret_message", msgContent); | |
StartActivity(intent); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using Android.App; | |
using Android.Content; | |
using Android.OS; | |
using Android.Runtime; | |
using Android.Views; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<string name="ApplicationName">MoneyBack</string> | |
<string name="titleMenu">Menu:</string> | |
<string name="btnPeople">People management</string> | |
<string name="titleName">Name</string> | |
<string name="titleLastName">Last name</string> | |
<string name="titlePhoneNumber">Phone number</string> | |
<string name="btnSavePerson">Save person</string> | |
<string name="btnPeopleList">List of people</string> |