Where should I put mp4 file during development? - android

I'm not good at English, so I'm sorry if there are any mistakes in the expression.
I want to Object detection application on Android.
Here is how the app works:
Take some videos for which you want to perform object detection
Select a video from the taken videos
Detect specify object and get that coodinates
To develop avobe app,I have some videos for vertification.
Here is my question. Which folder should I put the vertification videos?
For now, I put the videos in raw folder.
But,I am creating an app assuming that the videos were taken with a camera. If so, should it be in the same place as if it were taken by the camera? and, which folder should the videos be placed in?
I'm new to android development.
Could anyone give me some advice? Thank you.

As you are new to Android development I am going to explain in detail.
First you have the videos for verification. You should put those videos in raw folder. But what if the size of those videos is too large? That means the size of your APK will also increase which is not a good thing if you want to upload your app on google play store. In this case, you can store those videos on your own server, and when user installs your app download those videos from the server.
Now let's come to the second question: Where should I put the videos taken with the camera?
You can put these videos in any of the following paths.
context.getFilesDir();
or
context.getExternalFilesDir(null);
These paths are on which you can store the camera-shooted videos and do any processing on them. If you want to know the difference between these two paths that's another topic. You can learn about them here.

Related

iOS & Android: Is it possible to save videos directly to the app's bundle?

My understanding is that some assets within apps (like the the splash screen) can be shown right from the start / when the user opens the app for the first time because they are bundled together with the app build. Is that also the case with videos? We need some videos within the onboarding tour to be available right away, also when in offline mode.
The simple answer is yes, you can store videos this way. You put your video in a folder named 'raw' user the resources folder.
See here for some examples: Where to put the Video file in android Project
However, video are very large so you may exceed you target app size.
You also will have to update your app if you want to update the video.
Streaming the video would avoid these issues, but you do have to have connectivity.
One compromised might be to have a small simple looked video for quick start up an offline, and switch to a streamed video as soon as it is available after startup.

Can MIT App Inventor receive image?

I am still new to cloud and mit app inventor.But I would to ask some question regarding cloud and mit app inventor.
But firsty i would like to explain how project should work.
My project is about home security system. When a press button is pressed, it will capture the image of visitor and the home owner will receive picture of the visitor on android app. The android should be able to receive picture and unlock door by pressing button unlock. The camera used is VC0706 Camera connected to Arduino Mega.
My question is that can mit app inventor receive picture from cloud since all of the picture taken will be stored in cloud.
Accessing images and sounds in App Inventor 2
Applications built with App Inventor can access sound, image, and video sources from three different kinds of locations:
Application assets
The sources labeled Media shown in the designer — part of the application's assets — are packaged with the application. Anyone who installs your application will have them, as part of the application. You also specify them in the designer, which is convenient. You can also specify these in programs by their file name: just use the file name without any special prefix. For example, if you have an image asset named kitty.png, you can use it as an image: just set the Picture property of an image component to the text kitty.png. You can similarly use files names for sound (Sound or Player) or video (VideoPlayer).
Assets are the most convenient to use, but the space for them is limited to a few megabytes, because they must be packaged with the application. They are good for small images and short audio selections. Bit you would probably not use them for complete songs or videos.
The phone SD card
You can access files on your phone's SD (secure digital) card using file names that begin with /sdcard . You could play a song on your SDCard by setting the source of a Player component to
/sdcard/Music/Blondie/The Best of Blondie/Heart of Glass.mp3
and starting the Player (assuming of course, that the song file is on the SDCard). Make sure to specify the complete file name, including the "mp3".
The Android system also includes an alternative way to designe SDCard files as URLs. Here you prefix the file name with file:///sdcard and use "URL encoding" for special characters. For example, a space is "%20". So you could designate the same file by setting the player source to
file:///sdcard/Music/Blondie/The%20Best%20of%20Blondie/Heart%20of%20Glass.mp3
Note that you'll want to use a Player component for this, not Sound. A complete song like this is too large for Sound to handle.
Images and videos can be designated similarly.
App Inventor doesn't (yet) include any way to store files on the SD card. It also doesn't (yet) include a way to list the files on the SDCard. You'll have to use other applications or the Android phone file manager for that.
Using the SD Card provides a lot more space for media than trying to package things as assets. The drawback is that users won't automatically get them by installing your application.
URLs and the Web
You can access files on Web using URLs, starting with http:// , for example, setting the picture property of an image to
http://www.google.com/images/srpr/nav_logo14.png
and similarly for music and videos. Make sure you use the link that points to the actual file, not to players for the files, which is much more common on the Web, especially for music and videos.
Other content URLs
The Android system also uses URLs to access various places that media is stored on the phone. For example, the images in the photo gallery can be accessed with file names beginning content://media/external/images/media , as you can see by using the ImagePicker and examining the resulting image path.
App inventor 2 has built-in web storage TinywebDB which stores text strings only.
In your scenario, post the images to somewhere on the web, and then store the image URIs in TinyWebDB insdie App inventor.
Yes, using MIT App Inventor you can send and receive the picture not directly but indirectly. First, you have to convert that image to imagebase64 it means in text formate then decode this text to get the original image. It means you can store any images in clouddb or firebase. Here is the video about that
https://youtu.be/ySruxnxeJgM

How to make videos download and play inside unity app?

Hello so I am trying to make online videos download on the android export app from unity and then play it back in the same app. so far I have used a plugin EasyMovieTexure asset for streaming online videos but cannot find a way to download videos and play them. I have searched and found that I can download the video with Android Application.persistentDataPath but I don't know how to use it and save the video file to a location on android.
Help is much appreciated.
the easiest way will be using System.IO.File.WriteAllBytes () to save all byte data from the WWW object. But this method actually need RAM to hold the whole file for a while. It doesn't work if the file is too big. if the file size is too big, you probably need another way to do the downloading and saving

Localisation of Video

I am developing an application which contains a video on the home screen. The video will be different for different region. Because the size of a single video is 10 Mb and I have almost 10 videos for different country. So I don't want to store those locally. So my questions are :
Should google play developer console provide the way where I can store those video separately from My apk file and at time of download, corresponding region video downloaded from there and I can link that video to my application.
What will be the better way to achieve that functionality? I want to reduce loading time which require to download the video from web server.
Thanks in advance.

android secure data storage

i am developing one android application. it download videos from server and store it in mobile.
i want to store those video in secure manner.(deny the user from copying. or deny them from viewing the video directly from sdcard)
i found two ways to solve the problem.
1)Store the video's inside the application.
2)Encrypt the entire video
but facing some problem in implementing solution
i)first solution found suitable. but i am fearing that. if we store too much video inside the application .it would become bulkier.and fore the user to uninstall.
ii)but in second solution. i did not find any correct way to do so.
so please help me to solve the problem.
This is kind of suggestion :
To store the videos you must have created some folder on SDCARD, so you can hide the folder by putting the "." in front of the name while creating it. on top of this you can encrypt the video file using AES algorithm so it can not be viewed, if copied outside the android it will not be view able. but from your application you can decry-pt the file and view it.
Definitively, you must encrypt the media and that's quite simple. What is more difficult is to play the media, because MediaPlayer only accepts clear contents. A basic way would be to convert an encrypted file to a decrypted one, just for the time of the playing session. A better approach is to build a stream from the file, decrypt that stream and feed it to the player. The hard point is to have a local http server to serve the stream.

Categories

Resources