Download Developer Guide: BlackBerry Native Applications
Transcript
Reference
rm.setValue(myMBO, lname, “Steve”);
rm.invoke(object, save, new ObjectList());
DatabaseMetaData
The DatabaseMetaData class holds package level metadata. You can use it to retrieve
data such as synchronization groups, default database file, and MBO metadata.
DatabaseMetaData dmd = <PkgName>DB.getMetaData();
com.sybase.collections.StringList syncGroups =
dmd.getSynchronizationGroups();
for(int i=0; i<syncGroups.size(); i++)
{
String syncGroup = syncGroups.getByIndex(i);
System.out.println(syncGroup);
}
ClassMetaData
The ClassMetaData class holds metadata for the MBO, including attributes and
operations.
AttributeMetaData lname = customerMetaData.getAttribute(“lname”);
OperationMetaData save = customerMetaData.getOperation(“save”);
...
AttributeMetaData
The AttributeMetaData class holds metadata for an attribute such as attribute name,
column name, type, and maxlength.
System.out.println(lname.getName());
System.out.println(lname.getColumn());
System.out.println(lname.getMaxLength());
Replication-Based Push Synchronization Applications
BlackBerry devices support sending push requests through HTTP. Sybase Unwired Platform
supports push configuration and notification handling APIs for BlackBerry HTTP push.
HTTP Push Gateway
Blackberry has an HTTP push feature for sending messages to occasionally connected
devices. For Blackberry devices paired with BlackBerry Enterprise Server (BES), the HTTP
push gateway contains an address that points to the HTTP listener of the BES server. The
POST to the BES server has a query parameter that contains the device ID of the target devices
(for example, 2100000a for an emulator). The BES server holds the message for a
configurable amount of time, and delivers it to the device when the device becomes reachable.
The push listener runs in the background, and listens for server-initiated synchronization
notifications, for example, based on a schedule or triggered by a Data Change Notification
(DCN):
Developer Guide: BlackBerry Native Applications
65