-
Notifications
You must be signed in to change notification settings - Fork 650
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master'
Conflicts: TodoL10nXlf/Todo.Android/MainActivity.cs
- Loading branch information
Showing
44 changed files
with
2,082 additions
and
1,091 deletions.
There are no files selected for viewing
2,319 changes: 1,446 additions & 873 deletions
2,319
Evolve13/Evolve13.Android/Resources/Resource.designer.cs
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="SQLite.Net-PCL" version="2.3.0" targetFramework="portable-net45+win+wp80+MonoAndroid10+MonoTouch10" /> | ||
<package id="Xamarin.Forms" version="1.2.3.6255-pre3" targetFramework="portable-net45+win+wp80+MonoAndroid10+MonoTouch10" /> | ||
<package id="Xamarin.Forms.Maps" version="1.2.3.6255-pre3" targetFramework="portable-net45+win+wp80+MonoAndroid10+MonoTouch10" /> | ||
<package id="SQLite.Net-PCL" version="2.4.1" targetFramework="portable-net45+win+wp80+MonoTouch10+MonoAndroid10+xamarinmac20+xamarinios10" /> | ||
<package id="Xamarin.Forms" version="1.3.0.6275-pre1" targetFramework="portable-net45+win+wp80+MonoTouch10+MonoAndroid10+xamarinmac20+xamarinios10" /> | ||
<package id="Xamarin.Forms.Maps" version="1.3.0.6275-pre1" targetFramework="portable-net45+win+wp80+MonoTouch10+MonoAndroid10+xamarinmac20+xamarinios10" /> | ||
</packages> |
This file contains 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
using System; | ||
using Todo; | ||
using Xamarin.Forms; | ||
using System.IO; | ||
|
||
[assembly: Dependency (typeof (SQLite_Android))] | ||
|
||
namespace Todo | ||
{ | ||
public class SQLite_Android : ISQLite | ||
{ | ||
public SQLite_Android () | ||
{ | ||
} | ||
|
||
#region ISQLite implementation | ||
public global::SQLite.Net.SQLiteConnection GetConnection () | ||
{ | ||
var sqliteFilename = "TodoSQLite.db3"; | ||
string documentsPath = System.Environment.GetFolderPath (System.Environment.SpecialFolder.Personal); // Documents folder | ||
var path = Path.Combine(documentsPath, sqliteFilename); | ||
|
||
// This is where we copy in the prepopulated database | ||
Console.WriteLine (path); | ||
if (!File.Exists(path)) | ||
{ | ||
var s = Forms.Context.Resources.OpenRawResource(Resource.Raw.TodoSQLite); // RESOURCE NAME ### | ||
|
||
// create a write stream | ||
FileStream writeStream = new FileStream(path, FileMode.OpenOrCreate, FileAccess.Write); | ||
// write to the stream | ||
ReadWriteStream(s, writeStream); | ||
} | ||
|
||
var plat = new global::SQLite.Net.Platform.XamarinAndroid.SQLitePlatformAndroid(); | ||
var conn = new global::SQLite.Net.SQLiteConnection(plat, path); | ||
|
||
// Return the database connection | ||
return conn; | ||
} | ||
#endregion | ||
|
||
/// <summary> | ||
/// helper method to get the database out of /raw/ and into the user filesystem | ||
/// </summary> | ||
void ReadWriteStream(Stream readStream, Stream writeStream) | ||
{ | ||
int Length = 256; | ||
Byte[] buffer = new Byte[Length]; | ||
int bytesRead = readStream.Read(buffer, 0, Length); | ||
// write the required bytes | ||
while (bytesRead > 0) | ||
{ | ||
writeStream.Write(buffer, 0, bytesRead); | ||
bytesRead = readStream.Read(buffer, 0, Length); | ||
} | ||
readStream.Close(); | ||
writeStream.Close(); | ||
} | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using System; | ||
using NUnit.Framework; | ||
using Xamarin.UITest.Android; | ||
using Xamarin.UITest.Queries; | ||
using System.Reflection; | ||
using System.IO; | ||
using Xamarin.UITest; | ||
using System.Linq; | ||
|
||
namespace Todo.UITests | ||
{ | ||
/// <summary> | ||
/// Android bootstrapper for the shared Xamarin.Forms tests | ||
/// </summary> | ||
[TestFixture ()] | ||
public class AndroidTest : CrossPlatformTests | ||
{ | ||
|
||
public string PathToAPK { get; set; } | ||
|
||
|
||
[TestFixtureSetUp] | ||
public void TestFixtureSetup() | ||
{ | ||
string currentFile = new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath; | ||
FileInfo fi = new FileInfo(currentFile); | ||
string dir = fi.Directory.Parent.Parent.Parent.FullName; | ||
PathToAPK = Path.Combine(dir, "Todo.Android", "bin", "Debug", "Todo.Android.apk"); | ||
} | ||
|
||
[SetUp] | ||
public override void SetUp() | ||
{ | ||
// an API key is required to publish on Xamarin Test Cloud for remote, multi-device testing | ||
// this works fine for local simulator testing though | ||
_app = ConfigureApp.Android.ApkFile(PathToAPK).ApiKey("YOUR_API_KEY_HERE").StartApp(); | ||
} | ||
} | ||
} |
Oops, something went wrong.