How can I access to a folder with .nomedia file using Media Store APIs? - whatsapp

I'm trying to access media files using Media Store APIs , but I'm facing with a specific issue:
I can scan all the audio files apart all the audio files belong to a folders with .nomedia files inside. As well-known .nomedia file doesn't allow a specific directory to be scanned. But if my application needs to read all the audio file as a core funcionality stored for example :
Android/media/com.whatsapp/WhatsApp/Media/WhatsApp Voice Notes
DualApp/Android/media/com.whatsapp/WhatsApp/Media/WhatsApp Voice Notes
is there any flag, any permission I need to request in order to access to these specific folders ?
Otherwise which is the best practice in Android 11 to access audio media files present in the external storage ?
My first fix was to add the MANAGE_EXTERNAL_STORAGE permission, but my app was rejected with this statment:
You have requested access to All Files Access permission but it appears that your app's core feature requires access to only Media Files or does not need access to any Files. In case your app needs access to Media Files, with the MediaStore API, apps can contribute and access media that's available on an external storage volume without the need for the access all files permission.
Please update your app so that the feature uses Media Store APIs and remove All Files Access (MANAGE_EXTERNAL_STORAGE) permission.
So in case, I cannot use MANAGE_EXTERNAL_STORAGE and the media folder has the .nomedia file inside, How can I scan/access the audio files inside that folder?

Related

Store data into google drive's backup tab instead of drive folders

I need to implement same thing like whatsapp storing all chat history to google drive on clicking on backup button in app. And same restore it in new device as required.
I have look for below references for implementing this, but some how I was not able to do it successfully.
https://developer.android.com/guide/topics/data/backup.html
https://developer.android.com/guide/topics/data/data-storage.html
https://developer.android.com/guide/topics/data/data-storage.html#db
Will this data backup option will help in my requirements or I need to do something else?
I successfully developed the file upload to google drive folders, but i need that data in the backup tab of google drive with app name.
can any one guide me how I can implement this or provide me some references?
Thanks in advance..!
You may refer with this documentation. The Google Drive API includes a special hidden folder that your app can use to store application data.
Note: This feature now uses the alias appDataFolder in place of appdata and appfolder.
To be able to use your Application Data folder, request access to the following scope:
https://www.googleapis.com/auth/drive.appdata
For more information about scopes and how to request access to them, see Authorizing Your App with Google Drive.

Can I upload files from a custom website form to Dropbox?

I have clients uploading files directly to my Dropbox folder. I was curious if I can build a website form that uploads the file to my Dropbox folder and also saves the forms data to my server with a reference to the file that was uploaded to Dropbox? They are legal documents and I don't want to worry about security if Dropbox handles that.
It looks like it should definitely be possible.
You would have to use the dropbox api:
https://www.dropbox.com/developers
https://github.com/dropbox/dropbox-js
There are some javascript examples that would likely be what you would need to go directly to dropbox without going to your server first.

Using dropbox Chooser drop-in to retrieve a non-expiring link to files

I would like to use the Chooser drop-in to select a file from dropbox and then synchronize my app with that file occasionally in the background.
https://www.dropbox.com/developers/dropins/chooser/js
A scenario would be:
List item
User selects file.
File uploads to my app.
User returns to my app a few days later after modifying the file in dropbox.
My app should synchronize and pull down that particular file (without again displaying the Chooser drop-in).
The problem is that the Chooser provides an expiring link to the file:
"direct" is an expiring link to download the contents of the file
I can use the Core API exclusively which would work, however I would have to build my own UI to browse the user's dropbox directory. Ideally, I'd prefer to not introduce the world to another file browser; Dropbox has a file browser - and people are familiar with it. Is this possible?
Thanks,
You can just get a preview link and convert it. See https://www.dropbox.com/developers/blog/53/programmatically-download-content-from-share-links.

access user arbitrary folders with chrome localstorage API

I'm developing an app on Google chrome which could be able to read and write files to arbitrary folders on the user’s hard drive, such as their My Pictures or My Documents folder.
I want my app to has its one folder, like "Users/Username/App", so users could be able to access some of the data, created and edited by the app. How can I do this?
I read the book "Using the HTML5 Filesystem API", so I know it's actually not possible with HTML5 Filesystem API alone. Same thing was possible by opera 11, 12. (see: http://dev.opera.com/articles/view/file-i-o-api-for-widgets/). Chorome mediaGalleries API do same things but just for media file but I want to use html, xml and office files
It doesn't sound like you've looked at the list of Chrome App APIs. Have you? Among them is the fileSystem API, which is evolving quickly to include directory access.

Retrieve all image files using Dropbox Core API

I am working on Dropbox Core API with Google App Engine (python). There seems to be some problems with Dropbox-python-sdk on GAE. Therefore, I have choose to use the Core APIs directly.
My app is trying to retrieve all image files from a user's dropbox (with file type permission). But I couldn't find a way to get all files without specifying the root/path (all the APIs stated here requires a specific file path)
Any idea?
EDIT Dropbox actually recommends not automatically recursing via /metadata calls. (See https://www.dropbox.com/developers/core/bestpractices.)
There's no method to get a recursive list of files, so you would need to use /search to find files or /delta with no cursor to get the full list of files.
Could the Chooser be an option here (if you're just trying to let the user pick individual files)?