How do I know that this file was created from my application?

I am making an audio mixer application on Android so that the user can create a mix, export the mix to an mp3 file and upload the mix to the server for sharing.

Now I save all the mixes in the folder that I create on the phone’s SD card. I filter files using the mp3 extension to display the list in my application, but it can display any files that have the mp3 extension, even other mp3 files that I copy to this folder.

If I cannot understand this problem, the user will upload any mp3 files from this folder to the server.

Is there a way I can mark a file, is it created from my application?

Ps. I am open to any suggestions here.

+4
source share
2 answers

Is the problem that users download mp3s that are not mixes created by your application?

You can accomplish this (prevent intentional user intervention) by storing them in the internal storage, and not on the SD card.

If they need to be stored in external storage, on Android 4.4+ a private external storage is available. See http://developer.android.com/guide/topics/data/data-storage.html#filesExternal and scroll down to Save files closed to the application .

There you can’t do anything to prevent someone from deciding to upload files that you don’t need, but it doesn’t seem like it's your problem.

+1
source

, .

- - , . /.

, - .

- . , , , , - . .

0

Source: https://habr.com/ru/post/1620213/


All Articles