2016년 11월 28일 월요일

Taifun File Extension


I've been working with Taifuns file extension and got most everything working. 
I have a app that records audio and video. You are able to export both and save both in a tinydb for recall. 

in order to export video I used the get content uri from the extenstion.  That will display the correct path to the video.

I would like to delete the video when the tinydb entry is deleted.  Im using the delete filename extension, and using the label Path.text  (this block holds the content uri path from the load and playback)
but it doesnt delete the file.

Any ideas?

-- 
use the complete filename of the video to delete it (and not the content uri)

It would really help if you provided a screenshot of your relevant blocks including Do it results, so we can see what you are trying to do, and where the problem may be.

-- 
 11-28-2016 6-02-58 PM.png

Here are the blocks showing whats going on..  As you can see the content uri will 'find' the clips location on the device and display the whole path plus file name.

In the list files block you see that it lists all the files in that directory, which is the same as the content uri displays.

Is there a work around for putting the filename in the block?   I need to be able to delete the file associated with that entry/uri where ever it is on the device.

I've tried on a few different devices and the path is a little different depending on the phone, but it lists the correct path every time.  I just need to be able to delete the file when I delete the associated record in the tiny db.  (the delete code is in the notify block and is very lengthy, but its a standard delete the entry and clear tag)  Once it works Im putting the delete blocks into the notify delete to make it delete the file and entry at once.  THe above code is just testing.

-- 

your version 2 looks fine
you are trying to delete a file from an external sdcard


unfortunately I do not have such device, so I can't test this
I now set the feature "deleting a file from the external sdcard" to experimental
there might be the similar restrictions as for copying files, see the notes below the copy method here https://puravidaapps.com/file.php


-- 
It may look ok, but it doesnt work.  Ive tried it on a device with a sd card and one without.

I can show the path and filename with the uri in a label and use that label to display the correct path, but it doesnt delete the file, no error, no message....

I put the the code to a file on the device and it deleted no problem. 


Using ES File explorer, I tried to rename a file on the SD (to make it easier to find) and it threw a message that my device did not allow ES to to make edits to the SD card unless the device is rooted. HOWEVER, I was able to rename that same file using the file manager that came on the device.  

Does your extension need permissions to delete from the SD?

-- 
I found this post http://android.stackexchange.com/a/96604 

but unfortunately I will not be able to follow that recommendation, because (as already said) I do not have a device witch has an external sdcard, so I'm not able to implement this...

-- 
I think there must be a bug when it comes to the external SD card.  Ive tried every way under the sun to delete a file. starting with File:///mnt/extSdCard/DCIM/Camera/filename.mp4 and going down to filename.mp4.

I can delete just fine from the device.  I think it may be something in the OS.  ES File Explorer and another file manager is 'not allowed' to make edits to the sd, but the preloaded file manager can delete, rename anything on the SD.

Does anyone know a work around?  Ive tried activity starters, file, taifuns file extension, everything.

Just reading through posts I know there are a bunch of people who have the same issue.

-- 
read again the links in my previous answer
use the internal sdcard instead

Taifun


-- 

댓글 없음:

댓글 쓰기