Can end user access /storage/emulated/ and edit the data? - android

I want to move some media files from "/vendor/etc/" to "/storage/emulated/"
These media files are some local files used for local playback demo purposes. I donot want the end user to manipulate this data.
Can "/storage/emulated" be manipulated?
If yes, where are local media filed should be transferred to from "/vendor/etc" ?

Related

Access media from offline storage after sending it to server like whatsapp

What I Want
I want the media files to be sent to server , once it is sent then read the media file from the local storage (There can be any number of images like whatsapp)
My problems
How do I recognise the images that has been delete from offline storage.
In Short I wanted to develop and app that works even in offline-mode like whatsapp (for mediafiles , chats text)
If any tutorials please help me to get started
Store media absolute path on local in sqlite and with status isOnline true or false.
Once media is sent to server update its status isOnline to true.
Now show media by path in db when isOnline is false.
If file is deleted, you will get FileNotFoundException and handle it by fetching from server again or place holder image like whatsapp.

Store mp3 files in a database?

I am currently creating a mobile android app in Android Studio for my church.
My app is basically a Bible which verses are linked to mp3 audio explanations from my preacher; however, I don't know whether I should save these mp3 files stored locally in the phone of the user or store them in a database.
I have been reading some things about databases and found out that SQLite is good, but stores the database locally, which is not what I want.
How can I solve this problem?
Every verse in the Bible is linked to a specific mp3 audio sermon/explanation from my preacher.
Relational Databases aren't necessarily meant to store actual files. Sure, you could store BLOB binary types, but I wouldn't suggest it. That's what file servers are for. For example, Amazon S3, or Firebase Storage.
You can store the URL to a file in the database, but store the actual file on a remote system to keep your applications size small.
You can cache the resources on disk lazily as the user reads said passage, or set up a system to stream them. That'd require more effort than just downloading the whole file once per device, though
I could not understand a lot from you question as there are too few details. If I understood correctly the question, the best way to implement this is to upload the mp3 you want to the server and in the android app play the file from the server (make a request to the web). In this case you will save to the database only the name of your mp3 and the link from the server to this file.
Another approach would be to convert your mp3 to base64 and save it in SQLite as a text datatype (as base64 string may have more than 256 chars long) and when needed you can decode it but it will be much slower than hosting everything to cloud
try {
MediaPlayer player = new MediaPlayer();
player.setAudioStreamType(AudioManager.STREAM_MUSIC);
player.setDataSource("http://xty/MRESC/images/test/xy.mp3");
player.prepare();
player.start();
} catch (Exception e) {
// TODO: handle exception
}

The best way to get song from remote database

I was wondering what is the best way to play song without having connection network ?
Explanation :
I have an application that play some songs. I can play a song whenever I want, even if I m in a tunnel or in a place where I dont have a network connection.
What is the best way to manage it ?
Does sqlite sufficient to save a song to a binary format ?
Should I store the music in a directory and register the sound path ?
Thanks for advance
You can store song meta-data in SQLite (like: song list, titles, authors...) but storing actual audio data in it is a bad idea. The overhead of storing BLOBs in a database is pretty big. And there is no way to play audio directly off database, so I would have to unload it all to memory or create temporary file.
I suggest you to relay on normal files located on external storage.

How store the data in android device securely?

I have the problem to store the downloaded data in my android device Now I store the data on my sdcard, but this is not much prevent from the user. I need to store the data securely from the user. How can I do that?
there is no way you can prevent the user from accessing your data. The max you can do is :
Make the folders you create as hidden ( prefix the folder names with a . )
remove the extension of the files you create, if possible. In most cases you can still access them & your files dont show up in other apps (like music players, Image viewers).
For storing senstive data or some downloaded dat in the application , just use internal Storage. ie "data/data/{App package name}/{direcdtory name}". if you store data inside the internal storage, only your application can access the data not the user nor other application.

Android Video listing from remote server?

I use my application to upload the video in server and it was stored in appropriate folder in server, i need to show the list of video from remote server folder and allow the user to streaming the video.Is there any sample is there?
I feel you can have a script running on server which tells you about which directory has what videos, and returns their URLs too.
Later, you can access those URLs to play the videos
You can use commons-net-2.2-bin library to create a FTP connection to your server and make a query of listing . files from the folder.

Categories

Resources