Mobile Hardware Components
Mobile Hardware Components give you access to mobile hardware features such as camera or GPS. When in the Designer, you can find them listed on the Tool Palette pane. These components can only be added to mobile pages.
Components
MAccelerometer
- Capture device three-dimensional motion relative to device orientation.
MCamera
- Access device’s default camera application.
MCompass
- Get the direction the device is pointing at.
MGeolocation
- Watch device’s GPS sensor activity.
MContacts
- Access device’s contacts database.
MPageEvents
- Manage page state events, namely when page is ready, paused or resumed.
MPageExtraEvents
- Manage device buttons events, namely clicks on back button, menu button and search button.
MDB
- Manage a database.
MDBTransaction
- Perform a transaction against an MDB object.
MFileReader
- Read a file.
MFileWriter
- Write to a file.
MFileEntry
- A file on device’s file system.
MDirectoryEntry
- A directory on device’s file system.
MDirectoryReader
- List directory content, files and folders.
MFileSystem.
- Device’s file system.
MFileTransfer
- Upload files to a server.
MCapture
- Access image, audio, and video capture capabilities of the device.
MNotification
- Use device notifications.
MConnection
- Access device’s cellular and WiFi connection information. It has a visual representation, similar to a label.
MDevice
- Get device information, software and hardware. It has a visual representation, similar to a label.
Help Resources
Sample Applications
On the PhoneGap folder inside the sample applications directory you will find a project showcasing Mobile Hardware Components:
- PhoneGapExamples.phprj. Covers many features of mobile hardware components.