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

iPhone

List of types:

ActivityViewController
Clipboard
DocumentInteraction
MailComposer
MessageComposer
Motion
Phone
Settings
TTS

ActivityViewController

ActivityViewController is a controller that allows the user to share an item from the current app using a third party app (or built-in feature).

Events:

Complete (Success As Boolean, ActivityType As String)

Members:


  Initialize (EventName As String, Items As List)

  IsInitialized As Boolean

  Show (Page As Page, FromView As Object)

  Tag As Object

Members description:

Initialize (EventName As String, Items As List)
Initializes the controller and sets the items that will be shared.
EventName - Sets the sub that will handle the complete event.
Items - One or more items that will be shared.
IsInitialized As Boolean
Tests whether this object was initialized.
Show (Page As Page, FromView As Object)
Shows the share dialog.
Page - The dialog parent.
FromView - Relevant for iPads only. The array of the popup dialog will point to the specified view or BarButton.
Tag As Object
Gets or sets the Tag object. This is a placeholder for any object you like to tie to this object.

Clipboard


Events:

None

Members:


  ImageItem As Bitmap

  StringItem As String

Members description:

ImageItem As Bitmap
Gets or sets the last item in the clipboard. Returns an uninitialized Bitmap if no image item is available.
StringItem As String
Gets or sets the last item in the clipboard. Returns an empty string if no string item is available.

DocumentInteraction


Events:

Closed
SendingFile

Members:


  Initialize (EventName As String, Dir As String, FileName As String)

  IsInitialized As Boolean

  OpenFile (FromView As Object) As Boolean

  PreviewFile (ParentPage As Page) As Boolean

  Tag As Object

  UTI As String

Members description:

Initialize (EventName As String, Dir As String, FileName As String)
Initializes the controller and sets the file that should be opened.
IsInitialized As Boolean
Tests whether this object was initialized.
OpenFile (FromView As Object) As Boolean
Shows the dialog. FromView should be a View or BarButton. The dialog will be anchored to this view (on iPad).
Returns False if there is no app that can open the file.
PreviewFile (ParentPage As Page) As Boolean
Opens a file preview. The preview will also include options such as printing the document.
Returns False if the file type is not supported.
The following types of documents are supported: iWord, Microsoft Office, RTF, PDF, images, text files and CSV files.
Tag As Object
Gets or sets the Tag object. This is a placeholder for any object you like to tie to this object.
UTI As String
Gets or sets the file type.

MailComposer


Events:

Complete (Result As Int)

Members:


  AddAttachment (Dir As String, FileName As String, MimeType As String)

  CanSendMail As Boolean [read only]

  Initialize (EventName As String)

  IsInitialized As Boolean

  RESULT_CANCELLED As Int [read only]

  RESULT_FAILED As Int [read only]

  RESULT_SAVED As Int [read only]

  RESULT_SENT As Int [read only]

  SetBccRecipients (Recipients As List)

  SetBody (Body As String, Html As Boolean)

  SetCcRecipients (Recipients As List)

  SetSubject (Subject As String)

  SetToRecipients (Recipients As List)

  Show (Parent As Page)

  Tag As Object

Members description:

AddAttachment (Dir As String, FileName As String, MimeType As String)
Adds an attachment to the mail.
MimeType - The attachment MIME type. Use application/octet-stream for binary files.
CanSendMail As Boolean [read only]
Initialize (EventName As String)
Initializes the object.
IsInitialized As Boolean
Tests whether this object was initialized.
RESULT_CANCELLED As Int [read only]
RESULT_FAILED As Int [read only]
RESULT_SAVED As Int [read only]
RESULT_SENT As Int [read only]
SetBccRecipients (Recipients As List)
Similar to SetToRecipients. Sets the "Bcc" recipients.
SetBody (Body As String, Html As Boolean)
Sets the mail body.
Body - Message text.
Html - True for Html mail, false for plain text.
SetCcRecipients (Recipients As List)
Similar to SetToRecipients. Sets the "Cc" recipients.
SetSubject (Subject As String)
Sets the mail subject.
SetToRecipients (Recipients As List)
Sets the "To" recipients.
Example:
Mail.SetToRecipients(Array("[email protected]"))
Show (Parent As Page)
Shows the mail composer.
Tag As Object
Gets or sets the Tag object. This is a placeholder for any object you like to tie to this object.

MessageComposer


Events:

Complete (Result As Int)

Members:


  Body As String

  CanSendText As Boolean [read only]

  Initialize (EventName As String)

  IsInitialized As Boolean

  RESULT_CANCELLED As Int [read only]

  RESULT_FAILED As Int [read only]

  RESULT_SENT As Int [read only]

  SetRecipients (Recipients As List)

  Show (Parent As Page)

  Tag As Object

Members description:

