Navigating from HTML pages to native black berry page/screen [duplicate] - blackberry

This question already has an answer here:
IBM Worklight - Using the camera in BlackBerry
(1 answer)
Closed 8 years ago.
Platform: Black berry 6 and 7
Framework: IBM Worklight
Description:
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.
Scenario:
I have developed HTML pages for this app, now I need to put transition from HTML page to camera page of Black berry i.e. I have a button on my HTML page labelled as 'Scan Image', on clicking/taping this button camera should open and start scanning images, So my question is :
How that transition can be done, I mean what is the javascript syntax to navigate from HTML page to native camera page?

This is the exact same question as you have asked TODAY, here: IBM Worklight - Using the camera in BlackBerry
Why do you ask again?
There is no "transition" involved. You use the JavaScript API provided by either Apache Cordova or BlackBerry themselves to access the camera, take a picture and handle the success or failure.
Please stop for a moment to write your app. Create a demo app and implement ONLY the camera support; if it works, start implementing it the way you want to, in your app.
Use the Camera API provided by BlackBerry
Use the Camera API provided by Apache Cordova
Please take the time to read the pages and the examples.
There are clear instructions on how to add permission for using the Camera and clear code examples on how to implement it.
http://docs.phonegap.com/en/2.6.0/cordova_camera_camera.md.html#Camera

Related

How can i upload video to Twitter using IOS

I have a local video link, and i want when the user press the button -> show twitter app with my video and title there (without using UIActivityViewController), just by pressing the button
You have to choose which way you want to go to upload a video, i.e. post a tweet with just that title you've mentioned.
Option 1
Use the HTTP API and create a URLRequest that contains the video as 'attachment'. You have to handle authentication first or the request will most likely fail.
Option 2 (Not really an option anymore)
Another way would be the iOS SDK provided, as given in the other example here. Problem is: there is no longer an official Twitter SDK for iOS. You could try your luck with the archived OpenSource SDK but maintainability is pretty decent with this.

MediaError Access to screen denied while trying to implement Screenshare

I am using the Web SDK for Agora.io and trying to implement video chat feature and have screen sharing enabled. I am having this error generated:
MediaError "Access to screen denied."
Could anyone please help me out?
Which platform are you using to test the screen sharing?
Agora's screen sharing does not work in Safari, and needs a plugin to run in Chrome. Only FireFox supports screen-sharing out of the box.
The plugin process is available within the Agora documentation: https://docs.agora.io/en/Video/screensharing_web?platform=Web

How to display photo library permissions dialog in Cordova?

Hi we are developing an IBM MobileFirst Platform-based Hybrid Application. In our application we are accessing user gallery (to upload photos). for this in iPhone we need to ask the user permission explicitly, to ask user permission in iPhone we need to display dialog box. Here my question is the dialog box which we are going to show to the user is custom dialog box or is there any native feature built-in in MobileFirst, or with the help of any cordova plugin?
You can use requestCameraRollAuthorization() in cordova-diagnostic-plugin to request native iOS permission to access the user photos:
cordova.plugins.diagnostic.requestCameraRollAuthorization(function(granted){
console.log("Authorization request for camera roll was " + (granted ? "granted" : "denied"));
}, function(error){
console.error(error);
});
MobileFirst does not handle any permissions for you - it is not that kind of a framework. This really relates to the Cordova layer in your app, which access the photo library.
You need to display a dialog box asking the user whether or not does s/he allow for the access to access the photo library. You can use WL.SimpleDialog for this purpose, for example.
Read more here:
http://docs.phonegap.com/en/3.3.0/guide_appdev_privacy_index.md.html#Privacy%20Guide
Cordova Camera Plugin in IOS 9
perhaps to check if there is access given, create also a Cordova plug-in that will check for it using native code: Determine if the access to photo library is set or not - PHPhotoLibrary (iOS 8)

App with custom URL callback and custom search URL

I'm looking for recommendations for an iOS barcode scanner app. Specifically for iPad which will support a custom URL callback to enable the app to be launched from a web browser.
Additionally, it needs to support and a custom search URL which will send the user back to the website once the barcode has been decoded into a URN (SKU).
I have discovered ZBar which is an excellent app, unfortunately it doesn't support custom URL callback and it's designed for the iPhone.
Another app pic2shop PRO seems to tick these boxes, but it's relatively expensive at £10.49 and the setup will require somewhere in the region of 200 installs.
I did a similar project using the free version of pic2shop . The thing is that the free version can read only these types of barcodes : UPC-A, UPC-E, EAN-13, EAN-8 , according to the documentation of the app.
Pic2shop is a free barcode scanner app available for iOS® and Android®. It reads UPC-A, UPC-E, EAN-13, EAN-8 and QR codes. The app also display comparison shopping results for UPC and EAN.
From my personal experience, I can say that it scans and decodes the barcode very fast and very accurate.
In my project the app is launched from a webpage, it works for both android and ios. In order to get it working you have to invoke the pic2shop app from a url and then set your callback address. You will find the decoded barcode data as a value to a parameter in the callback url. To help you more, you can get those values using this javascript function found here.
For example:
<input type=button OnClick="scan();" value="Scan Barcode">
<script>
function scan(){
window.location="pic2shop://scan?callback=http://yourwebsiteurl.com/index.html?barcode=ean"
}
</script>
As soon as the item is successfully scanned it will redirect you to the callback url with the actual barcode number as a value to a parameter. For example http://yourwebsiteurl.com/index.html?barcode=5123548745123. I already told you how to get the value of a url parameter with javascript.
PDF417.mobi Pro barcode scanner app supports that use case.
Note: I'm a developer on that project.
Basically, the app can be launched from any other app, including a web application, when url in the form: pdf417://scan?type=PDF417,UPCA&callback=myscheme://myaction is launched.
The app then scans the barcode, in multiple formats, (PDF417 and UPCA in this example), until the result is obtained.
Then, the app opens the URL myscheme://myaction. In your case, this can be your web service, http://www.somemyscanner.com/service.
Specifically, it will open the URL using format: http://www.somemyscanner.com/service?data=[data]&type=[type].
You can then use those parameters to implement your desired functionalities.
I tried the PDF417 app and it is EXTREMELY expensive (for an app - $28) and does not work. I bought it anyway because I am trying to solve the same issue and I can tell you it is not the solution for general barcode scanning.
It might work with pdf417 barcodes, but those are few and far between and I haven't been able to get it to work. I definately does not support any standard barcode formats. It also has no settings panel (in settings) and the tap target in the app that should be settings just take you to the company web site.
I am still testing other apps but haven't found any app that does what you ask, Red Laser used to but it no longer has that functionality.

How to access ipad camera using flex?

My application needs to provide a button to be clicked to turn on the ipad camera and once the picture is taken it should be able to retrieve the picture and show it. I know I can use the CameraRoll - AS3 class but it just allows me to access the camera roll not the camera itself.
You should find your question answered here by Jason Sturges [ take photo using Adobe Builder (flex) for iOS ]
He points you to the XpenseIt Tutorial(Flex mobile project FXP download). Download the Final .fxp file and add it to your workspace and you'll find good resources to adapt to your needs.
Another resource provided by Adobe Blog contributor Christian Cantrell
http://blogs.adobe.com/cantrell/archives/2011/02/how-to-use-cameraui-in-a-cross-platform-way.html

Resources