My Windows Phone 8 application (C#/XAML/SQLite) works very slowly after I published it in windows store as "beta" and then installed to my smartphone (Lumia 620). Those "freezes" are where my application executes selects to sqlite database file. And on pages where there are no database queries everything works perfect. So I think that's the case.
The thing, that I don't understand is that the application with exactly the same settings works fine when I deploy it from Visual Studio.
I use sqlite like described in this topic on nokia.com - http://developer.nokia.com/Community/Wiki/How_to_use_SQLite_in_Windows_Phone
I have c++ sqlite project in my solution and two files from sqlite-net package (SQLite.cs and SQLiteAsync.cs)
Build configuration is "Release" and platform is "ARM".
Database query example:
using MyApp.Model.Entities;
using System.Collections.Generic;
namespace MyApp.DAL
{
public class MyAppRepository
{
private string dbPath = @"Assets/words.db";
public List<Word> GetWordsByCatId(int id)
{
var sql = string.Format(@"
SELECT w.[id],
w.[word_en],
w.[word_ru]
FROM words w INNER JOIN word_links l ON w.[id]=l.[word]
WHERE l.category = {0};", id);
using (var conn = new SQLite.SQLiteConnection(dbPath))
{
var list = conn.Query<Word>(sql);
return list;
}
}
public List<Cat> GetCats2()
{
var sql = string.Format(@"
SELECT c.[id],
c.[name_en],
c.[name_ru],
COUNT(l.[id]) words
FROM categories c
LEFT JOIN word_links l ON c.[id]=l.[category]
GROUP BY c.[id]
HAVING words>1;");
using (var conn = new SQLite.SQLiteConnection(dbPath))
{
var list = conn.Query<Cat>(sql);
return list;
}
}
public List<Cat> GetCatsByWordId(int id)
{
var sql = string.Format(@"
SELECT c.[id],
c.[name_en],
c.[name_ru]
FROM categories c INNER JOIN word_links l ON c.[id]=l.[category]
WHERE l.word = {0};", id);
using (var conn = new SQLite.SQLiteConnection(dbPath))
{
var list = conn.Query<Cat>(sql);
return list;
}
}
}
}