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:
[lua]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 ) [/lua] [import]uid: 74460 topic_id: 15104 reply_id: 315104[/import]
[import]uid: 32256 topic_id: 15104 reply_id: 57143[/import]