Body As String
Gets or sets the message body.
CanSendText As Boolean [read only]
Returns true if the device can send text messages/
Initialize (EventName As String)
IsInitialized As Boolean
Tests whether this object was initialized.
RESULT_CANCELLED As Int [read only]
RESULT_FAILED As Int [read only]
RESULT_SENT As Int [read only]
SetRecipients (Recipients As List)
Sets the message recipients.
Example:
Message.SetRecipients(Array("123456789"))
Show (Parent As Page)
Shows the message composer.
Tag As Object
Gets or sets the Tag object. This is a placeholder for any object you like to tie to this object.

Motion


Events:

None

Members:


  GetAttitude As Double()

  GetMagnetometer As Double()

  GetUserAcceleration As Double()

  Initialize

  IsInitialized As Boolean

  Start

  StartMagnetometer

  Stop

  StopMagnetometer

  Tag As Object

Members description:

GetAttitude As Double()
Returns an array with the device attitude measured in radians (yaw, pitch and roll).
GetMagnetometer As Double()
Returns an array with the raw magnetometer data (x, y and z).
Returns an empty array if data is not available.
GetUserAcceleration As Double()
Returns the device acceleration measured in G units (9.81 m / s^2) not including the earth gravity (x, y and z).
Initialize
IsInitialized As Boolean
Tests whether this object was initialized.
Start
Starts monitoring the motion sensors.
StartMagnetometer
Starts monitoring the magnetometer sensor.
Stop
Stops monitoring the motion sensors.
StopMagnetometer
Stops monitoring the magnetometer sensor.
Tag As Object
Gets or sets the Tag object. This is a placeholder for any object you like to tie to this object.

Phone


Events:

None

Members:


  AddImageToAlbum (Image As Bitmap)

  AddVideoToAlbum (Dir As String, FileName As String) As Boolean

  KeyChainGet (Key As String) As String

  KeyChainPut (Key As String, Value As String)

  KeyChainRemove (Key As String)

  SetFlashlight (On As Boolean) As Boolean

  Vibrate

Members description:

AddImageToAlbum (Image As Bitmap)
Adds the given image to the device album.
AddVideoToAlbum (Dir As String, FileName As String) As Boolean
Adds the specified video to the device album. Returns false if the device does not support this feature.
KeyChainGet (Key As String) As String
Gets a stored value from the keychain. Returns an empty string if the key is not found.
KeyChainPut (Key As String, Value As String)
Puts a key/value pair in the keychain. These values will be available even if the app is reinstalled.
KeyChainRemove (Key As String)
Removes a key/value pair from the keychain.
SetFlashlight (On As Boolean) As Boolean
Sets the flash light state. Return true if the operation was successful.
Vibrate
Vibrates the device for a short period.

Settings

See the settings tutorial for more information.

Events:

None

Members:


  GetBoolean (Key As String) As Boolean

  GetInt (Key As String) As Int

  GetString (Key As String) As String

  Initialize

  Put (Key As String, Value As Object)

  Synchronize

Members description:

GetBoolean (Key As String) As Boolean
Gets a Boolean value.
GetInt (Key As String) As Int
Gets an Int value.
GetString (Key As String) As String
Gets a String value.
Initialize
Put (Key As String, Value As Object)
Sets the value of the existing key or adds a new key / value pair.
Synchronize
Persists the changes.

TTS

Synthesizes text to speech and plays it.

Events:

Complete (Text As String)

Members:


  GetSupportedLanguages As List

  Initialize (EventName As String)

  IsInitialized As Boolean

  MAX_SPEECH_RATE As Float [read only]

  MIN_SPEECH_RATE As Float [read only]

  Pitch As Float

  SetLanguage (LanguageCode As String) As Boolean

  Speak (Text As String, ClearQueue As Boolean)

  SpeechRate As Float

  Stop

  Tag As Object

Members description:

GetSupportedLanguages As List
Returns a list with all the supported language codes.
Initialize (EventName As String)
IsInitialized As Boolean
Tests whether this object was initialized.
MAX_SPEECH_RATE As Float [read only]
MIN_SPEECH_RATE As Float [read only]
Pitch As Float
Gets or sets the pitch value. The value should be between 0.5 to 2.
SetLanguage (LanguageCode As String) As Boolean
Sets the voice language. The language code is made of the language (two lower case letters) and the locale (two upper case
letters) separated with a dash. You can use GetSupportedLanguages to find all the supported language codes.
Returns true if the language was set successfully.
Speak (Text As String, ClearQueue As Boolean)
Speaks the given text. The Complete event will be raised after the text is spoken.
Text - Text to speak.
ClearQueue - Whether to dismiss all waiting texts.
SpeechRate As Float
Gets or sets the speech rate. The value should be between MIN_SPEECH_RATE to MAX_SPEECH_RATE.
Stop
Stops speaking and dismisses texts in the queue.
Tag As Object
Gets or sets the Tag object. This is a placeholder for any object you like to tie to this object.
Top