简体   繁体   中英

Store Video on sqlite database or SdCard - Android

In my app i have captured video for each question. After that i've uploaded to the server.

I've used database in my app.

My question is, where can i keep the videos ?

user can logout and again log in. that time we keep the captured videos.

Can i store the video in database as blob or can i use store video on sdcard.?

if i store the videos on sd card, some time user can remove sd card or delete the videos.

if i plan to store the videos on sqlite, i'm afraid for memory. is it enough for memory?

There's a limit of 1MB on single items or columns in a SQLite database on Android. Most of your videos are going to be much larger then that.

Save the data as a file then save the file name in the database.

Don't store blobs of 500KB in your database. Store path in your database If you use MODE_PRIVATE, they will not be accessible by other processes.

for more about MODE_PRIVATE, read below thead: http://developer.android.com/reference/android/content/Context.html#openFileOutput%28java.lang.String,%20int%29

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM