This example illustrates the basic code requirements for connecting to Unwired Server, updating mobile business object (MBO) data, and synchronizing the device application from a Client Object API based device application.
<PkgName>DB.loginToSync("supAdmin", "s3pAdmin");
<PkgName>DB.synchronize(“default”);
ObjectList customers = Customer.findAll(); int size = customers.count(); for (int i = 0; i < size; i++) { Customer cust = (Customer)customers.elementAt(i); //Feed the MBO data to your view… }
Customer cust = Customer.findByPrimaryKey(100); cust.setAddress(“1 Sybase Dr.”); cust.setPhone(“9252360000”); cust.save();//or cust.update();
Customer.submitPendingOperations(); <PkgName>DB.synchronize(“default”);