Photo Camera trouble Corona 319 (media.show(media.Camera, onComplete))

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]

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! [import]uid: 74460 topic_id: 15104 reply_id: 55874[/import]

fran,

We just added camera support to Android today. This feature will be made available in tomorrow’s daily build, which will be available to you if you are a paid subscriber. [import]uid: 32256 topic_id: 15104 reply_id: 57040[/import]

Hello!

Thank you for your reply.

Im working with 319 build version because I need the application work in almost all mobile phones. I understand this is the latest version that support arm6 processor.
Is possible to get this 319 version with camera support?

Thank you [import]uid: 74460 topic_id: 15104 reply_id: 57051[/import]

Fran, I’m sorry but we have no plans on supporting older Android devices anymore. The minimum we support is Android 2.2 with at least an ARM 7 processor. We were having too many issues with older Android versions and major performance problems with ARM 6 devices.

ciprian.filipas, no worries. Use what works best for you! I like C++ too. :slight_smile: [import]uid: 32256 topic_id: 15104 reply_id: 57143[/import]

“I’m sorry but we have no plans on supporting older Android devices anymore”

“older” ???
The majority of CURRENT phones on the market are ARMv6.

ARMv6 phones continue to be released because they are cheap. Almost all of the low-and-medium end phones are ARMv6.

Please relaunch your ARMv6 support or provide ways how your ARMv7 code can be cross-compiled to ARMv6. Otherwise developers are forced to use your obsolete Corona releases with ARMv6 support - or drop Corona. The performance of the old ARMv6 Corona is perfectly adequate.

IMNSHO, It is insane for Ansca and developers to cut themselves off from the major part of the market. Its the sure way to bankruptcy.

Thank you for your attention.

Geejay
[import]uid: 77956 topic_id: 15104 reply_id: 57214[/import]

I just tried this code with my MyTouch 4G, which has an snapdragon processor (which is “at least ARM v7”). Each time I clicked the screen to turn the camera on, the app crashed on me. Any ideas how I can test the camera on this device? [import]uid: 19999 topic_id: 15104 reply_id: 57714[/import]

Hi staypuffinpc,

You need to add the CAMERA permission to your “build.settings” file. Please see sample project “Media/Camera” included with the Corona SDK for an example on how to set up your build.settings file for the camera.

That said, it shouldn’t crash due to lack of permissions. It should log a warning instead and then no-op. I’ll write this up as a bug. Just so you know, this is the first revision of camera support on Android, so please feel free to inform us of any issues that you’ve encountered with it. During development, we found the camera to be quite challenging to add support for due to different behaviors on different Android devices… but we think we have those issues licked and it appears to be quite solid now. [import]uid: 32256 topic_id: 15104 reply_id: 57821[/import]

Geejay,

If you really feel that passionately about ARM6 support, then please feel free to start a new forum post and rally for support. If enough people ask for it, then obviously that is something Ansca cannot ignore. Just realize that dropping ARM6 support was not an easy decision for Ansca, but the main reason was due to poor performance which generated a lot of tech-support issues and Ansca’s customers receiving bad reviews for their apps.

Perhaps the best thing to do is to allow Corona developers to choose which architecture to build for (ARM6 or ARM7) and, based on their testing, determine if the performance of the ARM6 build is good enough to distribute. A simple app should be able to work on an ARM6 device just fine, but an intense game (which most of our customers seem to shoot for) will likely have performance problems and require ARM7.

Bottom line, I’m not the one you have to convince. Ansca’s management level needs to be convinced that it makes good business sense to add support for ARM6 again, because adding support for both architectures will take time and resources to set up. So again, start a new forum post, state your case/reasoning, rally support, and try to keep it civil and professional… then I guarantee you’ll get attention on this matter. If many others feel the same way, then perhaps re-opening this discussion is exactly what’s needed.

And I mean the above with the upmost respect. I am by no means biased towards/against ARM6/ARM7.

Best regards,
Joshua Quick [import]uid: 32256 topic_id: 15104 reply_id: 57823[/import]

@Joshua,
Sheesh! Sorry to have missed that. I tried it with the sample project file and it worked beautifully. I’d like to be able to create an app that can read QR codes. With this, I can control the camera, and with Graham Ransom’s charts code, I can create an QR code. The question is, where can I find a good tutorial that would allow me to check the camera image against a generated QR code? [import]uid: 19999 topic_id: 15104 reply_id: 57832[/import]

Hi staypuffinpc,

A QR code reader might be tough to implement because Corona does not expose a bitmap’s pixels to Lua. Also, we’re not exposing a live camera feed to Lua either. We only provide the resulting camera shot image and it can only be saved as a JPEG or PNG.

Hmm… I don’t think I have an easy solution for you. [import]uid: 32256 topic_id: 15104 reply_id: 57874[/import]

Deleted [import]uid: 74460 topic_id: 15104 reply_id: 59507[/import]