IBM Worklight - Using the camera in BlackBerry - blackberry

I am developing an image-scanning application for BlackBerry. The application takes the user to a success page if the correct image is scanned and a failure page is shown on scanning an incorrect image.
I am using the IBM Worklight framework for developing this app.
My question is: How can I open camera for scanning in BlackBerry?
I have developed the same application for iOS using Worklight. In iOS I've used this JavaScript syntax:
WL.native.show(arg1, arg2, arg3);
So I want to know what will be the syntax for opening camera/native page in the case of BlackBerry.

Just to make things clearer, you do not use WL.NativePage.show in order to use the camera in an iOS device. For that you use the Camera API provided by Apache Cordova.
WL.NativePage.show is meant to transition from a WebView to a native page.
You can, however, of course, use it to pass parameters and do whatever you want on the native side and then return to the WebView...
WL.NativePage.show is available only for iOS and Android.
Anyway,
In BlackBerry WebWorks apps (the type of BlackBerry apps supported in Worklight) you have several options:
Use the Camera API provided by BlackBerry
Use the Camera API provided by Apache Cordova
Worklight currently supports Cordova 2.3 (in Worklight 5.0.6.x) and Cordova 2.6 (in Worklight 6.0).

Related

Ionic Native Camera in browser

I have an ionic app where i use it to scan a bar/qr code. It's working fine in browser and android itself, but how can i open the camera while accessing it using android browser?
I use phonegap-barcodescanner and cordova
Cordova plugin is not available for the browser. Cordova plugin is something which communicates with native components of mobile phone e.g. camera. it's not possible to access camera using phonegap-barcode scanner in the android browser. I will recommend instead of PhoneGap barcode scanner use ngx-barcode-scanner
Link of sample project with demo: ngx-scanner

Is it possible to convert angularjs web application to IOS app with Ibeacon search functionality?

I have developed a web application using angularjs, now i want to convert ios application with iBeacons device searching functionality.
Is it possible to do this, any one please give me advice on this?
Yes this is possible, you can repurpose your Angular single page app into a Cordova/PhoneGap container, then use appropriate plugins (which bridge platform specific native code to Javascript) to add iBeacon or other beacon support. If you don't find plugins that do what you want, you can create your own if you are comfortable working in the native languages of the platforms you want to use (Java for Android, Objective C or Swift for iOS).
Example plugins that already exist to help with this would be:
cordova-plugin-ibeacon
ngCordova Cordova Beacon
There's an example of how to go about this using Angular JS / Ionic framework here.
There is no way to directly scan for beacons in JavaScript. This is true whether you are talking about a web app running in Mobile Safari on iOS or inside a UIWebView container within a native iOS Web app.
If you want to combine JavaScript-based apps with beacons, the alternative is to build Hybrid apps using technologies like Cordova or Ionic (which is built off of Cordova). You can then use Cordova plugins that let you interact with native code that does the beacon scanning, and pass it back to your JavaScript application. One such plugin that accomplishes this is here:
https://github.com/petermetz/cordova-plugin-ibeacon
There are limitations with this approach. Beacon scanning typically has to be in the foreground, and you can't really wake up the app on beacon detection.
Full disclosure: I am the lead developer on the Android Beacon Library open source project upon which the above plugin is based.

is Windows phone's Launcher similar functionality available on iOS?

I am developing an application using Xamarin Forms, targeting iOS, Android and Windows Phone.
Using Dependency Service, I implemented to open/preview file that can be an audio, video or text document.
On Android, I used Intent with Android.Content.Intent.ActionView.
On Windows Phone, I used Launchers.
Is there any similar simple way on iOS to view a file?

Integrate Worklight project in existing IOS project

I have to integrate a Worklight project into my existing IOS project (Objective-C)
I have googled but i have not found a clear "guide" on how to perform this integration.
Could you drive me in the right way of integrating this project? The idea is to have a button in my IOS project that open a WebView that loads the pages (HTML5 and javascript with AngularJS and Jquery) contained into the Worklight project.
Thank you so much
There is no guide for this approach, as I don't think it is sustainable.
In Worklight you currently have two approaches:
A native application to which you add the Worklight Native iOS SDK, allowing you to implement security features, invoke adapters and use various other features
A Hybrid application to which you can add native functionality (via Cordova or otherwise), and use the entire set of features provided by Worklight
It is important to note that a Hybrid application is a native application. It is a fully actual real native app. It is a native shell that calls a webview (provided by Cordova) into which the Worklight JS framework and the application web resources are loaded, and thus you see your web app. A Hybrid application allows you to mix & match web and native in one.
So what I am saying is that you can't take an existing iOS app and transplant it into another existing iOS app.
It sounds to me like what you are essentially trying to do, is what a Hybrid app is. A native app that displays web content...
So:
This is not an approach Worklight officially supports. By doing this, you are on your own
You could maybe take the guts of a Hybrid app's iOS environment (myapp\iphone\native) - its classes and resources and add them into your existing app and load the main class which theoretically, or at least the wanted effect, will load the Cordova webview. But I give this low chances of success...

BlackBerry OS 6 App Dev

When developing a application for iOS that pulls in a web site, you have a very simple web app wrapper that as far as I know acts like an iframe, pulls in the web site and boom - you have an app.
My understanding is that if done this way you are using a "stripped down" Safari to view the web site in a "app" as it is a web wrapper.
When developing an app for BB OS6, is it the same concept? If I develop a wrapper that says "go fetch site x and display it in this app" is it going to use BB OS6 default browser APIs to render said site?
Also is there links to said API?
If all you want is a container to display Web content I'd highly recommend you use Webworks (or cordova for cross platform) as opposed to Java. WebWorks already creates and sets up the bf2 for you in a tested and proven way.
The equivalent of UIWebView for iOS would be the BlackBerry BrowserField.
If you want some examples of how to use it, I recommend installing the BlackBerry Eclipse plugin. That will install in Eclipse the full BlackBerry Java SDK (e.g. version 6.0, 7.0, etc.), which comes with lots of sample code. From Eclipse, you can then
Import... -> BlackBerry -> Import BlackBerry Samples -> BrowserField2Demo.
Note that you want the BrowserField2Demo, not BrowserFieldDemo!
Or, you can go directly to the github site with BlackBerry sample code.

Resources