Has
anyone used the acquire image commands on Android? I've been testing on Beta 11 and the commands do not work at all or, at best, are very slow on Android devices. This includes both
ShowChooseImageScreen() and
ShowImageCaptureScreen().
I have tested on three different Android devices, importing an image from the photo library and acquiring an image from the camera.
HTC Galaxy S (2.3.x): An image ID is successfully captured (10001) when the user chooses or takes a photo, but the returned image is empty and has dimensions of 0x0 to 0x2 (when imported or captured via camera). If you apply it to a sprite nothing is displayed.
LG Optimus (2.3.x): Loading an image from the library will eventually work successfully. Capturing an image from the camera returns a 0x0 to 0x2 empty image as described before. After selecting an image from the library, a solid black screen appears for an extended period of time (20-30 seconds if loading a 2048x1536).
HP TouchPad (4.x): Same results as HTC Galaxy S.
In all cases, loading an image or acquiring one from the camera (when successful) results in an extended period where the screen is completely black as if it has frozen. This can last
30-60 seconds or longer depending on the size of the image. There is no way to display a loading screen or anything during this process, that I have found. Not an acceptable delay for modern apps to acquire images.
I currently have one app on the market that makes use of these commands; these features are unlockable via IAP. It isn't good if users who pay to upgrade cannot use this functionality due to the bugs described previously.
I was waiting for AGK's "
Hide It Find It" to be released on Android since that relies heavily on image capture, so that I could see how it performed, but alas that app is still only on iOS (after nearly three months of waiting). I have written about the sluggishness and freezing issues before but now I can't even capture on most devices.
Below is the simple code snippet to try this on your own devices:
Get Image From Library
// Initialize
SetVirtualResolution(GetDeviceWidth(), GetDeviceHeight())
SetSyncRate(60, 0)
// Get Image from Library
If ShowChooseImageScreen() = 1
// Acquire Image
While IsChoosingImage() = 1
Sync()
Endwhile
// Assign loaded image
loadedImage = GetChosenImage()
// Loaded image exists
If loadedImage > 0
// Display image as sprite
imageSprite = CreateSprite(loadedImage)
SetSpriteSize(imageSprite, GetDeviceWidth()/2, -1)
Endif
Else
Message("Cannot get capture media.")
Endif
// Main Loop
Do
// Print image dimensions
If loadedImage > 0
Print(GetImageWidth(loadedImage))
Print(GetImageHeight(loadedImage))
Endif
Sync()
Loop
Get Image From Camera
// Initialize
SetVirtualResolution(GetDeviceWidth(), GetDeviceHeight())
SetSyncRate(60, 0)
// Get Image from Camera
If ShowImageCaptureScreen() = 1
// Acquire Image
While IsCapturingImage() = 1
Sync()
Endwhile
// Assign loaded image
loadedImage = GetCapturedImage()
// Loaded image exists
If loadedImage > 0
// Display image as sprite
imageSprite = CreateSprite(loadedImage)
SetSpriteSize(imageSprite, GetDeviceWidth()/2, -1)
Endif
Else
Message("Cannot get capture media.")
Endif
// Main Loop
Do
// Print image dimensions
If loadedImage > 0
Print(GetImageWidth(loadedImage))
Print(GetImageHeight(loadedImage))
Endif
Sync()
Loop