0

I was able to use sqlite in cordova projects in android and windows platform seperately. I recently started to use the multi-device hybrid apps for vs2013 and I don't know how to include the sqlite component properly. I tried to reference the sqlite c++ component in the multi-device hybrid apps project just like I did in the cordova project but it doesn't get referenced properly. (It might be due to uncompatible component? In that case how can we build a compatible sqlite component that works with multi-device hybrid apps project?) Any suggestions?

Priyank
  • 1,568
  • 10
  • 15
  • Did you install the SQLite for Windows plugin with the extension installer? – Priyank Jun 30 '14 at 19:09
  • I am using sqlite3 component and its javascript wrapper from here -> https://github.com/doo/SQLite3-WinRT I used the same for windows 8 cordova project and it worked fine. However, it didn't work for cordova project created by multi-device hybrid apps tool. – user2646465 Jun 30 '14 at 19:20
  • Just curious to know how you're trying to reference it in the MDHA? That might be the cause of the problem. – Priyank Jul 01 '14 at 02:20
  • i followed this http://ismaeldoesphonegap.blogspot.com/2013/08/creating-sqlite-driven-app-for-windows.html for implementing sqlite in cordova project...and I tried to do similar steps for the MDHA.....I don't have enough knowledge about the types of component the MDHA is compatible with. I thought if sqlite works with cordova then it should work with MDHA as well. – user2646465 Jul 01 '14 at 04:20

2 Answers2

1

Forget about my previous answer, it would build but fail when running any commands.

Here is a better answer (and much easier).

From this answer that I wrote to answer my own related question :

There's a very simple fix to this. For Windows 8, you need to have the VSIX packages for SQLite already installed. Please, note which version number you have installed! As of 10/26/14, I have 3.8.7 installed.

From your solution's folder in explorer, navigate to:

{solution folder}\JavaScript\{project name}\bld\Debug\platforms\windows8

Edit the project's jsproj file in a text editor and scroll down until you see the entries for SQLite.

<ItemGroup>
    <SDKReference Include="SQLite.WinRT, Version=3.8.7" />
</ItemGroup>

Change the version number in your file to the actual version on your computer. The project will build with the WebSQL plugin enabled and will actually work. (I verified the database file created in local storage.)

NOTE - You must already have enabled the WebSQL plugin in the config.xml menu.

Community
  • 1
  • 1
Lee McPherson
  • 931
  • 6
  • 20
0

although it's late to answer this but however: this cordova plugin from Microsoft Open tech might help :

Adds WebSQL functionality as Apache Cordova Plugin implemented on top of native SQLite database. Support of Windows Phone8 and Windows8.

http://msopentech.com/blog/2014/02/03/new-open-source-portable-class-library-sqlite/ https://github.com/MSOpenTech/cordova-plugin-websql

so you can work with sqlite on windows the same way you do in android cordova apps.

Hamid Karimi
  • 615
  • 1
  • 8
  • 12