For example, can I generate a SQLite db file and put it as a resource in the project. When the project first launches, copy the db into isolated storage without worrying this db file may be unavailable in the phone. Furthermore, can I copy this empty db file into another platform, like android or iPhone, and operate this db by in SQLite api of the platform.
From the SQLite web site:
A database in SQLite is a single disk file. Furthermore, the file format is cross-platform. A database that is created on one machine can be copied and used on a different machine with a different architecture. SQLite databases are portable across 32-bit and 64-bit machines and between big-endian and little-endian architectures.
So yes, when you've validated that the SQLite API is available everywhere you want to use it, that should be fine as a storage format.
EDIT: And yes, SQLite does work on Windows Phone 7, using this Codeplex project or this one.
Yes. We are using the same SQLite database in an iOS, Android and WP7 app. I've written a quick start guide here: http://wirebear.com/blog/2010/11/12/using-sqlite-in-your-wp7-app
The above blog post covers copying your database from your resources to isolated storage and correctly configuring SQLite to work on your device.
The SQLite version is compatible with Android - iOS - WindowsPhone as far I have experimented. I have created SQLite DB on a Mac Desktop and copied it into projects along with data into each of these platforms. Everything worked fine no issues.
Ref:
http://www.sqlite.org/download.html
Precompiled Binaries for Windows Phone 8
sqlite-wp80-winrt-3071502.vsix (2.72 MiB)
A complete VSIX package with an extension SDK and all other components
needed to use SQLite for application development with Visual Studio
2012 targeting Windows Phone 8.0. (sha1:
4cab3fd698402bf30448c64e39001103c10ff82b)
The download page itself lists the entire code and binaries for different platforms. Using a PC/Mac for creating a DB is convenient option.
You can use SQLite manager for doing so on a Windows or Linux PC.
SQLite Manager (Preferred by Myself)
http://sqliteman.com/
There are also extensions for Chrome and Firefox, which makes SQLite Available for almost any platform to Manage them.
Firefox Plugin for managing those files.
https://code.google.com/p/sqlite-manager/
codev.it also allows to enable editing SQLite Files.
As far as DB is concerned, Exporting them from the device is as described by #Jon Skeet
SQLite 3.7 is more compatible with Windows Phone. Since SQLite DBs are backward compatible, there isn't any need to worry weather your DB works on older 2.x version or 3.x..
Hope this helps.
#Bhuro As you want a detailed procedure for using SQLite db in a Windows Phone 7 app, Here is a good post Native Database Programming via Sqlite Client for Windows Phone.
I have successfully followed the same process in my WP app. Try that and let me know if you get any doubt.
Good luck !!
Related
I use SQLite in my UWP App.
All work good on my PC in debug mode.
After installation on a W10 Device the APP close itselfs when I try to create a SQLite's Database.
I think it's a write-problem on the device.
Perhaps no write rights?
Where and How can I set it on my package?
Thanks a lot
Daniele Pinai
Right-click your UWP project in the Solution Explorer and choose Add -> Reference....
In the dialog window choose Universal Windows and below select Extensions.
In this list ensure that Visual C++ 2015 Runtime for Universal Windows and SQLite for Universal Windows Platform are checked.
In case you can't find the SQLite for Universal Windows Platform there, you will have to install this extension. You can do this using the Extensions and Updates window in Visual Studio, or by downloading and installing the latest sqlite-uwp- package from the SQLite website.
In my project where i am using sqlite i get this error.
An exception of type System.IO.FileNotFoundException occurred in SQLite.Net.Platform.WindowsPhone8.DLL but was not handled in user code
Here is a screenshot.
P.S. i got value in variable path as C:\Data\Users\DefApps\AppData{F8267584-1051-4816-8195-EE018BA5155E}\local\Student.db3
Thanks
You're missing Sqlite for Windows Phone. iOS and Android have Sqlite "build in", meaning it is available directly on the platform. Windows Phone ships without Sqlite.
To add it, first prepare your development machine by using Tools -> Extensions and Updates in Visual Studio. Search online for "sqlite windows phone". You must install the one for WP8 (not 8.1). When done, your machine is ready to deploy Sqlite with a WP project.
Next, add a reference to Sqlite to your WP app. Right click References in your WP project. Select Add references and in the menu select Windows Phone SDK -> Extensions and select Sqlite for Windows Phone.
Considering that an app using a sqlite db, needs to be build for x86 platforms in order to run on the emulator and under ARM in order to get deployed on a device.
The question is, how does one publish a WP8 app with a sqlite database? Under which active solution platform in the configuration manager menu should the project be build in order to pass the store verification?
When publishing to the store you publish the ARM version, because that is the only version that can work on an actual device.
Just set the Build Configuration to target ARM and set it to Release. Then look in the Bin/ARM/Release folder for the .xap package.
I am using SQLite.WP80 version=3.7.16 in Windows phone 8 project.
Now when I tried to test with store test kit it says:
"the application package(XAP) is not up to date,recompile and try again.
change the solution configuration to release and platform to any cpu and rebuild the app"
But as I am using sqllite i cannot change to any cpu.
Can anyone tell possible solution?
You should target just one CPU during development (depending on what machine you will be testing/debugging on). When it's time to publish your app, you can select multiple packages, one for each CPU architecture. Visual Studio will then create several packages, which you can upload to the dev portal.
I'm developing a C# Window8 / WinRT app and I'm using SQLite-NET with the sqlite3.dll linked at the bottom of the documentation at
https://github.com/praeclarum/sqlite-net
My project works fine on my computer, but since sqlite is a non-managed DLL, I wonder what's going to happen when I deploy my app to the app store and someone with an ARM cpu tries to run it. Is it going work? If not, how can I make it work?
Thanks,
Adrian
No, it's not going to work. You cannot choose a neutral architecture (Any CPU) when there is a C++ component involved. You will have to compile your SQLite DLL into ARM in order for you to have an ARM version. If you have a native component, you will submit multiple versions for the Store and the customer will download the correct version for their architecture.
Good blog post on Windows on the ARM architecture.
The only thing I know is that Microsoft is working with guys from SQLLite and is now officially supported