What am I doing wrong... Trying to use the camera

My code is below (actually 2 samples put together):
Everything seems to work okay, but you select a photo sessionComplete never seems to get called, or if it does, nothing ever gets printed to the screen, etc… Any help is greatly appreciated, as I am not coming up with anything…

[lua]local bkgd = display.newRect( 0, 0, display.contentWidth, display.contentHeight )
bkgd:setFillColor( 0, 0, 0 )

local roundedRect = display.newRoundedRect( 10, 50, 300, 40, 8 )
roundedRect:setFillColor( 0, 0, 0, 170 )

local t = ui.newLabel{
bounds = { 10, 55, 300, 40 },
text = “Waiting for button event…”,
font = “AmericanTypewriter-Bold”,
textColor = { 255, 204, 102, 255 },
size = 18,
align = “center”
}

local showCamera = function(event)
–t:setText( "id = " … event.id … ", phase = " … event.phase )
media.show( media.Camera, sessionComplete )
–return true
end

local showPhotos = function(event)
–t:setText( "id = " … event.id … ", phase = " … event.phase )
media.show( media.PhotoLibrary, sessionComplete )
–return true
end

local sessionComplete = function(event)
local image = event.target
–display.newImage (image)
print( "Camera ", ( image and “returned an image” ) or “session was cancelled” )
print( "event name: " … event.name )
print( "target: " … tostring( image ) )

if image then
– center image on screen
image.x = display.contentWidth/2
image.y = display.contentHeight/2
local w = image.width
local h = image.height
print( “w,h = “… w …”,” … h )
end
end

http://developer.anscamobile.com/reference/index/displaysave
–local savePhoto = function(event)
– local screenShot=display.captureScreen( true )
– screenShot:removeSelf()
–end
local cameraButton = ui.newButton{
default = “buttonBlueSmall.png”,
over = “buttonBlueSmallOver.png”,
onEvent = showCamera,
id = “cameraButton”,
text = “Camera”,
size = 12,
emboss=true
}

local photoBrowseButton = ui.newButton{
default = “buttonBlueSmall.png”,
over = “buttonBlueSmallOver.png”,
onEvent = showPhotos,
id = “photoBrowseButton”,
text = “Photos”,
size = 12,
emboss=true
}

cameraButton.x = 85; cameraButton.y = 300
photoBrowseButton.x = 250; photoBrowseButton.y = 300[/lua] [import]uid: 19193 topic_id: 5479 reply_id: 305479[/import]

Oh, I think I see the problem. print() doesn’t go to the phone’s screen does it? Is it for the debugger? How does one run a camera app in the simulator, what do I chose when the Native Display Objects browser pops up? [import]uid: 19193 topic_id: 5479 reply_id: 18486[/import]

Correct, print() only goes to the Corona Terminal window. In the Corona Simulator, the media.show() method opens a dialog that lets you select an image from disk, which then calls the sessionComplete handler. I’m not sure what you mean by the “Native Display Objects browser”…

Tim [import]uid: 8196 topic_id: 5479 reply_id: 18592[/import]

Whenever I run a camera app in the simulator, and I click to get the camera, or to browse photos, an Open File Dialog pops up, asking me to pick a ‘Native Display Object’

I assumed I couldn’t test camera apps in the simulator, but would love to be wrong.

Are there any good tutorials on debugging and using the Corona Terminal window? [import]uid: 19193 topic_id: 5479 reply_id: 18626[/import]