ryan, Developer
- 1538 Posts
- 132 Reply Likes
Posted 7 years ago
- 2 Posts
- 0 Reply Likes
Guillermo Aguirre de Cárcer Domínguez
- 10 Posts
- 0 Reply Likes
- 4 Posts
- 0 Reply Likes
ryan, Developer
- 1538 Posts
- 132 Reply Likes
Guillermo Aguirre de Cárcer Domínguez
- 10 Posts
- 0 Reply Likes
Thanks by the way!
- 4 Posts
- 0 Reply Likes
ryan, Developer
- 1538 Posts
- 132 Reply Likes
I will try to update the BarcodeScanner as soon as I can -- or maybe some android master from the community will beat me to it with a pull request ...
Guillermo Aguirre de Cárcer Domínguez
- 10 Posts
- 0 Reply Likes
I might be interested in updating the plugin since I was also looking into tuning the encoder to return an image instead of creating a new activity (is this possible?). At the moment I am using a JS QR encoder library to insert the QR codes on screen and I feel that if I could use the PhoneGap encoder directly it should be leaner, but I need just the image inserted into my DOM, not a new activity.
ryan, Developer
- 1538 Posts
- 132 Reply Likes
- 4 Posts
- 0 Reply Likes
- 34 Posts
- 1 Reply Like
Am I the only one? I immediately went back to 2.5.0 and everything is perfect again.
ryan, Developer
- 1538 Posts
- 132 Reply Likes
- 34 Posts
- 1 Reply Like
- 4 Posts
- 0 Reply Likes
ryan, Developer
- 1538 Posts
- 132 Reply Likes
- 2 Posts
- 0 Reply Likes
ryan, Developer
- 1538 Posts
- 132 Reply Likes
- 2 Posts
- 0 Reply Likes
Alan Neveu, Champion
- 213 Posts
- 11 Reply Likes
. On iOS something goes drastically wrong and javascript code is not running, I believe in the onDeviceReady. I will do some debugging to try to determine where the breakdown is happening, but I want to get this question out there sooner rather than later.
. On Android 2.3.X and 4.X we find things generally work, but when we call navigator.camera.getPicture and the user takes a photo, something crashes either before our success handler is called or in our success handler code. Again, I will do some debugging to determine where the breakdown is, but I wanted to ask this question sooner rather than later.
So the basic question here is, What are the required changes for upgrading from PhoneGap 2.5 to 2.7? I see the issue about needing to put an empty file called cordova_plugins.json in the root, tried that and it did not help. I also see some new functionality in 2.6 and 2.7 regarding things like InAppBrowser. Sounds great, but is there some default value that needs to go into config.xml when upgrading from 2.5 to 2.7?
In the future, how about if PhoneGapBuild took the initiative of testing the upgrade path of a few basic sample apps, and documented what the users of PhoneGapBuild need to do in order to upgrade from one version of PhoneGap to another? I see this as a recurring theme - every time a new version of PhoneGap is supported by PGBuild, those of us who actually use PGBuild for our development have to go tracing down these kinds of issues and communicating about them using forums and such. Sure, I see the change logs in GitHub and other places, but that does not help us much. Not trying to be a prick here, just asking for more help for the upgrade path so that we can stay current with all the awesome bug fixes that are available to us in PhoneGap itself. As it is, it seems that we have to jump through a ton of hoops just trying to get up to the latest version, so that we can then re-test our apps to make sure that the latest PhoneGap doesn't break things. This is very difficult.
Alan Neveu, Champion
- 213 Posts
- 11 Reply Likes
ReferenceError: Can't find variable: myStartupFunction
Which is essentially saying that my function is missing, and it seems that at this moment StratifiedJS is not finished wiring it up. If we wrap the call to our function in a setTimeout with 100ms delay, all goes well 100% of the time. Without the setTimeout, it fails 75% of the time and works 25% of the time. I have posted to the Google group for StratifiedJS to see if they can help us with an event that will fire when their library has finished preparing the inline javascript. That seems like it would be the proper solution, rather than some arbitrary number of milliseconds to wait, which could fail depending on the device.
Okay, now on to investigate this Android camera issue...
Alan Neveu, Champion
- 213 Posts
- 11 Reply Likes
Sooooo, lo and behold, we switch to using DataURL and PhoneGap 2.7 works just fine when we call getPicture. More debugging shows that when using FileURI and we attempt to read the .jpg file that is returned in the data parameter, we can't get at the file and we just get back null. Beautiful. Works great in PhoneGap 2.5, fails in 2.7. Love that! So we are going to consider switching to DataURL, even against the advice of so many Android lovers that told us our design is flawed. I have a hunch that the many user complaints of sporadic camera failures on Android have been due to using FileURI in the first place. We shall see. At this point we don't have any choice because we are not able to read the file using FileURI.
Any comments are welcome!
Alan Neveu, Champion
- 213 Posts
- 11 Reply Likes
Mario, Champion
- 120 Posts
- 17 Reply Likes
I use FILE_URI and I also need the images to be scaled down for fast uploads. To scale down I simply set targetWidth and targetHeight. Works on iOS and Android.
To upload the image on Android, you need to call window.resolveLocalFileSystemURI to get the path to the file, otherwise you will get a null file. Reason: Android can not handle the content:// URI of the image.
Hope this may help someone. I had to invest a lot of time to get things done, in this case. Now, it's fun again. :-)
Alan Neveu, Champion
- 213 Posts
- 11 Reply Likes
So, we are testing out the switch to DataURL. I'll let y'all know if this works out for us, just in case there is someone else who comes along and has a similar problem with PhoneGap 2.7 or higher.
Mario, Champion
- 120 Posts
- 17 Reply Likes
I think/hope it works both ways. Anyway, good luck!
Related Categories
-
PhoneGap Build
- 15111 Conversations
- 275 Followers






