Rithesh M
Rithesh M

Reputation: 1287

Keeping video file in asset folder?

can we keep a video in the assets folder, i am developing an app where i taught to guide the users by showing video of how the app works instead of snap shots and texts????

Is it the good way of keeping video or we need keep the texts and snap shorts? can someone help me because i am new to android.

Thanks.

Upvotes: 2

Views: 494

Answers (3)

Shankar Agarwal
Shankar Agarwal

Reputation: 34765

You can place your video file in raw folder instead of assets.

And if you are playing these file using videoview or media player instance you need Uri of the file to play it. Below is the Uri to play video file

"android.resource://com.com.com/raw/filename"

//replace com.com.com with your package name and file with your file name but dont include extension

Upvotes: 1

Alexander
Alexander

Reputation: 48272

I think you can keep the video your_video.avi in raw folder so you can play it with VideoPlayer passing R.raw.your_video to it;

It is better than storing videos in assets because in assets all the assets files are internally stored as one big file and this can lead to complications when playing multimedia files.

Upvotes: 2

Harish N
Harish N

Reputation: 43

any file can be kept in assets folder and accessed using

activity.getAssets().open("");

Upvotes: 1

Related Questions