Rhodes Device Capabilities

To create a compelling mobile application, you will want to take advantage of capabilities that are available on a phone, differentiating the experience from a web or desktop application. Most applications want to interface with native phone functionality such as the GPS, the camera, and the contacts. Access to these features is implemented quite differently on different smartphone platforms, but Rhodes lets you write simple, clean code that will work on all the supported platforms.

By writing your application in Rhodes your application gains access to the same native APIs that applications written directly in the native toolkits have access to. Moreover, by coding to the Rhodes API, you do not have to worry about rewriting your application on each platform where these APIs are implemented in completely different ways. Rhodes abstracts away and often simplifies accessing these capabilities so you can focus on your application and business logic instead. See Table 6-5 for the level of support for specific device capabilities across the platforms that are supportd by Rhodes.

Table 6-5. Rhodes device capabilities matrix2

Capability

iPhone Windows Mobile

BlackBerry

Symbian

Android

GeoLocation

Yes

Yes

Yes

Yes

Yes

PIM Contacts

Yes

Yes

Yes

Yes

Yes

Camera

Yes

Yes

Yes

Yes

Yes

Date/Time Picker

Yes

2.0

Yes

2.1

Yes

Native Menu/Tab Bar

Yes

2.0

Yes

2.1

1.5

Audio / Video Capture

2.0

2.0

2.0

2.1

2.0

Bluetooth

2.0

2.0

2.0

2.1

2.0

Push / SMS

Yes

2.0

Yes

2.1

2.0

Landscape Orientation

2.0

2.0

2.0

2.1

2.0

Native Maps

Yes

2.0

Yes

2.1

1.5

In Rhodes, device capabilities are invoked from within the Ruby environment. Some device capabilities, such as geolocation, can also be invoked directly from JavaScript if the browser on the platform supports it. This is independent of Rhodes implementation of the same capability but gives you another option. Note, for example, if you code to the browsers JavaScript API for geolocation, that code may not be portable to other devices where the browser does not include this capability.

In this section we will explore three different device capabilities: contacts, camera, and geolocation. For the rest, the Rhodes system API samples project3 has small examples that show how each API is used.

2 http ://wiki.rhomobile.com/index.php/Rhodes#Device_Capabilities_.2F_Native_UI_Elements

3 http://github.com/rhomobile/rhodes-system-api-samples . API documentation is available on the Rhodes wiki: http://wiki.rhomobile.com/index.php/Rhodes

App Gangster

App Gangster

Get All The Support And Guidance You Need To Be A Success At Dominating Apps. This Book Is One Of The Most Valuable Resources In The World When It Comes To Becoming The Godfather Of Smart Phone Apps.

Get My Free Ebook


Post a comment