Android :: Image Saved To SD Not Appear In Android Gallery Application
Jan 31, 2010
I save an image to the sd card and it doesn't appear in the Gallery application until I pull off the sd card and return it back. Seems like the Gallery application has some cache that isn't updated on file save. Actually, I also want to open the just-saved image in Gallery application and have no success with that.
View 5 Replies
Jan 30, 2010
I am trying to open an image / picture in the Gallery built-in app from inside my application. I have a URI of the picture (the picture is located on the SD card).
View 3 Replies
View Related
Mar 15, 2010
I've written an app, thats loading images either using the android gallery app or by taking a photo using the cam. When I now load an image using the gallery, everything is fine. When the code is being executed a second time (for loading another image), the application crashes.
try { Uri data = intent.getData();
ContentResolver cr = this.getContentResolver();
Bitmap mBitmap = null;
mBitmap = Media.getBitmap(cr, data);
imageView.setImageBitmap(mBitmap);
} catch(Exception e){ showToast(this, "Failed loading image from gallery");
return;
}
The code crashes at the line:
mBimap = Media.getBitmap(cr, data);
Everything is initialized, there are no null values etc. The strange thing is: no exception is thrown, I don't get into the catch block to determine whats going wrong. Am I not allowed to "re-use" the content resolver? Do I have to free it after the first usage or something like this?
View 2 Replies
View Related
Oct 30, 2010
I've got an app that accepts images from the image gallery (via share menu). My app starts, and I do this:
Bundle bundle = getIntent().getExtras();
Object obj = bundle.get("android.intent.extra.STREAM");
While debugging, Eclipse is reporting the object obj is of type 'Uri@StringUri' (???) and inside it somewhere is the string 'content:
//media/external/images/media/992'.
Anybody know what type of object obj is so I can typecast it? And what's the string about? IE, how do I get to the image data?
View 1 Replies
View Related
May 3, 2010
I am adding a bmp file to the media store using the line below. I then go to the gallery application and it shows the image, but shows it under "Camera Pictures". Is there a way to change this to its own group, perhaps to its own group? Do I need a custom content provider for this.
View 2 Replies
View Related
May 11, 2010
I am playing around with the Gallery widget.I would like to know how can we get the position of the image on focus in the gallery. For example having several pictures in my gallery, if I tap my finger to the right, pictures will come and go until it stop to one. How one can get the position of this one picture that is currently on focus ?I don't know if I was clear enough, if there is anything you want me to add do not hesitate.
View 2 Replies
View Related
Jun 2, 2010
First of all let me say that this questions is slightly connected to another question by me. Actually it was created because of that. I have the following code to write a bitmap downloaded from the net to a file in the sd card:
// Get image from url
URL u = new URL(url);
HttpGet httpRequest = new HttpGet(u.toURI());
HttpClient httpclient = new DefaultHttpClient();
HttpResponse response = (HttpResponse) httpclient.execute(httpRequest);
HttpEntity entity = response.getEntity();
BufferedHttpEntity bufHttpEntity = new BufferedHttpEntity(entity);
InputStream instream = bufHttpEntity.getContent();
Bitmap bmImg = BitmapFactory.decodeStream(instream);
instream.close();
// Write image to a file in sd card
File posterFile = new File(Environment.getExternalStorageDirectory().getAbsolutePath()+"/Android/data/com.myapp/files/image.jpg");
posterFile.createNewFile();
BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(posterFile));
Bitmap mutable = Bitmap.createScaledBitmap(bmImg,bmImg.getWidth(),bmImg.getHeight(),true);
mutable.compress(Bitmap.CompressFormat.JPEG, 100, out);
out.flush();
out.close();
// Launch default viewer for the file
Intent intent = new Intent();
intent.setAction(android.content.Intent.ACTION_VIEW);
intent.setDataAndType(Uri.parse(posterFile.getAbsolutePath()),"image/*");
((Activity) getContext()).startActivity(intent);
A few notes. I am creating the "mutable" bitmap after seeing someone using it and it seems to work better than without it. And I am using the parse method on the Uri class and not the fromFile because in my code I am calling these in different places and when I am creating the intent I have a string path instead of a file. Now for my problem. The file gets created. The intent launches a dialog asking me to select a viewer. I have 3 viewers installed. The Astro image viewer, the default media gallery (I have a milstone on 2.1 but on the milestone the 2.1 update did not include the 3d gallery so it's the old one) and the 3d gallery from the nexus one (I found the apk in the wild). Now when I launch the 3 viewers the following happen:
Astro image viewer: The activity launches but I see nothing but a black screen.
Media Gallery: I get an exception dialog shown "The application MediaGallery (process com.motorola.gallery) has stoppedunexpectedly. Please try again" with a force close option.
3D gallery: Everything works as it should.
When I try to simply open the file using the Astro file manager (browse to it and simply click) I get the same option dialog but this time things are different:
Astro image viewer: Everything works as it should.
Media Gallery: Everything works as it should.
3D gallery: The activity launches but I see nothing but a black screen.
As you can see everything is a complete mess. I have no idea why this happens but it happens like this every single time. It's not a random bug. Am I missing something when I am creating the intent? Or when I am creating the image file? As noted in the comment here is the part of interest in adb logcat. Also I should note that I changed the way I create the image file. Since I want to create a file that reflects an online file I simply download it instead of creating a Bitmap and then creating the file (this was done because at some point I needed the Bitmap but now I do it the other way around). The problems persist thought and are exactly the same:
I/ActivityManager(18852): Starting
activity: Intent {
act=android.intent.action.VIEW
dat=/sdcard/Android/data/com.myapp/files/image.jpg
typ=image/* flg=0x3800000
cmp=com.motorola.gallery/.ViewImage }
I/ActivityManager(18852): Start proc
com.motorola.gallery:ViewImage for
activity
com.motorola.gallery/.ViewImage:
pid=29187 uid=10017 gids={3003, 1015}
I/dalvikvm(29187): Debugger thread not
active, ignoring DDM send
(t=0x41504e4d l=38)
I/dalvikvm(29187): Debugger thread not
active, ignoring DDM send
(t=0x41504e4d l=64)
I/ActivityManager(18852): Process
com.handcent.nextsms (pid 29174) has died.
I/ViewImage(29187): In View Image
onCreate!
D/AndroidRuntime(29187): Shutting down VM
W/dalvikvm(29187): threadid=3: thread
exiting with uncaught exception
(group=0x4001b170)
E/AndroidRuntime(29187): Uncaught
handler: thread main exiting due to
uncaught exception
E/AndroidRuntime(29187):
java.lang.RuntimeException: Unable to
start activity
ComponentInfo{com.motorola.gallery/com.motorola.gallery.ViewImage}:
java.lang.NullPointerException
E/AndroidRuntime(29187): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)
E/AndroidRuntime(29187): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
E/AndroidRuntime(29187): at
android.app.ActivityThread.access$2200(ActivityThread.java:119)
E/AndroidRuntime(29187): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
E/AndroidRuntime(29187): at
android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(29187): at
android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime(29187): at
android.app.ActivityThread.main(ActivityThread.java:4363)
E/AndroidRuntime(29187): at
java.lang.reflect.Method.invokeNative(Native
Method)
E/AndroidRuntime(29187): at
java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime(29187): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
E/AndroidRuntime(29187): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
E/AndroidRuntime(29187): at
dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(29187): Caused by:
java.lang.NullPointerException
E/AndroidRuntime(29187): at
com.motorola.gallery.ImageManager.allImages(ImageManager.java:5621)
E/AndroidRuntime(29187): at
com.motorola.gallery.ImageManager.getSingleImageListByUri(ImageManager.java:5515)
E/AndroidRuntime(29187): at
com.motorola.gallery.ViewImage.onCreate(ViewImage.java:1801)
E/AndroidRuntime(29187): at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
E/AndroidRuntime(29187): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)
E/AndroidRuntime(29187): ... 11 more
View 3 Replies
View Related
Sep 26, 2013
Where does the Twicpic image get stored in Twitter app for Android 4.2? I have been clicking on SAVE button several times, but cannot find any image in the storage.
View 2 Replies
View Related
May 3, 2014
OK it looks like I goofed and didn't backup the right messaging app in titanium...
However, before I decided to install a my new ROM I took a image backup in CWM and I'm guessing the messages got backed up too. I would reload the backed up image that CWM did but I'm getting this pesky MD5 mismatch nonsense.
So rather than faff with that, is there a way I can extract the messages / sms history from the image and restore it whilst in my new ROM environment?
View 1 Replies
View Related
Sep 20, 2010
I got all images from device's gallery,but i got images path is like,i want to get real image path for each images and send email,how can i get path?given below code i used,anybody knows,please give some sample code for me..i have email code.i want to only get real image path.How can I convert this path to real one (just like '/sdcard/image.png')?
View 1 Replies
View Related
Dec 10, 2009
I added and displayed set of images in my gallery. I made like at a time use can view three images. Now I want to do different Animation for these images?
View 3 Replies
View Related
Mar 29, 2009
Eldev LLC is looking for android developer familiar with google image search API to write a new application.
View 4 Replies
View Related
Dec 30, 2009
I've got a Droid with Touchdown, which works perfectly except for one issue. Any picture/image that comes through in emails in Touchdown gets saved into the Gallery, making it very large and hard to open. I have figured out where to delete these images, but it is sort of a pain to have to go in and delete them out every couple of days. Is there some sort of setting that I am missing in Touchdown to prevent this?
View 1 Replies
View Related
Jun 22, 2010
I am using gallery widget i want to change selected image. When i run the following code and i use roller ball or arrow keys over device and if i try to scroll left to right or right to left focus goes out of gallery to next item over the screen what is that ?
View 1 Replies
View Related
May 20, 2010
I want display the images saved in the cell phone in my own application. now I am using MediaStore.Images.Media to do this. I can get the name, size and other information of the images. but i don't know how to get the bitmap? can u help me. thx.
There is a method getBitmap(ContentResolver cr, Uri url), but i don't know how to get the Uri of one certain image.
View 1 Replies
View Related
Apr 25, 2010
I'm developing an app for Android 2.1 upwards. I want to enable my users to select a profile picture within my app (I'm not using the contacts framework). The ideal solution would be to fire an intent that enables the user to select an image from the gallery, but if an appropriate image is not available then use the camera to take a picture (or vice-versa i.e. allow user to take picture but if they know they already have a suitable image already, let them drop into the gallery and pick said image). Currently I can do one or the other but not both.
If I go directly into camera mode using MediaStore.ACTION_IMAGE_CAPTURE then there is no option to drop into the gallery. If I go directly to the gallery using Intent.ACTION_PICK then I can pick an image but if I click the camera button (in top right hand corner of gallery) then a new camera intent is fired. So, any picture that is taken is not returned directly to my application. (Sure you can press the back button to drop back into the gallery and select image from there but this is an extra unnecessary step and is not at all intuitive). So is there a way to combine both or am I going to have to offer a menu to do one or the other from within my application? Seems like it would be a common use case, surely I'm missing something?
View 1 Replies
View Related
Sep 10, 2010
I want to auto select an image in gallery and focus the selected image. I know the position (index) of the image in gallery. I am trying to use in res/layout/main.xml
<Gallery
android:id="@+id/galleryView"
android:layout_below="@id/imageViewMap"
android:layout_width="fill_parent"
android:layout_height="100sp"
android:layout_weight="1" />
in AlbumView.java
gallery = (Gallery) mView.findViewById(R.id.galleryView);
ImageView view = gallery.getItemAtPosition(position);
Unfortunately the above code is returning null. Can you please help in this matter.
View 1 Replies
View Related
May 7, 2010
I have seen a lot of posts about this, and it seems like the code below should work. I have created an SD Card image and added it to the emulator (and that works fine).
Intent intent = new Intent(Intent.ACTION_PICK);
intent.setType("image/*");
//intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(intent, 1);
It does launch and allow selection of images, but when I click on an image, everything exits and the emulator returns to the home screen, not back to my app. My onActivityResult is never called either. What am I missing?
View 2 Replies
View Related
Jan 24, 2010
I want to do an image gallery like in iphone. I want to show low quality (pre-resized) images and when the image is active I want to process the big image and show the result in the gallery. I have two questions. How to attach a listener on the animation stop in gallery? And how to access an image after this action?
View 1 Replies
View Related
Sep 20, 2010
I'm new to Android and I want to make an image gallery where each column is a category, and users can scroll both vertically and horizontally. I found a useful post about how to display list of images here. I'm wondering if it's possible to nest lists of image inside of a gallery view?
View 1 Replies
View Related
Oct 12, 2010
I am designing a screen , in which I am showing a gallery along with other UI components . The selected item is shown in the center of the gallery . I want to make the size of selected item somewhat bigger than the rest items of gallery .
View 4 Replies
View Related
Oct 14, 2010
I've had an app on the market for over a year. Recently customers have been reporting a crash; all customers have been running Android 2.1 or 2.2 (note sure if the crash is limited to those platforms tho; interesting that this does work on the simulator but not physical devices. Maybe devices renamed the component name of the image gallery?). The crash occurs when I attempt to lauch the Image Gallery app.
Is there a preferred method to launching the Image Gallery?
I use the following code.
CODE:.............
How to fix this or a new method to launch the Image Gallery?
View 2 Replies
View Related
Jul 6, 2010
I believe this is pretty trivial but I can't get it to work. I want to display a default image in gallery elements (ImageViews) while their actual image is being fetched from the net. Right now, nothing is shown for an ImageView which its image has yet to arrive. Once it arrives it is immediately shown. What I tried is right after the instantiation of the ImageView to call its setImageResource function like so:
final ImageView i = new ImageView(mContext);
i.setImageResource(R.drawable.loading);
But it doesn't seem to work. Below is the full getView() function.
public View getView(int position, View convertView, ViewGroup parent) {
final ImageView i = new ImageView(mContext);
i.setImageResource(R.drawable.loading);
// if the drawbale is in the buffer - fetch it from there
Drawable bufferedImage = DataManager.getInstance().getImagesBuffer()[position];
if (bufferedImage != null){ i.setImageDrawable(bufferedImage);
BitmapDrawable drawable = (BitmapDrawable) i.getDrawable();
drawable.setAntiAlias(true);
} // if drawable is not in buffer - fetch it from the net via AsyncImageLoader
else { String imageUrl = DataManager.getInstance().getImageBufferInstance().getImageUrl(position);
Drawable downloadedImage = AsyncImageLoader.getInstance().loadDrawable(imageUrl, new ImageCallback() {
public void imageLoaded(Drawable imageDrawable, String imageUrl) {
if (imageDrawable == null) { imageDrawable = getResources().getDrawable(R.drawable.icon);
} i.setImageDrawable(imageDrawable); BitmapDrawable drawable = (BitmapDrawable) i.getDrawable();
drawable.setAntiAlias(true);
} } ); i.setImageDrawable(downloadedImage);
} i.setLayoutParams(new CoverFlow.LayoutParams(Utils.getInstance().getScreenWidth() / 2, Utils.getInstance().getScreenHeight() / 2));
i.setScaleType(ImageView.ScaleType.CENTER_INSIDE); return i;
View 1 Replies
View Related
Apr 15, 2010
I have four images in the Gallery View. When we do swipe from left to right or right to left the Gallery View moves all the images i.e if I swipe from left to right from the first image then it will move to all the four images. What I want is that when I swipe it should only move to the next image.
View 2 Replies
View Related
Jun 30, 2010
Is it by any chance possible to get a list of alarms saved in the alarm application of android ? I am making an application which just needs to show the alarms set in the Alarm application.
View 1 Replies
View Related
Oct 14, 2009
I was capturing images before that were showing up in the gallery, but now they are not and I can't figure out why. Here is my code:
ContentValues values = new ContentValues();
values.put(android.provider.MediaStore.Images.Media.IS_PRIVATE, false);
String name = "ugc_" + String.valueOf(System.currentTimeMillis());
values.put(android.provider.MediaStore.Images.Media.TITLE, name);
imageURI = getContentResolver().ins (android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values);
I also tried:
values.put(android.provider.MediaStore.Images.Media.IS_PRIVATE, 0);
As well as leaving out that value, but nothing seems to work now.
View 2 Replies
View Related
Feb 4, 2010
When I take a picture with Android's camera app, it is inserted in the gallery with a name identical to it's creation date/time, like "2010-02-04 16.36.15.jpg". In my app I take my own pics, and insert to the gallery them using:
android.provider.MediaStore.Images.Media.insertImage(
ContentResolver cr, Bitmap source, String title, String description);
However, in the gallery they appear with a name that seems to be the time stamp of their creation in millis, like "1265323665851.jpg", no matter what I put in the tittle argument. I need them to have the same name they would get from Android's camera app, so that they will be properly ordered.
View 1 Replies
View Related
Aug 7, 2010
I have implement gallery widget. I just wanted to provide an option to user, that he can download images from gallery. What to do in order to implement downloading options? And I do have imageID and imageName, which user selects.
View 1 Replies
View Related
Sep 1, 2010
As you in following android album widget images placement is from middle of the gallery. I want to start image placement from beginning of the album.
View 4 Replies
View Related
Nov 8, 2010
All the examples I've found online for displaying a gallery of images require creating a custom Adapter and doing a ton of manual work. Is there not an Intent that I can simply pass a path or filter to in order to reuse the default image gallery functionality (display thumbnails, touch to view full pic, sharing options, etc) but limit the results to my application's storage directory?
View 1 Replies
View Related