Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-13694] BlackBerry: Implement Camera

GitHub Issuen/a
TypeNew Feature
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2014-06-05T19:28:17.000+0000
Affected Version/sn/a
Fix Version/s2013 Sprint 12 BB, 2013 Sprint 12, Release 3.3.0, Release 3.4.0
ComponentsBlackBerry
Labelsblackberry, module_c, module_media, qe-3.3.0, qe-testadded
ReporterJosh Roesslein
AssigneePedro Enrique
Created2013-04-26T23:10:55.000+0000
Updated2014-06-11T18:15:54.000+0000

Description

Test Case

var win = Ti.UI.createWindow({layout: 'vertical'});

var button = Ti.UI.createButton({title: 'take picture'});
button.addEventListener('click', function() {
	Ti.Media.showCamera({
		'cancel': function() {
			Ti.API.info('cancel');
		},
		'error': function() {
			Ti.API.info('error');
		},
		'success': function(e) {
			Ti.API.info('success: size=' + e.media.length);
      imageView.image = e.media;
		}
	});
});
win.add(button);

var imageView = Ti.UI.createImageView();
win.add(imageView);

setTimeout(function() {
	Ti.Media.hideCamera();
}, 3000);

win.open();
Expected: Run the application and click "take picture". After you take a picture you should return back to the application and the image should be displayed in the image view. Try clicking "take picture" again, but this time cancel by hitting the back arrow. You shouldn't see any new image and "cancel" should be logged.

Comments

  1. Josh Roesslein 2013-05-17

    We can probably use the camera card to implement this feature. We cannot support overlay views using this method, but in the future we could use the lower level camera API to provide this functionality. This is simliar to how we implemented camera on the Android platform.
  2. Josh Roesslein 2013-06-11

    Created pull request [#99](https://github.com/appcelerator/titanium_mobile_blackberry/pull/99) for master.
  3. Pedro Enrique 2013-06-14

    Merged into master. Note, this needs to be added to tiapp.xml
       <blackberry>
       	<permissions>
       		<permission>access_shared</permission>
       	</permissions>
       </blackberry>
       
  4. Priya Agarwal 2013-10-25

    Verified the fix with : Appcelerator Studio: 3.2.0.201310230601 SDK:3.2.0.v20131024120843 alloy: 1.2.2 acs: 1.0.7 npm: 1.3.2 titanium: 3.2.0 titanium-code-processor: 1.0.3 Device:Blackberry Z10(v 10.0) OS: OSX 10.9 Getting captured image in imageView after camera success callback.
  5. Olga Romero 2014-05-23

    Tested and cannot get captured image in imageView after success callback. Environment: Appcelerator Studio, build: 3.3.0.201405161313 Titanium SDK, build: 3.3.0.v20140522144936 Node.JS Version: v0.10.13 NPM Version: 1.3.2 acs@1.0.14 alloy@1.4.0-alpha2 npm@1.3.2 titanium@3.3.0-alpha5 titanium-code-processor@1.1.1 Device: BB Z10 (10.2.1)
  6. Pedro Enrique 2014-06-05

    PR: https://github.com/appcelerator/titanium_mobile_blackberry/pull/261 Permissions needed are:
       <blackberry>
       	<permissions>
       		<permission>access_shared</permission>
       		<permission>use_camera</permission>
       	</permissions>
       </blackberry>
       
  7. Olga Romero 2014-06-11

    Tested using Mac osx 10.9.3 Mavericks Appcelerator Studio, build: 3.3.0.201406061445 Titanium SDK, build: 3.3.0.v20140611084912 Node.JS Version: v0.10.13 NPM Version: 1.3.2 acs@1.0.14 alloy@1.4.0-beta npm@1.3.2 titanium@3.3.0-beta2 titanium-code-processor@1.1.1 Device: BB Z10 (10.2.1) After permission was added, I could see the image in the ImageView after success callback. Although the image taken appears rotated, the image is correct in the photo gallery.

JSON Source