Skip to content
Titanium SDK
Version13.0.1

You are reading 13.0.1. See this page in 13.4.1.

Titanium.Media.Android

moduleAndroidsince 1.7.0

Extends Titanium.ModuleTitanium.Proxy

Android-specific media-related functionality.

Properties 3

apiName

Stringsince Android 3.2.0, iPhone 3.2.0, iPad 3.2.0, macOS 9.2.0read-only

Inherited from Titanium.Proxy

The name of the API that this proxy corresponds to.

bubbleParent

Booleansince Android 3.0.0, iPhone 3.0.0, iPad 3.0.0, macOS 9.2.0

Inherited from Titanium.Proxy

Indicates if the proxy will bubble an event to its parent.

Default: true

Methods 6

Inherited from Titanium.Proxy

Adds the specified callback as an event listener for the named event.

Parameters
ParametersTypeDescription
nameString

Name of the event.

callbackCallback<Titanium.Event>

Callback function to invoke when the event is fired.

4 fields
bubbles Boolean

True if the event will try to bubble up if possible.

cancelBubble Boolean

Set to true to stop the event from bubbling.

source Object

Source object that fired the event.

type String

Name of the event fired.

Inherited from Titanium.Proxy

Fires a synthesized event to any registered listeners.

Parameters
ParametersTypeDescription
nameString

Name of the event.

event?Dictionary

A dictionary of keys and values to add to the Titanium.Event object sent to the listeners.

Inherited from Titanium.Proxy

Removes the specified callback as an event listener for the named event.

Parameters
ParametersTypeDescription
nameString

Name of the event.

callbackCallback<Titanium.Event>

Callback function to remove. Must be the same function passed to addEventListener.

4 fields
bubbles Boolean

True if the event will try to bubble up if possible.

cancelBubble Boolean

Set to true to stop the event from bubbling.

source Object

Source object that fired the event.

type String

Name of the event fired.

Scans newly created or downloaded media files to make them available to other Android media providers, such as the Gallery.

Android scans media files for inclusion in the Gallery and other media providers. Use this method to force an immediate scan of particular files, such as newly-created or downloaded resources.

See MediaScannerConnection in the Android API Reference.

Parameters
ParametersTypeDescription
pathsArray<String>

Array of paths to the files you want to scan.

mimeTypesArray<String>

Array of MIME types for the files in the paths parameter. If null, MIME type will be inferred from the file names.

callbackCallback<MediaScannerResponse>

Function to call when each file is done being scanned.

2 fields
path String

Path to the media file that was scanned.

uri String

URI to the file if it was scanned and added to the media library, or null if the file was not added.

Set the system homescreen wallpaper.

The image to use as the wallpaper must be passed as a Titanium.Blob. You can create a Blob from an image file by calling File.read. You can also use the Titanium.Media.openPhotoGallery or Titanium.Media.showCamera methods to allow users to select an existing photo or take a new one.

Parameters
ParametersTypeDescription
imageTitanium.Blob

Image to use as the wallpaper, as a Blob object.

scaleBoolean

If true, the image is scaled to fit the width of the system wallpaper. If false, the image is not scaled.