Phonegap changing orientation on a single page - javascript

So my issue is I have this app I am creating with phonegap (ios and android) and a couple of the pages need to be landscape the rest should be portrait. I couldn't seem to get this working in just standard phonegap so I tried to use this plugin (cordova-plugin-screen-orientation https://github.com/gbenvenuti/cordova-plugin-screen-orientation) which was recommended a lot, but it kept breaking the rest of my JS (maybe because I am using cordova 5 and the version it recommends is 4)
Thanks for your help
I have searched for this for a while a couldn't find anything that would work,

Related

Barcode Scanning Via Mobile Browser?

I am looking at trying to scan barcodes from a mobile device.
I been doing some research and I having hard time finding JavaScript libraries that can do this.
I see these projects
zxing
This seems to be no longer in development and just bugs fixes are done?
QuaggaJS
This one, I am not sure if it is development either anymore as changelog is from 2017
quagga2
This seems to be a fork of the one above? So this might be the better choice to go with vs the 2?
What I am trying to achieve is this. I want to go on an andriod device (think phone, maybe tablet), load up chrome or firefox, go to my site click a button and load up the devices camera and scan a bar code (mostly EAN-8/13).
I want to do the same thing on apple devices (iphone and ipad), load up safari (not sure if they got chrome and Firefox on these devices. I don't own apple), click a button and load up their devices cameras and scan a bar code.
I think this is possible in all the libraries I listed above, but I am still unclear if this is possible on apple devices? I read somewhere that before ios 14 it would not be possible?
I am open to other libaries, I can use Jquery, vanilla javascript and I think angular (but I think it is version 3).
Just been doing this same research myself. All of those open source ones you listed seem to be either dead or have performance/reliability issues. Looks like only the commercial versions are really viable at the moment:
Dynamsoft - https://www.dynamsoft.com/store/dynamsoft-barcode-reader/
Scanbot - https://scanbot.io/products/barcode-software/web-barcode-scanner/
There are also two different mobile apps that are viable. These are web apps that just display a browser view and make a barcode scanning function from the app itself available on the page:
https://berrywing.com/scan-to-web-app/
https://www.mochasoft.dk/iphone_barcode2.htm
The second one has a more capable JS API of the two.
UPDATE: I went with that last option from Mochasoft. Turned out quite well.

What features are available in a cordova web view?

What features (HTML, JS, CSS, Web APIs), outside of plugins, are available in a cordova web view ? I am making a web app, and then I use cordova to create an apk file. The web app works fine with chrome and firefox for android. But when I try the generated apk on the same android device and the emulator the JavaScript is obviously not executed because buttons have no effect.
The initial HTML and CSS display fine, and I think I use some JavaScript or HTML5 features that are not available yet on cordova web view, but I don't know what I can use and what I cannot. I had a look at the emulator's error log but I get nothing meaning-full.
For example is it possible to use es2015 without transpiling, esModules etc, but I don't know where to look it up. What is the difference between a webview browser and chrome/firefox for android.
Targeting Android 4 and later.
https://cordova.apache.org/
It's probably easiest to look at the architecture diagram: https://cordova.apache.org/docs/en/latest/guide/overview/index.html.
Cordova apps consist of a small wrapper around a WebView (this is a "window" of the default browser installed by your mobile OS, although you can swap it out for another: https://cordova.apache.org/docs/en/latest/guide/hybrid/webviews/), with access to the mobile device's features via plugins. So... to answer your questions:
You can use any technology that's supported by the mobile browser you're working in. https://caniuse.com is super helpful in this regard.
You will also find that Android 4.x's stock web browser is not that great -- some of the shiny new popover UI stuff (walkthrough help and light boxes) will render, but the z-order is all messed up when you try to click to the next item. I've run into other issues as well, but I can't remember them off the top of my head.
The Crosswalk project allows you to embed a Chrome browser web view in older Android versions (back to 4.x I think). Support for this project has been discontinued in the latest Cordova releases, as it's no longer necessary.

PhoneGap application showing old iOS 6 keyboard and old picker

I have recently started using html, javascript and css to build an app with PhoneGap. The first time I uploaded and ran it on my iPhone (running iOS 7) it showed the regular iOS 7 keyboard and picker. I then made some changes to the app, uploaded it and ran it but the keyboard and picker had reverted back to iOS 6 and before keyboards. Now what?
I am not using any external javascript frameworks right now and not using an IDE, just a simple code editor for explicitly writing the code.
Picker refers to the UIPickerView that shows in iOS web views on combo boxes.
Had the same issue for a while. I figured it was the javascript framework's fault. The real issue was the launch image. If the launch image doesn't fit the exact specifications it will launch the app in compatibility mode.
You can find the necessary specifications here: https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/ExpectedAppBehaviors/ExpectedAppBehaviors.html#//apple_ref/doc/uid/TP40007072-CH3-SW3
As an aside, I used this app from the mac app store in order to get the launch images exactly right. Worked great for me. https://itunes.apple.com/gb/app/asset-catalog-creator-free/id866571115?mt=12

Phonegap plugins not working

Phonegap plugins not working in Phonegap cordova-1.5.0 in iPhone. I added the plugin for date picker and one anohe plugin for making phonecall.
I used the plugins from
https://github.com/phonegap/phonegap-plugins/tree/master/iPhone.
Any one have any idea about this issue??
I just added the external JS file and called it directly. Do I need to make any changes in the plist or somewhere else. Can anyone tell me the steps to use the Phonegap Plugin in iPhone.?
Make sure that you are using the PhoneGap version that is compatible with the plugin structure (there were changes around 2.0, and Version 1.5 is pretty old). For the latest architecture, check here for details:
http://docs.phonegap.com/en/2.7.0/guide_plugin-development_index.md.html#Plugin%20Development%20Guide
For the older plugin architecture, check here:
http://www.adobe.com/devnet/html5/articles/extending-phonegap-with-native-plugins-for-ios.html
Depending on the version, yes, you may need to edit the .plist files in your Xcode project. You also have to add the native files to the Xcode project, not just the JavaScript.

Blackberry OS5+ webworks application is terribly slow

Iam developing a blackberry webworks application which is supposed to work on OS 5.0 and upwards.The app does use a fair bit of jquerymobile. The HTML's had already been developed and it was working well in the ripple emulator. But when I deployed it in an OS5.0 device, the load times were terrible. It took nearly a minute to load a page with some 3 images and a couple of tables (nothing was fetched from the server , all files were in the packaged application in the device). I even tried the pages on the native browser directly and its rendering capabilities were poor (css / jquery mobile etc came out horribly. Javascript was enabled in the device).
What I would like to know is, is native application/very basic html only way to get a decent experience on OS5.0? Is using fair bit of a javascript even feasible on OS5.0 HTML apps?
I even tried using a browserfield2 with caching but that too didnt make much difference.
Just wanted to see if things are indeed this bad in OS5.0 or if I missed something out. Any help/feedback will be greatly appreciated..

Categories

Resources