I have a tablet where I need to execute a service from a binary file which will continually receive data from a chip and store the various data files in the "/data/data/com.example.binary/received/" folder. I also have a FileObserver set up on that folder to perform an action on the files that are created and once the Close event is given by the FileObserver I an trying to delete the file. This is what I have an issue with. I can delete the files if it is in the "/data/data/com.example.binary/" folder but if its in the "/data/data/com.example.binary/received/" folder I cant delete it. Seems to be some android permission issue. Is there any way around this?.
So far I have tried and failed by
1) trying to execute the "rm /data/data/com.example.binary/received/file1.xy"
2) trying file.delete()
FYI - I have the Read and Write Permissions. And all file handles to the file are closed, that's when the file's Close event is fired by the FileObserver.
I can delete the files from ADB using the "rm file1.xy"
And the binary file is from our client and i cannot change the location where it creates the output files.xy . . it will always be in the received folder. So any suggestions?
PS: /data/data folder is the location where all the installed apps get stored in my tablet.