1

I have API 1.1 on my SONY camera. I switched to "Contents Transfer" mode, then I call deleteContent, and tried it many times (in a while-loop), but every time I get a "Not Available Now" response. I tested it with the CameraRemoteSampleApp and created this function in SimpleRemoteApi.java. I checked my generated JSON but this seems all right:

    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);
    }
}
  • I found out the file was deleted, but I never got a "result" object. The documentation on page 214 says "Elements of "result": None", but I only get the error-element after I tried it again and the file was already deleted. Seems as a bug in the Camera API? – user8417839 Sep 22 '17 at 16:47
  • Can you post an example of your params content? – pg316 Oct 05 '17 at 16:31
  • Here it's a demo-string (I used params toString(). Sometimes it has two files in that array for deletion (e.g. ["video:content............" , "video:content............."]), but my example here has only 1 file in it. {"uri":["video:content?contentId=index%3A%2F%2F1000%2F00000100-default%2F0000004C-00000A2B_76_256_1000","video:content?contentId=index%3A%2F%2F1000%2F00000100-default%2F0000004B-00000A21_75_256_1000"]} Sorry, I can't format it properly here in this edit-window: Files will be deleted properly, I tested it. – user8417839 Oct 09 '17 at 13:14
  • No problem about the formatting. Your parameter content does look correct though. I have had another user have success by simply updating the playmemories app on your android device. This honestly should not make a different, but can you try updating your app to see if anything changes? https://play.google.com/store/apps/details?id=com.sony.playmemories.mobile – pg316 Oct 10 '17 at 19:03

0 Answers0