Skip to Content
0
Former Member
Oct 17, 2013 at 07:41 AM

Problem with startup synchronization

19 Views

Hello Friends,

In my sample program getting the customer list, I am synchronizing the data base at the application startup. below is the code.

try {

Log.d(TAG, "Synchronizing..");

// Set synchronization profile

ConnectionProfile cp = SampleOneDB.getSynchronizationProfile();

cp.setServerName(SERVER);

cp.setPortNumber(SYNC_PORT);

cp.setNetworkProtocol(PROTOCOL);

cp.setAsyncReplay(true);

cp.setDomainName(DOMAIN);

cp.save();

} catch (Exception e) {

e.printStackTrace();

Log.d(TAG, e.getMessage());

}

try {

SampleOneDB.subscribe();

SynchronizationGroup sg = SampleOneDB

.getSynchronizationGroup("default");

sg.setEnableSIS(true);

sg.save();

SampleOneDB.synchronize();

} catch (Exception e) {

e.printStackTrace();

Log.d(TAG, e.getMessage());

}

after this code execution i m getting my initial screen with a button. if i click on the button i should get the customers list. below is the code.

GenericList<customer> customerIds = Customer.findAll();

here Customer is my MBO. after execution of this statement i am getting the size of list is 0. but i have the customers in my database. Can some body help me in this.

thanks,