This is the code I use in my mobile app. The user click on a button and the following code is executed to synch data to the server from your map cache.
MobileCacheSyncAgent mobileSync = new MobileCacheSyncAgent(mobileCache1, mobileServiceConnection1);
MobileCacheSyncResults mobileResults = new MobileCacheSyncResults();
mobileServiceConnection1.CreateCache(mobileCache1.StoragePath);
mobileSync.MapDocumentConnection = mobileServiceConnection1;
// To sysnch individual layers
FeatureLayerSyncAgent agent0 = new FeatureLayerSyncAgent(mobileCache1.FeatureLayers["LayerName1"], mobileServiceConnection1);
agent0.Synchronize();
FeatureLayerSyncAgent agent1 = new FeatureLayerSyncAgent(mobileCache1.FeatureLayers["LayerName2"], mobileServiceConnection1);
agent1.Synchronize();
// to synch all layers
mobileSync.Synchronize();