Sam Mignot | 30 Jun 09:45 2016
Picon
Gravatar

Cordova/PhoneGap - SQL Lite Plugin doesn't work

Hi :)

I'm developping an android app with Cordova 6.2.0 and I want to use the SQLLitePlugin to create databases ... but it doesn't work !

This is my test code :


<script type="text/javascript"> document.addEventListener("deviceready", onDeviceReady, false); function onDeviceReady() { var db; alert("window.cordova: " + window.cordova); alert("window.SQLitePlugin: " + window.SQLitePlugin); if (window.cordova && window.SQLitePlugin) { db = window.sqlitePlugin.openDatabase({ "name": "snet1.db" }); //device - SQLite alert("device db (SQLite) loaded"); } else { db = window.openDatabase("APSNetMobileDb", "1.0", "snet1.db", 100 * 1024 * 1024); // browser webSql, a fall-back for debugging alert("browser db (WebSQL) loaded"); } db.transaction(populateDB, errorCB, successCB); } function populateDB(tx) { tx.executeSql("DROP TABLE IF EXISTS demo"); tx.executeSql('CREATE TABLE IF NOT EXISTS demo (id integer primary key unique, data)'); tx.executeSql('INSERT INTO demo (id, data) VALUES (1, "First row")'); tx.executeSql("INSERT INTO demo (id, data) VALUES (?,?)", [2, 'Second Row']); alert("inserted rows"); queryDB(tx); } function queryDB(tx) { tx.executeSql("SELECT id, data FROM demo;", [], querySuccess, errorCB); } function querySuccess(tx, results) { var len = results.rows.length; for (var i = 0; i < len; i++) { document.getElementById("output").innerHTML += "<table><tr><td>ID = " + results.rows.item(i).id + "</td><td>data = " + results.rows.item(i).data + "</td></tr></table>"; } } function errorCB() { alert("DB access FAILED"); }; function successCB() { alert("DB access SUCCEEDED"); }; </script>


It returns :

  1. windows.SQLitePlugni:undefined
  2. brower db (WEVSQL) loaded
  3. inserted rows
  4. DB access FAILED

I install the plugin from git and I also specify the plugin into my config.xml like that :

<plugin name="cordova-sqlite-ext" spec="https://github.com/litehelpers/cordova-sqlite-ext.git" />

Any issue ? Thanks !

--
-- You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phonegap-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
phonegap+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com
---
You received this message because you are subscribed to the Google Groups "phonegap" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phonegap+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Abhinav Jaiswal | 29 Jun 21:51 2016
Picon

SQLITE DATABASE

Hey hii Kerri,

I have one specific doubt related to PhoneGal. I'm using SQLite plugin for storing and retrieving data.

Currently what I have understand through its documentation on git hub or their site is after installing the application when you open the app for the first time then only databases and table is getting created and we can execute all our SQL statements trough transaction statements.

However, I have a pre-populated DB which I have created through SQLite Browser. This will contain a list of records which I need to fetch in a drop down in my app. Now, where I can include this pre-populated DB in the app bundle. So that this DB is only getting used.

My target devices are both iOS and Android.

Please help me on this.

--
-- You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phonegap-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
phonegap+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com
---
You received this message because you are subscribed to the Google Groups "phonegap" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phonegap+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
ManiKumar Navara | 29 Jun 12:07 2016
Picon

app working on phonegap developer app but not after build

Hi,
This is N Manikumar.

Now, I would like to add the camera functionality to my app and send those to server after submit.

My problem was..

Camera was working fine in phonegap developer app but whenever i build the app and install the .apk file in my android phone camera is not working instead it shows exception error "TypeError: Cannot read property 'getPicture' of undefined".

I don't know where to modify the code.
Here is the code what I have written :::

<!DOCTYPE html>
<html>
  <head>
    <title>Capture Photo</title>

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

    // A button will call this function
    //
        var count=1; var imageURI = new Array();
    function capturePhoto() { //alert('capturePhoto');
      sessionStorage.removeItem('imagepath');
      // Take picture using device camera and retrieve image as base64-encoded string
      if(count  == 5){ alert('Maximum 4 Pics Allowed'); return false;  }
      try{
       document.getElementById('picture_msg').innerHTML = "";
  // Get URI of picture to upload
  navigator.camera.getPicture(
    function(uri) {
      try {
                imageURI[count] = uri;
        // Pick image from div
              if(count < 5) {
        var img = document.getElementById('smallImage_'+count);
        img.src = uri
        img.style.visibility = "visible";
        img.style.display = "block";
                            }
     

        if (!imageURI || (img.style.display == "none")) {
          document.getElementById('picture_msg').innerHTML = "Tap on Capture to select image from gallery.";
          return;
        }
         count = count+1;
      }
      catch(exce) {
        alert(exce);
      }
    },

    function(e) {
      console.log("Error getting picture: " + e);
      document.getElementById('picture_msg').innerHTML = "No Image Found";
    },
    {
      quality: 50,
      destinationType: navigator.camera.DestinationType.FILE_URI,
      sourceType: navigator.camera.PictureSourceType.PHOTOLIBRARY
    }
  );
    }
    catch(err){alert(err);}
  } 

  function submit()
  {
   // alert('submit');
            // Verify server has been entered
        server = document.getElementById('server').value;
        server  = "http://192.168.0.125:8888/CDA_server/upload.php?complaint_id="+localStorage.getItem("complaint_id")+"&type=picture";
        arr_count = imageURI.length;
        //alert(arr_count);
        if (server) {
          var i;
          for(i=1;i<=arr_count;i++){
            alert(i);
          // Specify transfer options
          if(i == arr_count){   window.location.href = "dest_location.html";}
          var options = new FileUploadOptions();
          options.fileKey="file";
          options.fileName=imageURI[i].substr(imageURI[i].lastIndexOf('/')+1);
          options.mimeType="image/jpeg";
          options.chunkedMode = false;

          // Transfer picture to server
          var ft = new FileTransfer();
          ft.upload(imageURI[i], server, function(r) {
            document.getElementById('picture_msg').innerHTML = "Upload successful: "+r.bytesSent+" bytes uploaded.";
           /* img.src = imageURI[i];
            img.width = 100;
            img.height = 100;*/
          },
          function(error) {
            document.getElementById('picture_msg').innerHTML = "Upload failed: Code = "+error.code;
          }, options);
        }
      
      }
        else {
          document.getElementById('picture_msg').innerHTML = "Server Not Found";
        }
  }

    
    </script>
  </head>
  <body><div style="width:90%;margin:3%;">
    <div class="app">
    <div id="main">
        <div id="server-div">
          <input type="hidden" name="server" id="server" value="http://192.168.0.125:8888/CDA_server/upload.php"/>
        </div>
            <button onclick="return capturePhoto();" style="width:320px;height:300px;">Capture Photo</button> <br>
        <!--<div id="image-upload" onClick="return capturePhoto();">
            <img id="pimage" src="img/profile.png" width="100px" height="100px" />
        </div>-->
   <img style="display:none;width:50px;height:50px;" id="smallImage_1" src="" /><br>
    <img style="display:none;width:50px;height:50px;" id="smallImage_2" src="" /><br>
    <img style="display:none;width:50px;height:50px;" id="smallImage_3" src="" /><br>
    <img style="display:none;width:50px;height:50px;" id="smallImage_4" src="" /><br>
        <div id="picture_msg">
             Tap on Image to change and upload
        </div>
          <button class="button button-block button-positive" id="submit" onClick="submit()">Submit</button>
    </div>
</div>
</div><!--whole div -->
  </body>

</html>



Wait for the reply and issue need to be fixed.
Thanks in advance.


Thanks & Regards,
Manikumar.



--
-- You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phonegap-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
phonegap+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com
---
You received this message because you are subscribed to the Google Groups "phonegap" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phonegap+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
ARUNIMA DAS | 29 Jun 10:50 2016
Picon

Create a native app using phonegap to create windows push notifications

I want to create a native app to create a windows push notification. Can you please suggest  the necessary steps?

--
-- You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phonegap-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
phonegap+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com
---
You received this message because you are subscribed to the Google Groups "phonegap" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phonegap+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Sylvio Mattos | 29 Jun 00:56 2016
Picon

installation error on windows 10

Hello,

after running "npm install -g cordova" the terminal looks like this:

C: \ cordova-lib \ cordova-lib> npm install -g cordova
loadRequestedDeps -> MAPT \ | ################## -------------------------- --------------

The installation does not continue ... Can anyone help me?

thanks

--
-- You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phonegap-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
phonegap+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com
---
You received this message because you are subscribed to the Google Groups "phonegap" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phonegap+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Doc Jump | 28 Jun 23:32 2016
Picon

phonega5sql

I have had a difficult time getting the phonegap sql db operations to work properly, so I am trying to employe html5sql. Everything seems to work except for inserting variable values into a table. This is the code I'm testing with:

html5sql.process(
            [
    'CREATE TABLE IF NOT EXISTS idData(id INTEGER PRIMARY KEY AUTOINCREMENT,firstName VARCHAR(50),lastName VARCHAR(50),address VARCHAR(50),license VARCHAR(50),age VARCHAR(10),city VARCHAR(50),dob VARCHAR(8), exp VARCHAR(8),idDate VARCHAR(20),purchase VARCHAR(50));',
    'INSERT INTO idData(firstName,lastName,address,license,age,city,dob,exp,idDate,purchase) VALUES  ("'+gfname+'" , "'+glname+'","'+gaddress+'","'+glicense+'","'+gage+'","'+gcsz+'","'+gdob+'","'+gexp+'","'+myDate+'","'+gpurchase+'");',
    'INSERT INTO idData(firstName,lastName,address,license,age,city,dob,exp,idDate,purchase) VALUES  (?,?,?,?,?,?,?,?,?,?}',[gfname,glname,gaddress,glicense,gage,gcsz,gdob,gexp,myDate,gpurchase]);
   "INSERT INTO idData(firstName,lastName,address,license,age,city,dob,exp,idDate,purchase) VALUES  ('George','Bernard','983 Third St.','H0614345','48','San Diego, CA 90023','19661222','20150712','20100214090900','Indigo 1oz.');",
      ],
            querySuccess,
            errorCB
        );
According to what little documentation there is on the subject, the first two INSERTs should work fine but simply do not. They do nothing in the code except refuse to execute the remainder of code in the function where this code resides. The third INSERT which stores constant values, not variable values, works fine. I'm hoping to that one of you will have gained some html5sql knowledge in your phonegap travels and be able to shed some light on my problem.. Thanks

--
-- You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phonegap-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
phonegap+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com
---
You received this message because you are subscribed to the Google Groups "phonegap" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phonegap+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Diego Bueno | 28 Jun 23:20 2016
Picon
Gravatar

Unable to scroll the view in iOS - Using SAP UI5

Hi friends,

I'm facing a huge issue with the scrolling of the content of views.

The current solution works fine for everything but iOS.
Is there a specific thing or css class that I need to add in order to have my container scrolling as in Android ?

Regards,
Diego

--
-- You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phonegap-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
phonegap+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com
---
You received this message because you are subscribed to the Google Groups "phonegap" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phonegap+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Valmir Sartori | 28 Jun 17:57 2016
Picon

back or close page for back screen of aplication

I have a compiled at build phonegap app that works offline on the device, but when I click on any online link for example visit the facebook page, he navigates, but then I can not go back to the app without waxing it. in android works because it has the native back button, but the iPhone does not have the back button ... it needed a plugin? Can someone help me?

--
-- You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phonegap-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
phonegap+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com
---
You received this message because you are subscribed to the Google Groups "phonegap" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phonegap+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Shiva Rowshan rad | 28 Jun 09:16 2016
Picon

ionic infinite scroll

Hello every one
I'm using ion-infinite-scroll as in these tutorials :   http://ionicframework.com/docs/api/directive/ionInfiniteScroll/   &  http://mcgivery.com/ionic-infinite-scroll/   bu it does not call loadMore function when the scroll reaches bottom of the page. 
here is my html page code :


<ion-view view-title="Home">
    <ion-header-bar class="bar-light bar-subheader">
        <input type="search"
               placeholder="Search..."
               ng-model="search"
               ng-focus="searchFocused = true"
               ng-blur="searchFocused = false"
               ng-change="scrollTop()"
               class="full-width">
        <button ng-if="search.length"
                class="button button-icon ion-android-close input-button"
                ng-click="clearSearch()" style="position: absolute;right: 0;top: 5px;color: #bbb;"></button>
    </ion-header-bar>
    <ion-content class="padding">
        <ion-refresher on-refresh="refresh(true)" spinner="android"></ion-refresher>
         <div class="list" >
             
                    <button class="item button-full" ng-click="ShowGames(x.name)" ng-repeat="x in groups | filter:search" >
                         {{x.name}}
                    </button>
                </div>
        <ion-infinite-scroll 
                             icon="ion-loading-c"
                             on-infinite="loadMore()"
                                 distance="5%">
        </ion-infinite-scroll>
    </ion-content>

</ion-view> 



and cntroller part :

.controller("homeCtrl", [ "$scope", "$state", "$rootScope", "ionicReady", "$ionicLoading","$ionicScrollDelegate", function ($scope, $state, $rootScope, ionicReady, $ionicLoading,$ionicScrollDelegate) {
        ionicReady().then(function () {
           
                myDB.transaction(function (tx) {
                    tx.executeSql("SELECT * FROM newgroup", [], function (tx, result) {
                        $scope.groupshow = []; $scope.groups=[]
                        for (var i = 0; i < result.rows.length; i++) {
                            $scope.groupshow.push(result.rows.item(i));
                            if (i < 11) {
                               
                                $scope.groups.push(result.rows.item(i));
                            }
                        }
                        $scope.$broadcast('scroll.infiniteScrollComplete');
                    }, function (e) { alert('select error:' + e.status) })
                })
            }
        });

        $scope.loadMore = function () {
            var last = $scope.groups.length;
                for (var i = 1; i <= 10; i++) {
                    $scope.groups.push($scope.groupshow(i + last));
                }
                $scope.$broadcast('scroll.infiniteScrollComplete');
            
        };
        
        $scope.refresh = function () {
            //refresh binding
            $scope.$broadcast("scroll.refreshComplete");
        };

        $scope.ShowGames = function (group) {
            $rootScope.groupName = group;
            $state.go("app.Games");
        }
        /*********************searchbar**************************/
        $scope.scrollTop = function () {
            $ionicScrollDelegate.scrollTop();
            
           
        
        };
        $scope.clearSearch = function () {
            $scope.search = '';
        };
        /********************************************************/
    }
    ])

