android-contentresolver

How load songs from special folder on sd card in my listview and play it?

巧了我就是萌 提交于 2021-02-10 22:21:48
问题 I want to load songs from my custom folder which I made on sd card and play it in via my App. the path of this folder is on: /sdcard/Music/MyFolder Now I have a code which loads all music which is located on the sc card. This code is working. But I dont want all music from sd card, I just want the songs in my folder MyFolder Here's the code I have now: private String[] getAudioList() { final Cursor mCursor = getContentResolver().query( MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, new String[]

How load songs from special folder on sd card in my listview and play it?

两盒软妹~` 提交于 2021-02-10 22:19:53
问题 I want to load songs from my custom folder which I made on sd card and play it in via my App. the path of this folder is on: /sdcard/Music/MyFolder Now I have a code which loads all music which is located on the sc card. This code is working. But I dont want all music from sd card, I just want the songs in my folder MyFolder Here's the code I have now: private String[] getAudioList() { final Cursor mCursor = getContentResolver().query( MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, new String[]

Download from Firebase storage + ContentResolver (API >= 29)

依然范特西╮ 提交于 2021-02-10 18:40:04
问题 I am trying to connect ContentResolver and Firebase Storage downloads. Goal: download the files from Firebase storage either into the image gallery or to audio folder. What I did: ContentValues values = new ContentValues(); values.put(MediaStore.MediaColumns.DISPLAY_NAME, "FileName1"); values.put(MediaStore.MediaColumns.MIME_TYPE, "image/jpeg"); values.put(MediaStore.MediaColumns.RELATIVE_PATH, "Pictures" + customDir); AsyncQueryHandler asyncQueryHandler1 = new AsyncQueryHandler

Download from Firebase storage + ContentResolver (API >= 29)

隐身守侯 提交于 2021-02-10 18:28:37
问题 I am trying to connect ContentResolver and Firebase Storage downloads. Goal: download the files from Firebase storage either into the image gallery or to audio folder. What I did: ContentValues values = new ContentValues(); values.put(MediaStore.MediaColumns.DISPLAY_NAME, "FileName1"); values.put(MediaStore.MediaColumns.MIME_TYPE, "image/jpeg"); values.put(MediaStore.MediaColumns.RELATIVE_PATH, "Pictures" + customDir); AsyncQueryHandler asyncQueryHandler1 = new AsyncQueryHandler

Why ContentResolver does not see added files by another app?

≡放荡痞女 提交于 2021-02-07 16:43:28
问题 I added files to Documents/MyExcelsFolder by using ContentResolver.insert and then also added new file to Documents/MyExcelsFolder folder by another app (for ex. FileManager ) Then I try to get all files from the MyExcelsFolder folder fun getAppFiles(context: Context): List<AppFile> { val appFiles = mutableListOf<AppFile>() val contentResolver = context.contentResolver val columns = mutableListOf( MediaStore.Images.Media._ID, MediaStore.Images.Media.DATA, MediaStore.Images.Media.DATE_ADDED,

Why ContentResolver does not see added files by another app?

…衆ロ難τιáo~ 提交于 2021-02-07 16:40:54
问题 I added files to Documents/MyExcelsFolder by using ContentResolver.insert and then also added new file to Documents/MyExcelsFolder folder by another app (for ex. FileManager ) Then I try to get all files from the MyExcelsFolder folder fun getAppFiles(context: Context): List<AppFile> { val appFiles = mutableListOf<AppFile>() val contentResolver = context.contentResolver val columns = mutableListOf( MediaStore.Images.Media._ID, MediaStore.Images.Media.DATA, MediaStore.Images.Media.DATE_ADDED,

Why ContentResolver does not see added files by another app?

邮差的信 提交于 2021-02-07 16:40:43
问题 I added files to Documents/MyExcelsFolder by using ContentResolver.insert and then also added new file to Documents/MyExcelsFolder folder by another app (for ex. FileManager ) Then I try to get all files from the MyExcelsFolder folder fun getAppFiles(context: Context): List<AppFile> { val appFiles = mutableListOf<AppFile>() val contentResolver = context.contentResolver val columns = mutableListOf( MediaStore.Images.Media._ID, MediaStore.Images.Media.DATA, MediaStore.Images.Media.DATE_ADDED,

Android open InputStream from relative uri to ACTION_OPEN_DOCUMENT?

五迷三道 提交于 2021-01-29 06:21:34
问题 I'am trying to open multiple files relative to a json configuration file in android 4.4 (api level 19), I used Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT); intent.addCategory(Intent.CATEGORY_OPENABLE); intent.setType({mime}); this.startActivityForResult(intent, {code}); to let the user find te configuration file, and from there open multiple files that I know the path from the config file. But i get Caused by: java.lang.SecurityException: Permission Denial: reading com.android

How to test class using content resolver/provider?

孤人 提交于 2021-01-20 16:43:21
问题 I'm trying to test class that queries content resolver. I would like to use MockContentResolver and mock query method. The problem is that this method is final. What should I do? Use mocking framework? Mock other class? Thanks in advance. public class CustomClass { private ContentResolver mContentResolver; public CustomClass(ContentResolver contentResolver) { mContentResolver = contentResolver; } public String getConfig(String key) throws NoSuchFieldException { String value = null; Cursor

How to access 3rd party TvProvider on rooted device?

你说的曾经没有我的故事 提交于 2021-01-07 01:29:15
问题 My question is a follow up to this question. Let's assume I have an Android Tv stick, I also am the vendor. There are 3rd party apps like Netflix, Prime, etc. I want to access the channels provided via TvProvider or ContentResolver . As pointed out in one comment: apps vendors signs with the same key as an AOSP itself placed them in a special folder - only vendors of devices can do it or you, but only on rooted devices How are my possibilities for the options above? 回答1: Using one of the