Android :: Out Of Memory Calling MediaStore.Images.Media.get Bit map
Apr 15, 2010
After I've used a MediaStore.ACTION_IMAGE_CAPTURE intent to take a photo, when I try to retrieve the captured image, I sometimes get an out of memory error as shown below. The odd thing is the huge size of the memory trying to be allocated is always reported as 10,077,696 (x99c600). However, the image file is much smaller, typically around 750,000 bytes.Any suggestions on how to get around this problem? I'm testing this on a Nexus One with firmware version: 2.1-update1 and Build number: ERE27. Code...
View 2 Replies
Apr 17, 2010
I am using MediaStore.Images.Media.insertImage(ContentResolver cr, String imagePath, String name, String description) function to insert a newly created image into gallery. System is naming the file by default, but its different than names of pictures taken by original app(Time stamp). Is there easy way to set it up?
View 2 Replies
View Related
Feb 23, 2009
I'm running android sdk v1.1-r1 testing with a T-Mobile G1 device HT841GZ04082. I have a jpg on the sdcard that I want to add to the photo viewer. I do this quite simply with the test code...
View 7 Replies
View Related
Aug 16, 2010
I'm using MediaStore.Images.Thumbnails in order to show the images the user have. But i'm not able to get an image through its path.
Is there any way to look for an image using the path? Code...
View 1 Replies
View Related
Nov 22, 2009
Hello, I'm testing some code from a demo found in a forum and I'm getting some strange results. My goal is to be able to allow users to access the pictures on their device to choose an avatar/logo. This code run flawlessly except that I only get a handful of images on the phone. And its not even always the same images. Whats more is that it loads those images into a gridview and repeats them for what looks like a number of times equal to the actual number of images that are on the device. And on top of that if I scroll down the through the pictures, and scroll back up, it reorders the pictures from what they were previously. Each time I load the app the pictures seem to be different as well. I have around 400 pictures stored on my phone, and thats what I'm using to test. If someone could shed some light on this for me that would be great. This is my first time using a URI to access content to I'm not sure where to start troubleshooting this one. Code...
View 9 Replies
View Related
Mar 2, 2009
I got FileNotFoundException when run this
FileInputStream fileToRead = new FileInputStream(fileName);
here fileName is a string =content://media/external/images/media/6 which is got in sdcard image selection by android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI
any solution?
View 3 Replies
View Related
May 1, 2010
I manage media (images, sound) of my app directly, reading and saving to the SD card. Should I be using the MediaStore instead? I'm not quite sure what the MediaStore is for, and the javadoc is not very helpful. When should an app use the MediaStore? A brief overview of the pros and cons of the MediaStore.
View 2 Replies
View Related
Feb 25, 2010
Hopefully the title wasn't to confusing but what I meant was the following:
Lets say activity A starts activity B by calling:
Intent myIntent = new Intent(Activity_A.this, Activity_B.class);
Activity_A.this.startActivity(myIntent);
Could I save/free up some memory by finishing Activity_A after Activity_B is begun (if thats even possible). Maybe through the following:
Intent myIntent = new Intent(Activity_A.this, Activity_B.class);
Activity_A.this.startActivity(myIntent);
Activity_A.finish();
Or would Acitivty_A call startActivity() and wait for Activity_B to finish before it called finish()?
The idea would then be that when the users end with Activity_B, it would just restart Acitivity_A (and finish itself in a similar fashion)? Would this create too much overhead? Thanks for any answers and I apologize if the formatting of this post isn't correct.
View 2 Replies
View Related
Apr 21, 2009
I have made a game with just one activity.. I just replace the views when I want to change screen. The game runs fine for a really long time inspite of what ever I do within the game.
But once I close the main game, by calling finish on the only activity in the application, and then when I start again, within the next 30 secs it crashes telling VM budget exceeded..
When I don't have a dispose() or a delete method in JAVA.. how the, am I supposed to remove the objects used in memory.. moreover I have android:launchMode="singleInstance" in my manifest
View 4 Replies
View Related
Apr 26, 2010
I am trying to retrieve a list of images and text from a web service. I have first coded to get the images to a list using Simple Adapter.
View 1 Replies
View Related
Jul 22, 2010
I'm developing an image editor for Android. When I do some operations with small pictures (600x600 - 1024x768), the program work well. But when I do some operations with big pictures, I always obtain an OutOfMemory Error. I read read many post trying to have the image in memory. Also I looked at the Android's Gallery, trying to simulate the effect of loading the image with lower quality and get the complete quality after a while. But I doesn't get to work with large images.
I thought of using the parameter inSampleSize but I raised the problem of having to perform operations on the image and save it with the original size, so it no longer serves me. The only thing I've done is use the parameter inJustDecodeBounds and display an error to the user if the image exceeds the available memory.
Is there any possibility of working with large images with no memory problems? I need urgent help.
View 19 Replies
View Related
May 6, 2010
Any app out there support gif images? I have a 2.1 ROM and the gallery only shows a still image. My POS Blackberry Pearl (first gen) was able to show them but my awesome Android power phone cannot?
View 3 Replies
View Related
Aug 31, 2010
ContentResolver cr = getContentResolver(); Uri pic = Uri.parse("content://media/external/images/media/3");
Bitmap bm = Media.getBitmap(cr,pic); The above code is written in onCreate method of my Activity class. It throws the following error:
08-30 12:27:22.352: WARN/System.err(245): java.io.FileNotFoundException: No content provider: [content://media/external/images/media/3]
What could be wrong? The file in question is there because I launched Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI) in another method and got back the Uri of the picked image from the returned intent.
View 1 Replies
View Related
Aug 9, 2010
I guess this question has been asked before, but I can't seem to find a proper answer/solution. Have a note-taking app, which allows to take pictures. For that I start an intent, that starts up the built-in camera-app. So far so good. But when I show that image in my app, it's in a much smaller format The funny/weird thing is, that the camera-app did take a full-resolution picture! But for some reason I can't get the full version to show in my app? So, when I use the standard Android Gallery app, and go to that picture, it is very obvious that it's full size (I can zoom in and see details I really can't see when I zoom in, in my own app). Also, the dimensions are really those of the original picture, taken with the 5MP camera. In my app, they are very small. My phone has Android 2.2, but the same happens on my emulator (Android 2.1). How should I retrieve the pictures in my app? Tried a couple of ways, but none works :( Don't need a complete example (allthough that's very welcome), just a few clues are enough to search for myself.
View 1 Replies
View Related
Jun 19, 2010
When I'm using the internet on my phone, if I use google image search for example, everything looks horrendous until I click "view full image", and then it displays correctly.
I know this is because the user agent is set to Android, but if I set it to desktop instead websites appear too small and the formatting isn't laid out to be more suitable for phones. Is there any way of having the best of both? Having the formatting optimisation without heavily compressing the images when I click on them?
View 7 Replies
View Related
Feb 3, 2010
I had some photos on my Droid and dragged them into the double twist photo album. Now, how do I get the photos from double twist into my iphoto album? Is there a way to import images from the Droid to iphoto without going through double twist?
View 1 Replies
View Related
Oct 31, 2010
Does anyone know how to delete all images in the media landscape at once? Or is it not even possible?
View 1 Replies
View Related
Jun 19, 2009
I was just wondering if anyone could help me with the following problem I am having with my 8GB Memory Card i recently purchased for my G1. The built-in memory card reader on my computer does not recognize the card when I insert it, so I attached it via USB whilst still in the phone. The computer then recognised it until I began transferring items to it. When it just stopped working and even made the phone unresponsive.Have I just bought a dodgy memory card?
View 3 Replies
View Related
Feb 16, 2010
How can I get the album art from MediaStore?
View 1 Replies
View Related
Sep 27, 2010
I'm trying to query the Android's MediaStore.Images.Media to get the images contained in the device. I get my cursor on the DB like this: Code...
and I get the indices of the columns this way:
int dataIdx = cursor.getColumnIndex(DATA); ... int idIdx = cursor.getColumnIndex(MediaStore.Images.Media._ID);
unfortunately it seems that the column index idIdx is always -1, which means the column doesn't exist. Am I doing something wrong? Is there anyone else experiencing the same?
View 3 Replies
View Related
Jul 8, 2010
I have the HTC incredible, and I would like for it to be able to read memory cards other than the micro sd. Specifically, I am interested in using Sony Pro Duos and transferring pictures from the pro duo card to my device. Assuming I acquired the proper usb cables and then hooked a card reader up to the device, would this work?
View 4 Replies
View Related
Sep 9, 2010
Trying to transfer music onto SD card but Media Go wont show my card as a device.
View 2 Replies
View Related
Feb 14, 2009
If I pragmatically store new media files on the SD card, the MediaStore does not know about them until I remove and reinsert the SD card. Is there a way to tell the MediaStore to rescan the SD card without first unmounting the SD card?
View 6 Replies
View Related
Jun 17, 2010
For example if a have two directories /sdcard/Music/Music-1 and /sdcard/Music/Music-2 how can i construct uri to get the files in Music-1 dir for example. I can use MediaStore.Audio.Media.EXTERNAL_CONTENT_URI to get the content of all external storage but how to do the trick only for specific dir.
View 1 Replies
View Related
Aug 13, 2010
I have an app that allows the user to take and save a new picture using the Intent ACTION_IMAGE_CAPTURE. After the user accepts the newly taken picture, I create a ContentValue object to set the picture information, and then I insert the picture into the MediaStore and send a broadcast so that the user can see the photo when opening a picture viewer app such as gallery:
ContentValues newImage = new ContentValues(3);
newImage.put(Media.DISPLAY_NAME, mPicName);
newImage.put(Media.MIME_TYPE, "image/png");
newImage.put(MediaStore.Images.Media.DATA, path);
mPictureUri = getContentResolver().insert(Media.EXTERNAL_CONTENT_URI, newImage);
sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, mPictureUri));
All of this code works fine. The photo is correctly saved, and I can view the photo using gallery. The problem is that when I view the photo in gallery and select "Details" it shows the photo name as "null." And yes, I know for a fact that the variable mPicName above is not null and always has the correct value.
The odd thing is that, when running my app on my Droid running Android 2.1, when I choose to copy files to/from the phone and my computer, I open up the Droid on my Windows computer, and when I go into my app's created folder for photos and view the new photo, the name is correct. Then, when I disable copying files from the phone/computer and go back into gallery to view the file on my Droid, the name is suddenly correct and is no longer null.
Can someone tell me why the name is null after my code runs, and why the name is correct after viewing the file on my computer rather than on the phone? Is there a way to get the name non-null right when the picture is saved? I'd bet that the name would be correct if I turned my phone off and turned it back on, but I'm not sure how exactly to get force things to work immediately.
View 1 Replies
View Related
Oct 7, 2010
How do i get back the image taken from starting the Intent(MediaStore.ACTION_IMAGE_CAPTURE)?
I need the image to be display as a thumbnail and also be attached to email.
View 2 Replies
View Related
Jul 15, 2009
I have seen a number of posts from people who had trouble retrieving a full size image from MediaStore.EXTRA_OUTPUT with code...
Should this code work? I mean, should this result in a file containing the picture?
View 4 Replies
View Related
Sep 30, 2009
Is that normal that Images indexed in the MediaStore do not have thumbnails generated until the Gallery app is launched and the user actively navigates to the bucket where the image is stored ?
I think it's quite odd as I thought thulbnails generation was part of media indexing.
View 9 Replies
View Related
Feb 17, 2010
When I take a picture with Androids camera app, it detects the phone's orientation and saves the pic accordingly. So if i take a picture of a building, the roof will be on the topside, whether I hold the phone in landscape position or portrait.
However, when i use
Intent imageCaptureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
to get a picture, the camera app doesn't react to orientation. If i hold the phone vertically (portrait), the resulting pic will be rotated, with said building's roof to the left of the screen.
How can I set the intent so that the camera will take orientation into account? Or can I deduce in some way in what orientation the pic was taken and rotate it myself afterward?
View 1 Replies
View Related
May 7, 2010
I just don't get it: when I use the camera with an intent and also specify an output file, the returned image is always very small on many devices (e.g. Motorola Milestone 2.1, HTC Desire 2.1, Emulator 2.1, Emulator 2.0.1) but not on all (e.g. Nexus One). Here's what I do to bring up the camera app:
private final static String TEMP_PHOTO_FILE = Environment.getExternalStorageDirectory() + "/TEMP_PHOTO.JPG"; ..............
View 1 Replies
View Related