--
-- You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phonegap-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
phonegap+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com
---
You received this message because you are subscribed to the Google Groups "phonegap" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phonegap+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Muhammad Ishaq | 27 Jun 11:30 2016
Picon

Need Quick Help - Disabling user input on textbox

I am working on Cordova app. In one page there is only one textbox when page loads it focus the textbox with cursor blinks and keyboard is open in my device.

Requirements:

But the requirement is cursor should be there but keyboard should hide because user want to input only using barcode scanner which connected by bluetooth with device.

Is it possible that cursor blinks in textbox but keyboard should not be displayed.

Thank You.
Muhammad Ishaq

--
-- You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phonegap-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
phonegap+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com
---
You received this message because you are subscribed to the Google Groups "phonegap" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phonegap+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Kushan Delapalage | 27 Jun 09:27 2016

Phonegap app rejected by Google Play store

Dear All,

 

I'm new to the phonegap development. I have developed a html app and built it will phonegap and added submitted it to the play store. I have a feature to play youtube video which are embedded in to the page with <iframe>. The app has been rejected by the play store team saying

 

<quote>

I reviewed <appname>, com.veritas.app.xxxxxx, and had to reject it because it violates our device and network abuse policy and section 4.4 of the Developer Distribution Agreement. If you submitted an update, the previous version of your app is still live on Google Play.

Here’s how you can submit your app for another review:

  1. Modify your app to make sure it doesn’t access or use a service or API in a manner that violates its terms of service; for example, by enabling background play of YouTube videos.
  2. Read through the Device and Network Abuse policy for more details and examples.
  3. Make sure your app is compliant with all other policies listed in the Developer Program Policies. Remember that additional enforcement could occur if there are further policy issues with your apps.
  4. Sign in to your Developer Console and submit your app.

</quote>

 

I have understood the issue is with the media played when the app is in the background. (even when the power button is pressed media is audible). Appreciate if you'll can suggest a resolution for this.

 

Regards,

Kushan D.

--
-- You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phonegap-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
phonegap+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com
---
You received this message because you are subscribed to the Google Groups "phonegap" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phonegap+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.

Gmane