Macadamian/titanium_mobile — pull request #87 by alexandergalstyan (2012-06-28 14:15:40+00:00)
Title: TIMOB-9546: BlackBerry: Implement Platform elements needed for KitchenSink

Reviewers: DavidC, JP

ChangeLog:
- Update Platform.yml apidoc.
- Added NativePlatformInterface to support native platform stuff.
- Implemented batteryLevel, batteryState, osname, name, runtime properties.
- Added constants describing battery states.
- Added TiPlatform class storing all Platform properties.
- Added methods to TiPropertyMapObject for adding properties with getter callback.

Test Cases:
- Run tibbtest.
- Make sure implemented properties: batteryLevel, batteryState, osname, name, runtime (as well as their getters) works succesfully.
- Use the following app.js snippet:

////////////////////////////////////////
var win1 = Titanium.UI.createWindow({
backgroundColor:'#F00'
});

var label1 = Ti.UI.createLabel({
font: {fontSize:12},
color:'green',
top: 200
});

label1.text = Ti.Platform.batteryLevel.toString();
// label1.text = Ti.Platform.getOsname();
// label1.text = Ti.Platform.runtime;
// label1.text = Ti.Platform.getName();
// label1.text = Ti.Platform.getBatteryState().toString();

win1.add(label1);

// open window
win1.open();
////////////////////////////////////////