Singh
Singh

Reputation: 141

How can i integrate Sqlite or any other Database with windows 7 phonegap?

I am new to windows 7 phonegap. i want to store and retrieve data using native application.I don't know how to store and display the retrieved data from native to phonegap(HTML)page.

  1. Doesn't that mean that phonegap supports web sql database support on all platforms(WP7 in specific). Are there any plugins to support sqllite on WP7 for phonegap?
  2. console.log js script output is not visible in visual studio 2010 output window. should i use alternative api's for WP7?
  3. How can i debug visual studio 2010 output window?

Thanks in advance.

Upvotes: 2

Views: 1438

Answers (3)

marob
marob

Reputation: 31

As answered by Timo Rehl, you can use an sqlite implementation from codeplex to implement the sqlite component and then create a PhoneGap plugin on top of it.

As a matter of fact, I've developed such a plugin (for cordova 3) that enables you to use Web SQL Database on Windows Phone (7 and 8) as if it was natively implemented : https://github.com/Smile-SA/cordova-plugin-websqldatabase.

A prototype using this plugin is available at https://github.com/Smile-SA/cordova-plugin-websqldatabase-proto.

This plugin uses a forked version (to solve some bugs) of the sqlite implementation from codeplex. The fork is available in the same github repository.

Upvotes: 0

Timo Rehl
Timo Rehl

Reputation: 56

Ok, Im late with my answer, but I have an answer to the question:

PhoneGap supports Sqlite, no question. But Windows Phone doesn't Support Sqlite, so that Phonegap exclude the "Web SQL Storage" Interface for Windows platforms (see supported platforms in Phonegap API documentation online).

There is a Little bit uncommon way to reach the Goal. You can use a sqlite implementation from codeplex to Support sqlite with your Windows mobiles: http://sqlitewindowsphone.codeplex.com/releases

I did'nt tested with Phonegap, so I cant't give a guarantee of that, but it looks fine for me.

Upvotes: 4

jexact
jexact

Reputation: 541

Have a look at this: Phonegap Storage (provides access to the devices storage options)

To see console.log messages in visual studio's output window:

<script type="text/javascript" charset="utf-8" src="cordova.js"></script>
<script type="text/javascript">

document.addEventListener("deviceready",onDeviceReady,false);

// called when device ready event fires
function onDeviceReady()
{
    console.log("You should see this message in Visual Studio's output window.");
}

</script>

Upvotes: 1

Related Questions