Code example for PeriodicSync

0
        final int period1 = 200;
        final int period2 = 1000;
 
        PeriodicSync sync1 = new PeriodicSync(account1, authority, extras1, period1);
        PeriodicSync sync2 = new PeriodicSync(account1, authority, extras2, period1);
        PeriodicSync sync3 = new PeriodicSync(account1, authority, extras2, period2);
        PeriodicSync sync4 = new PeriodicSync(account2, authority, extras2, period2);
 
        MockContentResolver mockResolver = new MockContentResolver();
 
        SyncStorageEngine engine = SyncStorageEngine.newTestInstance(
                new TestContext(mockResolver, getContext()));
 
        removePeriodicSyncs(engine, account1, 0, authority);
        removePeriodicSyncs(engine, account2, 0, authority);
        removePeriodicSyncs(engine, account1, 1, authority);
 
        // this should add two distinct periodic syncs for account1 and one for account2 
        engine.addPeriodicSync(sync1.account, 0, sync1.authority, sync1.extras, sync1.period);
        engine.addPeriodicSync(sync2.account, 0, sync2.authority, sync2.extras, sync2.period);
Contextual code suggestions in your IDE  Get Codota for Java