I am making a chat app that stores sent images in it's private folder on external storage. After saving an image the Google Photos app notices that and asks if the user wants to backup that folder.
Is there a way to prevent that?
'.nomedia' file does not help.
Kindof, Google backup reads imgs and video types.
There are 3 workarounds that I know,
Make the Folder hidden.
Add "." before the folder name. (when u create the folder)
Have a lot of folder hierarchy.
Example: /0/AppName/sentimgs/ <- Can be read by google backup
/0/AppName/bla/bla/bla/sentimgs/ <- Cant be read.
Save the img without an extension. And make ur app add it when they want to view it.
The Shank's first solution worked for me.
However, I noticed that I created .nomedia file wrong, so after fixing it the backup problem has been also solved.
Related
I'm trying to make launcher for my game. I want it to display update log. How I want it to work:
Replace log.txt file on Google Drive and new log will be displayed in launcher.
I have no idea how to make this. Also I have to make auto-updater.
It will work similiar to update log - upload .jar file and res folder on drive. When game launched it will check for updates and if new update available it will download it.
Like I said, I have no idea how to do this.
I advise you to use GitHub to upload your files. Then you can use the URL provided by GitHub to open a urlStream in your project and read that file like a .txt.
Google drive is a file explorer only. It will allow you to upload and download files, it does not have the power to display or edit them. Unless you want to display them in the Google drive web application in which case there should be a webContentLink available in the response data for the file.get method, however the file will need to be either public or the user must have access to it in order to be able to see it.
To display the file you will need to download it and display it locally. To edit it you will need to download the file and edit it then upload it again.
Tbh i think what you are asking is out of scope for this api.
in my app I handle obb extension files download and hosting manually.
I did not upload it in app store, because I use more than one obb files depending on the specific user needs, so I cannot just use a single obb file that is uploaded on play store for the user to download.
I also manage manually obb files rename, so they can be usable for the app, as user can have more than one obb files downloaded and switch between them while app is renaming the obb accordingly.
My issue is, that after a normal update through Play Store, the obb file gets deleted, thus requiring user to re-download it.
I would be happy to know why this is happening or a way to avoid it.
Please note, that I don't have any obb file uploaded on Play Store, because it wouldn't serve my needs. Once user opens the app, chooses appropriate extension to use and then download it through my app.
Thank you!
If your OBB is not downloaded from the Play Store, then I wouldn't stick it in the Play OBB directory. The directory is <shared-storage>/Android/obb/<package-name>/ and the Play store assumes it has a duty to keep this directory clean as part of the update process, so the user isn't left with a bunch of unnecessary OBB files.
If you want to download the files yourself, and take care of the updates yourself, just put the files in another directory. I'd recommend reading the docs on developer.android.com to help you choose the best location.
I'm making an app which contents should be downloaded from a server. After downloading videos, I want to prevent them from publishing or sharing. I searched about this and find out that putting a dot (.) before the name of the video will hide it from file manager and gallery. But if the user uses a professional file manager would see the videos!
I want a solution to make videos unplayable via other apps.
As far as I Know, you could put your files in your internal directory which is private and only your app can access it.
but still, devices with root access can view and edit your files.
you can get private file location via context.getFilesDir()
You can use cache directory instead of External storage
Ex:
File cacheDir = new File(context.getCacheDir(), DEFAULT_CACHE_DIR);
each app has own cached directory and can accessible only for that app (unless root)
That one simple way to hide media from other apps
more
Background
I am developing an android application that will only be used on Nexus 7 tablets (my team is also providing and has access to the hardware).
Problem
The app needs to be flexible to allow content to be added (by non-tech savvy users) to the app and accessed without an internet connection.
Our Idea
Android devices have a file system. We want to design a file system layout such that the people adding content to the application can drag and drop into the correct folder.
e.g.
AppName
Images
Videos
If the user adds a video to the videos folder of the device under our app, it will show up in the app.
We understand that this could easily go wrong (accidentally delete a folder, etc.) but this is out best attempt to solve this without having to update the app ourselves whenever new content comes up (and remember, no internet connection!).
The Question
Is it possible to access the android file system contents and insert them into an app as described in the "Our Idea" section? If so, how?
Yes. This is possible if you don't bother about content security. You can copy the content to any of the file system path in sdcard and your app can look for the folder and read the files .
Example , you can create a folder in sdcard as
sdcard/appname/media/
and create a layout to access the files in the device, and when user selects the files provide option to copy it to your sdcard/appname path.
Check this link
http://developer.android.com/training/basics/data-storage/files.html
Note : the sdcard path can be accessed if you connect to any external system ( PC).
I have small XML(KB) file in my assets folder. My application draws data from it. But then I have downloaded an updated version of the file I need to replace it somehow and I don't know how to?
Since I am developing on higher API`S I can use DownloadManager class.
You cannot replace an asset -- assets, like resources, are read-only.
Instead, you will need to adjust your application to detect if you have downloaded the replacement file and use that instead of the asset if it is available.
My solution is:before i use the assets file i delete all cache file int the path---/data/data/com.yourpackagename.xxx,ofcourse just when the app version is above the old app version.(i saved a SharedPreferences when the app first run.so i can compare the app version).
I don't know why the new app's assets resource is exist,but the solution is worked for me!
ps:my app homepage is a webview and the file in the assets,so,i need replace it each app update!