# Titanium.Media.Android

Android-specific media-related functionality.

Availability
1.7.0

# Methods

# scanMediaFiles

Availability
1.7.0
scanMediaFiles(paths, mimeTypes, callback) void

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

Name Type Description
paths Array<String>

Array of paths to the files you want to scan.

mimeTypes Array<String>

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

callback Callback<MediaScannerResponse>

Function to call when each file is done being scanned.

Returns

Type
void

# setSystemWallpaper

Availability
1.7.0
setSystemWallpaper(image, scale) void

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 read. You can also use the openPhotoGallery or showCamera methods to allow users to select an existing photo or take a new one.

Parameters

Name Type Description
image Titanium.Blob

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

scale Boolean

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

Returns

Type
void