Android使我的应用程序文件仅在应用程序内部播放 [英] Android make my app files only play from inside the app

查看:143
本文介绍了Android使我的应用程序文件仅在应用程序内部播放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个应用程序,客户端可以在其中记录一些对话并存储在外部存储中。如果需要,客户端必须能够传输文件。因此,我将记录的文件存储在外部存储中。但是客户不希望文件从应用程序外部(从SD卡)或音乐播放器播放。可能吗?请告诉我。

I created an app in which the client can record few conversations and store in external storage. The client must be able to transfer the files if needed. So I am storing the recorded files in external storage. But client don't want the files to be played from outside the app, (from sd card) or from music player. Is it possible? Please let me know. Is using internal storage is the only way to do it?

推荐答案

这不是编程问题,但是...

well this is not a programming question, but ...

您在这里有2个选择,请根据您的要求进行决定

you have 2 options here, decide based on your requirements

1)如果您希望记录根本不出现在任何播放器
或多媒体应用程序中,则有两种选择:
A-让存储文件夹名称以开头。 (例如,.myrecords)

B-在名为.nomedia

1) if you want the records to be simply not appear in any player or multi media app, you have 2 options: A- let the storing folder name starts with . (ex, .myrecords) OR B- add a file inside the folder named .nomedia

不会保护记录,就好像有人装载了sd卡记录一样,可以在任何设备/个人电脑上复制并播放

but this will not PROTECT the records, as if someone mounts the sd-card records can be copied and played on any device/pc

2)您想要保护文件安全,则需要按照Joey Chong
的建议对其进行加密,因此,一旦录制完成,文件将被加密,并在用户进入播放屏幕后存储在外部存储设备
中,并选择要播放的文件,应用会先将其解密为新文件(临时文件),然后再播放,并在用户离开播放屏幕后删除该临时文件。

2) if you want to secure the files, you will need to encrypt them as advised by Joey Chong so once the recording completed, the file got encrypted, and stored on external storage once the user enters the playback screen, and picks a file to play, the app will decrypt it first, in a new (temp file) then play it, and delete the temp file once user leaves the playback screen.

-,用于将记录导出到PC或其他设备,
您可以添加一个功能(可能是按钮)来导出选定的记录,该功能只需将选定的文件解密到特定的文件夹中,说(/ appfolder / exported /),则用户可以复制它们或执行任何操作...
,用户必须在导出折叠时删除文件一旦出口目的终止。 (也许也是一个按钮)清除导出

-- for exporting the records to PC or other devices, you can add a function (button maybe) to export selected records, that simply decrypts the selected files into a specific folder, say (/appfolder/exported/) then user can copy them or do whatever... and user have to DELETE the files at export folder once purpose of export is ended. (maybe a button too) Clear Exported

在内部存储不是一个好主意,尤其是音频/视频,因为它可能是大文件,并且

storing in internal is not good idea, specially audio/video as it might be large files, and some devices does not have really large internal storage.

这可能是更多评论,但它的时间太长了

this could be more a comment but its way too long

这篇关于Android使我的应用程序文件仅在应用程序内部播放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