mediastore

Limitations of android

ε祈祈猫儿з 提交于 2019-12-10 11:12:04
问题 I need to build an app that takes a camera image and uploads it to the web where some processing is to be done and a true/false is returned. I encounter some questions in this respect on which a clarification would be well appreciated. 1.) Is there any way my app can know image being captured by the android camera? What I understood from here (Android: BroadcastReceiver intent to Detect Camera Photo Taken?) is that we can know whenever a picture has been added to the phone,be it via Bluetooth

Unknown URI Error in insertImage

让人想犯罪 __ 提交于 2019-12-10 04:32:18
问题 Trying saving bitmap into gallery Bitmap bitmap = Bitmap.createBitmap(surfaceView.getWidth(), surfaceView.getHeight(), Bitmap.Config.ARGB_8888); surfaceView.draw(new Canvas(bitmap)); MediaStore.Images.Media.insertImage(getContentResolver(), bitmap, "foo" , "bar"); I ran the application on the emulator and got an UnsupportedOperationException. 07-25 22:27:48.719: E/MediaStore(1918): Failed to insert image 07-25 22:27:48.719: E/MediaStore(1918): java.lang.UnsupportedOperationException: Unknown

MediaStore.Images.Thumbnails.getThumbnail returns wrong thumbnail instead of NULL

拜拜、爱过 提交于 2019-12-09 14:40:54
问题 Consider the scenario as in this picture: Three photos, one of them is a large GIF file (3MP). I'm querying MediaStore in order to retrieve the correspondent thumbnails. If I initialize the Cursor via CursorLoader with this sortOrder: MediaStore.Images.Media.DATE_ADDED + " DESC"" What happens: MediaStore returns the previous successfully retrieved thumbnail: Expected behaviour: when MediaStore cannot retrieve the thumbnail of a given image for some reason it has to return NULL, as per its

Android: Is EXTERNAL_CONTENT_URI enough for a photo gallery?

时光怂恿深爱的人放手 提交于 2019-12-09 14:27:10
问题 I'm playing around with Android's MediaStore classes and was attempting to create a very simple photo gallery app when I noticed that were two image content URIs: EXTERNAL_CONTENT_URI and INTERNAL_CONTENT_URI . At first I thought it was referring to the location of storage (external SD or internal memory) but after a bit of testing this was clearly not the case. I read more about it here, and it seemed to indicate that the internal content uri is actually content that are internal to each of

How to save an image in Android Q using MediaStore?

十年热恋 提交于 2019-12-09 09:10:38
问题 Here is a link to the new Android Q Scoped Storage. According to this Android Developers Best Practices Blog, storing shared media files (which is my case) should be done using the MediaStore API. Digging into the docs and I cannot find a relevant function. Here is my trial in Kotlin: val bitmap = getImageBitmap() // I have a bitmap from a function or callback or whatever val name = "example.png" // I have a name val picturesDirectory = getExternalFilesDir(Environment.DIRECTORY_PICTURES)!! //

difference between MICRO_KIND and MINI_KIND in mediastore in android?

别说谁变了你拦得住时间么 提交于 2019-12-09 05:29:53
问题 In my android docs i don't have meaning in micro_kind and mini_kind, what is the difference in this two? When it comes to displaying the Image what the difference in the two? FOLLOWUP QUESTION: what is the difference in MediaStore.Images and MediaStore.Video and still give the output of an image, the path contain video path, how come even i use mediastore.images.thumbnail.mini_kind its still displaying image also? Bitmap bmp = ThumbnailUtils.createVideoThumbnail(videoPath, MediaStore.Images

Querying MediaStore as you search via an EditText

两盒软妹~` 提交于 2019-12-08 10:28:44
问题 I am trying to figure out how I can query the MediaStore for specific characters as I search via my EditText. My current solution for searching the MediaStore came from here. And as Ken states, you have to input the name of the song exactly for anything to come up. I would like to know how to make it so that when I gradually input a song name, it finds the songs that have the same characters in the name that I am entering into my EditText. Here's my code: Cursor cursor = getContentResolver()

Is the MediaStore.Images.Media._ID unique?

天涯浪子 提交于 2019-12-08 09:03:38
问题 when I run through the Android Media Gallery like this: Cursor mCursor = getContentResolver().query(MediaStore.Images.Media.EXTERNAL_CONTENT_URI,null,null,null,MediaStore.Images.Media.DEFAULT_SORT_ORDER); if(mCursor != null){ mCursor.moveToFirst(); while(!mCursor.isAfterLast()) { Log.d("Picture ID",mCursor.getString(mCursor.getColumnIndex(MediaStore.Images.Media._ID)); mCursor.moveToNext(); } mCursor.close(); } is the returned ID unique, also when a picture was deleted? Or reuse Android the

Android get song from Media Store if you have the song ID?

删除回忆录丶 提交于 2019-12-07 23:52:39
问题 I got a song id from a playlist in MediaStore, using long id = cursor.getLong(cursor.getColumnIndex(MediaStore.Audio.Playlists.Members.AUDIO_ID)); and the id is correct, but as the only other data available is CONTENT_DIRECTORY, DEFAULT_SORT_ORDER, PLAYLIST_ID, PLAY_ORDER, and _ID, I am not sure how to get the important parts of the song. I need the title, album, artist, etc., as if I was going through MediaStore.Audio.Media to get Song info. I found an answer that I tried to modify to fit my

Detect if image was taken with front camera

末鹿安然 提交于 2019-12-07 18:00:32
问题 I have an Android app that allows a user to upload a profile picture using their camera. The problem is, when the user takes a photo with the front facing camera, the image stored on the phone is mirrored. I am able to mirror the image back to it's original state however, I am unable to perform the flip on front facing camera pictures exclusively. Is there a way to figure out if the picture was taken with the front facing camera? Here is some code I use for getting the picture final boolean