我的SONY相机上有API 1.1。我切换到“内容传输”模式,然后我调用deleteContent,并尝试了很多次(在一个while循环中),但每次我得到一个“Not Available Now”响应。我使用CameraRemoteSampleApp对其进行了测试,并在SimpleRemoteApi.java中创建了此函数。我检查了我生成的JSON,但这似乎没问题:
public JSONObject deleteContent(JSONObject params) throws IOException {
String service = "avContent";
try {
//JSONObject params = new JSONObject().put("scheme", scheme);
JSONObject requestJson =
new JSONObject().put("method", "deleteContent") //
.put("params", new JSONArray().put(params)) //
.put("version", "1.1").put("id", id());
String url = findActionListUrl(service) + "/" + service;
log("Request: " + requestJson.toString());
String responseJson = SimpleHttpClient.httpPost(url, requestJson.toString());
log("Response: " + responseJson);
return new JSONObject(responseJson);
} catch (JSONException e) {
throw new IOException(e);
}
}