How to delete a image permanently from DCIM/CAMERA Folder

How to delete a image permanently from DCIM/CAMERA Folder

BY 12 May 2015 Native Application Development

Hi all,

I had launched a file browser for selecting images by setting appcontrol settings
like

mime: images/* 

for selecting the images & i am deleting the selected image via remove(filenpath);

the image is getting deleted successfully from the filepath

but when i launch the image viewer appcontrol the same image is shown for selection , when i try to select the same image i am getting Toast like “unable to load the photo” 

how to delete the image such that it should not be listed when i launch image viewer for selecting the images.

the code is as follows

 

static void launch_file_cb(void *data, Evas_Object *obj, void *event_info) {
    app_control_h app_control;

    app_control_create(&app_control);
    app_control_set_operation(app_control, APP_CONTROL_OPERATION_PICK);

    app_control_set_mime(app_control, “image/*”);

    if (app_control_send_launch_request(app_control, app_control_result, NULL) //sending launch request here
            == APP_CONTROL_ERROR_NONE) {
        dlog_print(DLOG_INFO, LOG_TAG, “Succeeded to launch a viewer app.”);

    } else {
        dlog_print(DLOG_ERROR, LOG_TAG, “Failed to launch a viewer app.”);
    }

    app_control_destroy(app_control);
}

static void app_control_result(app_control_h request, app_control_h reply,
        app_control_result_e result, void *user_data) {
    char *value;
    int ret;
    if (result == APP_CONTROL_RESULT_SUCCEEDED) {
        ret = app_control_get_extra_data(reply, “path”, &value);
        if (ret == APP_CONTROL_ERROR_NONE) {
            dlog_print(DLOG_INFO, LOG_TAG,
                    “[app_control_result_cb] Succeeded: value(%s)”, value);
           

remove(value);// deleting the file here

        } else {
            dlog_print(DLOG_ERROR, LOG_TAG,
                    “[app_control_result_cb] Failed, Error code: %d”, ret);
        }
    } else {
        dlog_print(DLOG_ERROR, LOG_TAG,
                “[app_control_result_cb] APP_CONTROL_RESULT_FAILED. Error code: %d”,
                result);
    }
}
Regards
Harish K 

 

 

 

 

 

 

 

 

 

 

 

 

Written by