您好我正在尝试通过
为salesforce开发Android原生应用程序 Forcedroid Mobile SDK
我的文件或目录如上图所示
但我的Mainctivity课程中出现两个错误
private void sendRequest(String soql) throws UnsupportedEncodingException {
RestRequest restRequest = RestRequest.getRequestForQuery(getString(R.string.api_version), soql);
client.sendAsync(restRequest, new AsyncRequestCallback() {
@Override
public void onSuccess(RestRequest request, RestResponse result) {
try {
listAdapter.clear();
JSONArray records = result.asJSONObject().getJSONArray("records");
for (int i = 0; i < records.length(); i++) {
listAdapter.add(records.getJSONObject(i).getString("Name"));
}
} catch (Exception e) {
onError(e);
}
}
@Override
public void onError(Exception exception) {
Toast.makeText(MainActivity.this,
MainActivity.this.getString(SalesforceSDKManager.getInstance().getSalesforceR().stringGenericError(), exception.toString()),
Toast.LENGTH_LONG).show();
}
});
}
第一个错误是
api_version cannot be resolved or is not a field
,第二个错误是
The type com.android.volley.Request cannot be resolved. It is indirectly referenced from required .class files
我对Android知之甚少,但SalesForce SDK对我来说是新的。甚至单次我都无法运行我创建的应用程序“sfaDroidpp”。请带我离开这个问题。在此先感谢所有人。