Android Programming Press on the image to return to the main documentation page.

ACL

Written by XverhelstX

List of types:

AdvancedCamera

AdvancedCamera

The new, improved camera library has a lot of new functions! These include:
flashlight, scene modes, orientations, front- and back camera, picture size,
white balance and a lot more! Only one process can access the camera at any
time. Therefore it is highly recommended to initialize the camera object in
Activity_Resume and release it in Activity_Pause. A working example with
explanations is available
here.
This is an 'Activity Object', it cannot be declared under Sub Process_Globals.

Permissions:

android.permission.CAMERA
android.permission.WRITE_EXTERNAL_STORAGE
android.permission.RECORD_AUDIO
android.permission.FLASHLIGHT
android.permission.RECORD_VIDEO
android.permission.WRITE_SECURE_SETTINGS
android.permission.BLUETOOTH
android.permission.BLUETOOTH_ADMIN
android.permission.INTERNET

Events:

Ready (Success As Boolean)
PictureTaken (Data() As Byte)

Members:


  Antibanding As String  [write only]

  AppTrial (FrameProtect As String, WebServer As String, IMEI As String, Period As String)

  AvailableFrame As Boolean  [read only]

  CameraBack

  CameraBack2

  CameraFront

  CameraFront2

  ColourEffect As String  [write only]

  CurrentAntibanding As String  [read only]

  CurrentColourEffect As String  [read only]

  CurrentFlashMode As String  [read only]

  CurrentFocusMode As String  [read only]

  currentFrame As Byte()

  CurrentPictureSizeHeight As Int  [read only]

  CurrentPictureSizeWidth As Int  [read only]

  CurrentSceneMode As String  [read only]

  CurrentWhiteBalance As String  [read only]

  decodeYUV420SP (rgb() As Int, yuv420sp() As Byte, width As Int, height As Int)

  detectFaces (Dir As String, Filename As Stringbitmap As android.graphics.Bitmap, Width As Int, Height As Int, maxFaces As Int)

  DroidLED

  EULER_X As Int

  EULER_Y As Int

  EULER_Z As Int

  ExposureCompensation As Int

  FaceConfidence As Float  [read only]

  FaceEyesDistance As Float  [read only]

  FaceFound As Int  [read only]

  FaceMidPointX As Float  [read only]

  FaceMidPointY As Float  [read only]

  FlashAuto

  FlashOff

  FlashOn

  FlashTorch

  FocalLength As Float  [read only]

  FocusMode As String  [write only]

  FrameProtect As String

  getPictureOnCurrentFrame (Width As Int, Height As Int, Quality As Int)

  getSupportedPictureSizeHeight (index As IntAs Int

  getSupportedPictureSizeWidth (index As IntAs Int

  GPSAltitude As Double  [write only]

  GPSLatitude As Double  [write only]

  GPSLongitude As Double  [write only]

  GPSTimeStamp As Long  [write only]

  HorizontalViewAngle As Float  [read only]

  Initialize (Panel As android.view.ViewGroup, EventName As String)

  isDecoding As Boolean  [read only]

  isLEDEnabled As Boolean

  ISOValue As Int  [write only]

  isZoomSupported As Boolean

  LEDenable (tf As Boolean)

  MaxExposureCompensation As Int  [read only]

  MaxZoom As Int  [read only]

  MinExposureCompensation As Int  [read only]

  mIsFlashlightOn As Boolean

  onPreviewFrame (data() As Byte, camera As android.hardware.Camera)

  openFrontFacingCameraGingerbread

  OriLandscape

  OriLandscapeAPI8

  OriPortrait

  OriPortraitAPI8

  ParmStr As String

  PictureSize (width As Int, height As Int)

  pose (euler As IntAs Float

  PreviewFormat As Int  [read only]

  PreviewFrameRate As Int

  Quality As Int  [write only]

  rCPKey (k As StringAs String

  reconnect

  Release

  removeGPSData

  rotateBitmap (bitmap As android.graphics.Bitmap, degrees As IntAs android.graphics.Bitmap

  rotateBitmap2 (data() As Byte, degrees As IntAs android.graphics.Bitmap

  SceneMode As String  [write only]

  setPreviewFpsRange (min As Int, max As Int)

  setResolution (width As Int, height As Int)

  setZoom (value As Int, Zoom As String, Zoom2 As String)

  setZoomIn

  setZoomOut

  StartPreview

  StopPreview

  SupportedAntibanding As java.util.List  [read only]

  SupportedColourEffect As java.util.List  [read only]

  SupportedFlashMode As java.util.List  [read only]

  SupportedFocusMode As java.util.List  [read only]

  SupportedPictureFormats As java.util.List  [read only]

  SupportedPictureSize As Int  [read only]

  SupportedPreviewFpsRange As java.util.List  [read only]

  SupportedPreviewFrameRates As java.util.List  [read only]

  SupportedSceneMode As java.util.List  [read only]

  SupportedWhiteBalance As java.util.List  [read only]

  TakePicture

  TakePicture2 (degrees As Float)

  toggleFlashLight

  uploadFrame (PHPProtect As String, Frame() As Byte, WebClient As String)

  VerticalViewAngle As Float  [read only]

  WhiteBalance As String  [write only]

  wiCPKey (k As String, v As Integer)

  wsCPKey (k As String, v As String)

Members description:

Antibanding As String  [write only]
Sets the Antibanding. ANTIBANDING_50HZ: Sets the antibanding to 50Hz.
ANTIBANDING_60HZ: Sets the antibanding to 60Hz. ANTIBANDING_AUTO: Sets
the antibanding to automatic mode. ANTIBANDING_OFF: Sets the antibanding
off. For example: Camera1.setAntibanding = "ANTIBANDING_AUTO"
AppTrial (FrameProtect As String, WebServer As String, IMEI As String, Period As String)
A trial for your app.
Sends a HTTP POST method to the webserver.
FrameProtect = Small Password Protection
WebServer = URL to listening PHP file
IMEI = The Device IMEI
Period = the amount that the app can be opened.

Listen on Webserver for:
"PHPProtect"
"IMEI"
"TrialPeriod"
AvailableFrame As Boolean  [read only]
If there is an available frame.
CameraBack
Use the back camera as primary.
Old
CameraBack2
Use the back camera as primary.
CameraFront
Use the front camera as primary.
Return type: @return:
CameraFront2
Use the front camera as primary.
ColourEffect As String  [write only]
Sets the color effect of a picture. The following effects are: AQUA,
BLACKBOARD, MONO, NEGATIVE, NONE, POSTERIZE, SEPIA, SOLARIZE, WHITEBOARD.
For example: Camera1.setColourEffect = "SEPIA"
CurrentAntibanding As String  [read only]
Returns the current antibanding. (String)
CurrentColourEffect As String  [read only]
Returns the current colour effect. (String)
CurrentFlashMode As String  [read only]
Returns the current flash mode. (String)
CurrentFocusMode As String  [read only]
Returns the current focus mode. (String)
currentFrame As Byte()
Returns current frame.
CurrentPictureSizeHeight As Int  [read only]
Returns the current picture size. (Size)
CurrentPictureSizeWidth As Int  [read only]
Returns the current picture size width. (Size)
CurrentSceneMode As String  [read only]
Returns the current scene mode. (String)
CurrentWhiteBalance As String  [read only]
Returns the current white balance. (String)
decodeYUV420SP (rgb() As Int, yuv420sp() As Byte, width As Int, height As Int)
Converts raw data to jpg.
detectFaces (Dir As String, Filename As Stringbitmap As android.graphics.Bitmap, Width As Int, Height As Int, maxFaces As Int)
Detect faces in a picture.
It makes a red rectangle around the face.
Filename = the name of the file that will be saved with the rectangles on the SD Card.
Bitmap = mutable or immutable bitmap image
Width = bitmap width
Height = bitmap height
maxFaces = the maximum amount of faces to look for.
Dim btmp As Bitmap
btmp.Initialize(File.DirRootExternal,"faces_2004W_comp1.jpg")
Camera1.detectFaces("detectedFace",btmp,btmp.Width,btmp.Height,43)
DroidLED
Do not use this
EULER_X As Int
EULER_Y As Int
EULER_Z As Int
ExposureCompensation As Int
Gets the exposure compensation. A technique for adjusting the exposure
indicated by a photographic exposure meter.
FaceConfidence As Float  [read only]
Returns a confidence factor between 0 and 1.
This indicates how certain what has been found is actually a face.
A confidence factor above 0.3 is usually good enough.
Given by the last found face.
FaceEyesDistance As Float  [read only]
Returns the distance between the eyes.
Given by the last found face.
FaceFound As Int  [read only]
Returns all found faces on the picture
Given by the last found face.
FaceMidPointX As Float  [read only]
Returns the midpoint of the eyes on the x-axis.
Given by the last found face.
FaceMidPointY As Float  [read only]
Returns the midpoint of the eyes on the y-axis.
Given by the last found face.
FlashAuto
Enables the flashlight to turn on automatically.
FlashOff
Turns the flashlight off.
FlashOn
Turns the flashlight on.
FlashTorch
Turns the flashlight on (Torch Mode).
FocalLength As Float  [read only]
Gets the focal length (in millimeter) of the camera.
Returns the focal length. This method will always return a valid value.
FocusMode As String  [write only]
Sets the focus mode. MACRO: Close-up, INFINITY: Far distance. FIXED: If
the camera has auto-focus, this mode can fix the focus. AUTO: Auto-focus
mode, EDOF: Focusing is done digitally and continuously. For example:
Camera1.setFocusMode = "MACRO"
FrameProtect As String
getPictureOnCurrentFrame (Width As Int, Height As Int, Quality As Int)
Gets the picture on the current frame.
Width: the width of the picture.
Height: the height of the picture
Quality: the quality of the jpeg image.
Calls _PreviewTaken when finished.
getSupportedPictureSizeHeight (index As IntAs Int
Returns the supported picture height of the given index.
You can call getSupportedPictureSize to get the size of the list.
This way you can extract the index of the supported sizes
Return type: @return:
getSupportedPictureSizeWidth (index As IntAs Int
Returns the supported picture width of the given index.
You can call getSupportedPictureSize to get the size of the list.
This way you can extract the index of the supported sizes
Return type: @return:
GPSAltitude As Double  [write only]
Sets GPS altitude.
GPSLatitude As Double  [write only]
Sets GPS latitude coordinate. This will be stored in JPEG EXIF header.
GPSLongitude As Double  [write only]
Sets GPS longitude coordinate. This will be stored in JPEG EXIF header.
GPSTimeStamp As Long  [write only]
Sets GPS timestamp. This will be stored in JPEG EXIF header.

timestamp GPS timestamp (UTC in seconds since January 1, 1970).
HorizontalViewAngle As Float  [read only]
Gets the horizontal angle of view in degrees.
Returns horizontal angle of view. This method will always return a valid value.
Initialize (Panel As android.view.ViewGroup, EventName As String)
Initializes the camera.
Panel - The preview images will be displayed on the panel.
EventName - Events subs prefix.
The Ready event will be raised when the camera has finished opening.
isDecoding As Boolean  [read only]
returns true if frame is decoding.
isLEDEnabled As Boolean
Checks if the Motorola droid LED is enabled.
Return type: @return:
ISOValue As Int  [write only]
Sets the iso value. Note that this MIGHT not work (properly).
isZoomSupported As Boolean
Returns a true or false statement when zooming is supported or not.
Return type: @return:
LEDenable (tf As Boolean)
Enable true or false the Motorola Droid LED.
tf:
MaxExposureCompensation As Int  [read only]
Returns the maximum exposure compensation.
MaxZoom As Int  [read only]
Returns the maximum zooming level. 0 is no zooming supported.
MinExposureCompensation As Int  [read only]
Returns the minimum exposure compensation.
mIsFlashlightOn As Boolean
onPreviewFrame (data() As Byte, camera As android.hardware.Camera)
openFrontFacingCameraGingerbread
Since api 2.3
Return type: @return:
OriLandscape
Sets the camera orientation to landscape.
OriLandscapeAPI8
Sets the camera orientation to landscape.
API Level 8 and down
OriPortrait
Sets the camera orientation to portrait.
OriPortraitAPI8
Sets the camera orientation to portrait.
API Level 8 and down
ParmStr As String
PictureSize (width As Int, height As Int)
Sets the size of the picture in pixels.
pose (euler As IntAs Float
Returns the face's pose.
That is, the rotations around either the X, Y or Z axis
(the positions in 3-dimensional Euclidean space).
Euler:
EULER_X, EULER_Y or EULER_Z
PreviewFormat As Int  [read only]
Returns the image format for preview frames got from Camera.PreviewCallback.
PreviewFrameRate As Int
Gets or sets the current Preview frame rate.
Quality As Int  [write only]
Sets the quality of the JPEG file. The range is between 1 to 100, with
100 being the best.
rCPKey (k As StringAs String
Read Camera Parameter Key
With this you can read parameters from the camera.
k:
Return type: @return:
reconnect
Reconnects the camera.
Release
Releases the camera object and allows other processes to access the
camera.
removeGPSData
Removes the attached GPS Data.
rotateBitmap (bitmap As android.graphics.Bitmap, degrees As IntAs android.graphics.Bitmap
Rotates a bitmap with x degrees and returns a new one (rotated.)
bitmap:
degrees:
Return type: @return:
rotateBitmap2 (data() As Byte, degrees As IntAs android.graphics.Bitmap
Rotates a bitmap (from a byte array) with x degrees and returns a new one.
bitmap:
degrees:
Return type: @return:
SceneMode As String  [write only]
Sets the Scene Mode. ACTION: Take photos of fast moving objects., AUTO:
Scene mode is off. BEACH: Take pictures on the beach CANDLELIGHT: Capture
scenes lit by candles, FIREWORKS: Take pictures of fireworks. LANDSCAPE:
Take pictures on distant objects., NIGHT: Take photos at night. PARTY:
Indoor low-light shot., PORTRAIT: Take people pictures. SNOW: in the
snow., STEADYPHOTO: Avoid blurry pictures (handshake). SUNSET: Take
Sunset photos., THEATRE: Take photos in a theater. For example:
Camera1.setScene = "BEACH"
setPreviewFpsRange (min As Int, max As Int)
Sets the supported Preview FPS Range.a list of supported preview fps ranges.
This method returns a list with at least one element.
Every element is an int array of two values - minimum fps and maximum fps.
The list is sorted from small to large (first by maximum fps and then minimum fps).
setResolution (width As Int, height As Int)
Sets the dimensions for preview pictures. The sides of width and height are based on camera orientation.
That is, the preview size is the size before it is rotated by display orientation. So applications need
to consider the display orientation while setting preview size. For example, suppose the camera supports
both 480x320 and 320x480 preview sizes. The application wants a 3:2 preview ratio. If the display orientation
is set to 0 or 180, preview size should be set to 480x320. If the display orientation is set to 90 or 270,
preview size should be set to 320x480. The display orientation should also be considered while setting picture
size and thumbnail size.
setZoom (value As Int, Zoom As String, Zoom2 As String)
Sets the zooming level.
Set zoom to 2x if available. This helps encourage the user to pull back.
Some devices like the Behold have a zoom parameter
Most devices, like the Hero, appear to expose this zoom parameter.
(I think) This means 2.0x
e.g zoom(2,"2.0","20")
I got thix from the ZXing App
setZoomIn
Zooms in. (is possible not to work on some devices.)
setZoomOut
Zooms out. (is possible not to work on some devices.)
StartPreview
Starts displaying the preview images.
StopPreview
Stops displaying the preview images.
SupportedAntibanding As java.util.List  [read only]
Returns a list of all supported antibandings.
SupportedColourEffect As java.util.List  [read only]
Returns a list of all supported colour effects.
SupportedFlashMode As java.util.List  [read only]
Returns a list of all supported flash modes.
SupportedFocusMode As java.util.List  [read only]
Returns a list of all supported focus modes.
SupportedPictureFormats As java.util.List  [read only]
Returns a list of all supported Picture Formats.
SupportedPictureSize As Int  [read only]
Returns the size of the supported pictures off the device.
e.g returns 4 when 4 sizes are supported.
SupportedPreviewFpsRange As java.util.List  [read only]
Gets the supported Preview FPS Range.a list of supported preview fps ranges.
This method returns a list with at least one element.
Every element is an int array of two values - minimum fps and maximum fps.
The list is sorted from small to large (first by maximum fps and then minimum fps).
SupportedPreviewFrameRates As java.util.List  [read only]
Gets the supported Preview frame rate.
SupportedSceneMode As java.util.List  [read only]
Returns a list of all supported scene modes.
SupportedWhiteBalance As java.util.List  [read only]
Returns a list of all supported white balances.
TakePicture
Takes a picture. When the picture is ready, the PictureTaken event will
be raised. You should not call TakePicture while another picture is
currently taken. The preview images are stopped after calling this
method. You can call StartPreview to restart the preview images.
TakePicture2 (degrees As Float)
Takes a picture and rotates it. When the picture is ready, the PictureTaken2 event will
be raised. You should not call TakePicture while another picture is
currently taken. The preview images are stopped after calling this
method. You can call StartPreview to restart the preview images.

degrees: the amount of degrees the bitmap should be turned.
asBitmap: whether you want to retrieve the bitmap (true) or bytearray (false).
toggleFlashLight
Attempts to set camera flash torch/flashlight mode on/off
HACK around
isOn: true = on, false = off
Return type: @return:boolean whether or not we were able to set it
If you have a Samsung, and you toggle the flash off, you will have to reinitialize your camera.
uploadFrame (PHPProtect As String, Frame() As Byte, WebClient As String)
Encodes a bytearray image with Base64 and uploads it to a web client that supports PHP.
WebClient: a string referring to your base.php file (http://IP:Port/base.php)
e.g. "http://192.168.1.100/android/base.php, "http://www.mywebsite.com/index.php

PHPProtect is a small password protection to check on your websserver
Webserver: "image" = frame
Webserver: "PHPProtect" = FrameProtect
VerticalViewAngle As Float  [read only]
Gets the vertical angle of view in degrees.
Returns vertical angle of view. This method will always return a valid value.
WhiteBalance As String  [write only]
Sets the white balance. The following effects are: AUTO, CLOUDY_DAYLIGHT,
DAYLIGHT, FLUORESCENT, INCANDESCENT, SHADE, TWILIGHT, WARM_FLUORESCENT.
For example: Camera1.setEffect = "WARM_FLUORESCENT"
wiCPKey (k As String, v As Integer)
Write Integer Camera Parameter Key
With this you can write integer parameters to the camera.
k:
Return type: @return:
wsCPKey (k As String, v As String)
Write String Camera Parameter Key
With this you can write string parameters to the camera.
k:
Return type: @return:
Top