@Override public JSONArray startFetch(SyncManager syncManager, long maxTimeStamp) throws IOException, JSONException { String queryToRun = maxTimeStamp > 0 ? SoqlSyncDownTarget.addFilterForReSync(getQuery(), maxTimeStamp) : getQuery(); syncManager .getRestClient() .sendSync( RestRequest.getRequestForResources( syncManager.apiVersion)); // cheap call to refresh session RestRequest request = buildQueryRequest(syncManager.getRestClient().getAuthToken(), queryToRun); RestResponse response = syncManager.sendSyncWithSmartSyncUserAgent(request); JSONArray records = parseSoapResponse(response); return records; }
/** * Called when "get resources" button is clicked. * * @param v */ public void onGetResourcesClick(View v) { sendRequest(RestRequest.getRequestForResources(apiVersion)); }