I want to call a function when installing A Cordova/Phonegap application (for create database and insert records to that).
In fact I just wanna run this function only once.
Any suggestion?
You can use LocalStorage for that :
document.addEventListener('deviceready', function()
{
if (typeof window.localStorage.getItem('firstTime') === 'undefined')
{
// Execute some code for the installation
// ...
window.localStorage.setItem('firstTime', 0);
}
});