Hello!
Im using camera example of Corona. First I compile on OSX with Corona Version 2011.319 (2011.1.20) and then I install .apk file on my android 2.2 mobile phone. The problem is camera is not opening and I dont know why. Also I tried to compile with the last Corona version but it doesnt work.
I would like to get some help about this subject.
Thank you!
Im using the next code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | local bkgd = display.newRect( 0, 0, display.stageWidth, display.stageHeight ) bkgd:setFillColor( 128, 0, 0 ) local text = display.newText( "Tap anywhere to launch Camera", 0, 0, nil, 16 ) text:setTextColor( 255, 255, 255 ) text.x = 0.5 * display.stageWidth text.y = 0.5 * display.stageHeight local sessionComplete = function(event) local t = event.target local alert = native.showAlert ("Camera opened!","Your image has been captured.", { "OK" } ); print( "Camera ", ( not t and "returned an image" ) or "session was cancelled" ) print( "event name: " .. event.name ) print( "target: " .. tostring( t ) ) if t then local w = t.width local h = t.height print( "w,h = ".. w .."," .. h ) end end local listener = function( event ) local alert = native.showAlert ("Test!","Tap.", { "OK" } ); media.show( media.Camera, sessionComplete ) return true end bkgd:addEventListener( "tap", listener ) |
I read about camera is not supported on Android devices, is that true at the moment?
I would like to know when this camera API will be available for android devices or if there is another way to implement this.
Thank you!