• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Android + CameraUI

Participant ,
Aug 03, 2017 Aug 03, 2017

Copy link to clipboard

Copied

Hello,

I am testing on Galaxy S7, Android 7.0 and AIR SDK 25

Tried following CameraUI examples and asking for permissions, yet the images taken are never loaded:

Media captured...

Asynchronous media promise.

Error #2044: Unhandled IOErrorEvent:. text=Error #2124: Loaded file is an unknown type.

Tracing the mediapromise URL returns:

file:///data/user/0/******/cache/Pictures/IMG_20170803_1517591533635246.jpg

(*** above are my package name)

Any ideas?

TOPICS
Development

Views

1.3K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 04, 2017 Aug 04, 2017

Copy link to clipboard

Copied

Just tried AIR 24 - 25 - 26, same issue, cannot load any image from CameraUI.

Made sure to add

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>

I tried imagePromise.open(); and waiting for the data to load, but bytes loaded have 0 in length

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Aug 04, 2017 Aug 04, 2017

Copy link to clipboard

Copied

You have the camera permission as well?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 04, 2017 Aug 04, 2017

Copy link to clipboard

Copied

Yes Iam asking for it via requestPermission. The camera opens and I take a picture. But when I press OK the Image is never loaded.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Aug 04, 2017 Aug 04, 2017

Copy link to clipboard

Copied

Show your code then starting with the event handling the promise > (MediaEvent.COMPLETE)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 07, 2017 Aug 07, 2017

Copy link to clipboard

Copied

ASWC  wrote

Show your code then starting with the event handling the promise > (MediaEvent.COMPLETE)

I also checked on Samsung J5, Android 6.0.1, same issue, here is the code:

private var deviceCameraApp:CameraUI = new CameraUI();

private var imageLoader:Loader;

private function barClicked(e:MouseEvent):void

{

//dispatchEvent(new MouseEvent(MouseEvent.CLICK));

if( !CameraUI.isSupported ) return;

if(CameraUI.permissionStatus != PermissionStatus.GRANTED)

{

deviceCameraApp.addEventListener(PermissionEvent.PERMISSION_STATUS, permissionChange, false, 0, true);

try {

deviceCameraApp.requestPermission();

} catch(e:Error)

{

// another request is in progress

}

return;

}

connectCamera();

}

private function permissionChange(ev:PermissionEvent):void

{

if (ev.status == PermissionStatus.GRANTED)

connectCamera();

}

private function connectCamera():void

{

deviceCameraApp.addEventListener( MediaEvent.COMPLETE, imageCaptured );

deviceCameraApp.addEventListener( Event.CANCEL, captureCanceled );

deviceCameraApp.addEventListener( ErrorEvent.ERROR, cameraError );

deviceCameraApp.launch( MediaType.IMAGE );

}

private function imageCaptured( event:MediaEvent ):void

{

trace( "Media captured..." );

var imagePromise:MediaPromise = event.data;

if( imagePromise.isAsync )

{

trace( "Asynchronous media promise." );

imageLoader = new Loader();

imageLoader.contentLoaderInfo.addEventListener( Event.COMPLETE, asyncImageLoaded );

imageLoader.contentLoaderInfo.addEventListener( IOErrorEvent.IO_ERROR, cameraError );

imageLoader.loadFilePromise( imagePromise);

}

else

{

trace( "Synchronous media promise." );

imageLoader.loadFilePromise( imagePromise );

showMedia( imageLoader );

}

}

private function captureCanceled( event:Event ):void

{

trace( "Media capture canceled." );

}

private function asyncImageLoaded( event:Event ):void

{

trace( "Media loaded in memory." );

showMedia( imageLoader );   

}

private function showMedia( loader:Loader ):void

{

this.addChild( loader );

}

private function cameraError( error:ErrorEvent ):void

{

trace( "Error:" + error.text );

}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 07, 2017 Aug 07, 2017

Copy link to clipboard

Copied

I also tried:

actionscript 3 - AS3 ios cameraUI save and load image fails, why? - Stack Overflow

But "dataSource.readBytes( imageBytes );" is filling imageBytes with length zero so I am guessing the file does not exist.

As I said before I also tried loading the file via its URL but it says it does not exist.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 17, 2017 Aug 17, 2017

Copy link to clipboard

Copied

just as an update. the app runs fine on ios. the issue seems with android. So to summarize:

CameraUI does not work on android air sdk 24 25 or 26.

Makes you doubt the QA of the air sdk and that whole roadmap thing . . . There is something broken in how you manage your releases. You fix something and break another major thing.

We are switching to another platform as we cannot just wait for you guys to fix what should be working out of the box. Either open source it if you cannot fix it or just quit.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 11, 2017 Nov 11, 2017

Copy link to clipboard

Copied

When Take Photo and temp image file is made by device

First Path is temp Dictionary

and After Path is Gallery Dictionary

When I Load Photo path is Changed

so Cannot load photo because I got path temp Dictionary path

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Dec 26, 2017 Dec 26, 2017

Copy link to clipboard

Copied

LATEST

So no one is using CameraUI on Android?

Bug posted on:

Tracker

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines