Hey, At the moment I'm not sure how officially supported it is but, there have been reports of people successfully using monodroid with vici coolStorage. I have been able to drop the assemblies into my project and compile however, certain classes throw compile time errors when I attempt to use them. specially when attempting to connect like the example for monoTouch on the website..
string dbName = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), "mydb.db3");
// The following line will tell CoolStorage where the database is,
// create it if it does not exist, and call a delegate which
// creates the necessary tables (only if the database file was
// created new)
CSConfig.SetDB(dbName, true, () => {
CSDatabase.ExecuteNonQuery(@"CREATE TABLE person
(PersonID INTEGER PRIMARY KEY AUTOINCREMENT,
Name TEXT(50) NOT NULL,
DateOfBirth TEXT(30) NULL)");
});
I get no intellisense when attempting to use CSConfig's methods and when I try to pass the 3 args to CSConfig.SetDB() I get an invalid number of args error.
I think their sample is buggy. If you use the Visual Studio assembly browser, or the MonoDevelop assembly browser, or even just monop -r:Vici.CoolStorage.MT.dll Vici.CoolStorage.CSConfig
, you'll see these overloads for SetDB
:
public static void SetDB (CSDataProvider db);
public static void SetDB (CSDataProvider db, string contextName);
public static void SetDB (string dbName);
public static void SetDB (string dbName, Action creationDelegate);
public static void SetDB (string dbName, SqliteOption sqliteOption);
public static void SetDB (string dbName, SqliteOption sqliteOption, Action creationDelegate);
None of these accept bool
as a second parameter, so I think their sample is buggy.
The fix is to do as the compiler says, and use an overload that actually exists:
CSConfig.SetDB(dbName, () => {
CSDatabase.ExecuteNonQuery(
@"CREATE TABLE person
(PersonID INTEGER PRIMARY KEY AUTOINCREMENT,
Name TEXT(50) NOT NULL,
DateOfBirth TEXT(30) NULL)");
});