Android : MediaStore Returning Loop Of Images - Not Entire Directory

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...

Android : MediaStore returning loop of images - not entire directory


Android :: File Name After MediaStore.Images.Media.insertImage

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

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 View Related

Android : Way To Look For An Image Using Path - MediaStore.Images.Thumbnails?

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

General :: How To Consolidate All Images Into A Single Directory

Nov 28, 2012

I find that several apps save pics in different directories. I would like to be able to consolidate all these images into a single directory that will be opened by the standard Gallery app. I have used a file manager to move .jpg and other files into the /DCIM/Camera directory, but the Gallery app does not show them. What am I doing wrong?

View 2 Replies View Related

Android :: Directory To Store Files Generated By App (audio, Video Files Or Images)?

Apr 24, 2009

Can anybody advice what is the recommended directory to store files generated by your application: audio files, video files or some images.

If the phone contains SD card, it is clear that files should be saved there, but if there is no any external storage. where would you recommend to save to?

View 2 Replies View Related

Android :: Mkdirs Returns False For Directory On Sd Card While The Parent Directory Is Writable

Oct 31, 2010

At some points while running my android application, I need to create a directory on the sd card, for a small number of users this fails and I can't figure out the reason for it... (I've found similar problems caused by the WRITE_EXTERNAL_STORAGE permission missing, it's there and it works for almost all users so I don't think this is reason) When mkdirs returns false I crash the program and log the following java.io.File properties, starting at the directory I want to create, then recursive printing properties of the parent directory and so on...

/sdcard/MyDirectory/Dir1/Dir2 (exists: false, canWrite: false, isDirectory: false, isFile: false);
/sdcard/MyDirectory/Dir1 (exists: true, canWrite: true, isDirectory: true, isFile: false);
/sdcard/MyDirectory (exists: true, canWrite: true, isDirectory: true, isFile: false);
/sdcard (exists: true, canWrite: true, isDirectory: true, isFile: false);
/ (exists: true, canWrite: false, isDirectory: true, isFile: false);

The strange thing is that the parent directory is writable (canWrite=true), I can't print the execute file permission but from what I've read, write is what you need when creating directories... What I've looked at so far is the WRITE_EXTERNAL_STORAGE permission, if the sd card is full and if the sdcard is mounted read only:...........................

View 2 Replies View Related

Android :: Why Doesn't Droid Directory Match To Computer Directory

Dec 23, 2009

I have an app that instructed me to copy some data from my computer to the SDCard. So I plugged the Droid into the computer, mounted my Droid SDCard, looked at the directory, and copied the file. There are a bunch of files and folders listed (e.g. backups for apps, album artwork, etc.) as being on the SDCard. But when I go into Astro on the Droid and select "SDCARD" it shows "directory is empty." I don't get it. Why can't I see the folders and files on the SDCard that I can see on the computer screen?

View 3 Replies View Related

Android :: Create Directory Or File Into Data / Local Directory?

Aug 5, 2010

I want to download my apk file into "/data/local/" directory. I am able do this in external storage but unable on "/data/local" also i was trying to create folder on same location but could not do that. Through "adb push" it is possible but i need to do this java program.

View 2 Replies View Related

Android :: Create Sub Directory In Asset Directory On Run Time In Android

Oct 6, 2010

how to create a sub folder in asset folder at run time and copying the files from res folder to my assets sub folder.

View 1 Replies View Related

Android : How To Get Album Art From MediaStore?

Feb 16, 2010

How can I get the album art from MediaStore?

View 1 Replies View Related

Android : Getting ID Of An Image In MediaStore?

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

Android : How To Force MediaStore To Rescan SD Card

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

Android : Construct MediaStore Uri For Specific Folder

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

Android : MediaStore Setting Photo Name To NULL

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

Android : Get Back Image Taken After Intent MediaStore?

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

Android : MediaStore.Extra_Output - Result In A File Containing Picture?

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

Android : Mediastore Thumbnails Not Generated Until Gallery App Is Launched?

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

Android : Find Orientation Of A Picture Taken With Intent MediaStore?

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

Android :: Small Picture Retrieved From Camera Although Specified MediaStore.EXTRA_OUTPUT In 2.X

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

Android : Advice Needed For Manipulating Mediastore For All Music Files?

Aug 3, 2010

I'm rather new to android programming and right now I'm playing with the media store for a personal test project. I've run into a couple double-edge problems..

I need to query the mediastore for a list of all music files, simple enough - but i need to restrict the results to certain folders only. I accomplished this (rather easily) using the SQL-*LIKE- where clauses and all's well on this aspect.
I now need a unique (if this were actually using SQL, I could simply use the DISTINCT modifier and be done with this) list of all artists. Now this is based off the songs in a given path. Therefore I cannot filter the list returned from querying the URI:MediaStore.Audio.Artists.EXTERNAL_CONTENT_URI, and adding in where clauses based off the file path as I did in the first step.

So, what this leaves me with is using my initial query and getting a cursor back then stripping the dupes from the cursor (which is where i am now - too slow, especially with 1000+ songs) - based on a query of artists instead of songs, obviously.

Is is possible to override the actual query that fills the cursor, maybe? As in: override the query and filter how the data is initially put into the cursor (remove recursive entries) and return the proper cursor immediately? Content providers and how they were never built with a distinct function is beyond me, but whatever. Is the returned cursor from a URI query command filled in a manner that can be overridden or not? That's what I'm unclear of at the moment on this. I would like to be able to wrap the getContentResolver().query(xxx..)) command directly to remove the entries on cursor fill, if possible - i do async queries and using a single query statement (well, one for the artist query) would be great.

My other alternative thought is to just preload the data and manipulate my view's data by creating a new cursor based off the preloaded dataset (cursor) - which may be the way to go, and if so - would a cursor be the best way to store this data? Also worried about ram with larger libraries.

Maybe there's simply a way to do a DISTINCT query on the URI - I just do not know. I've seen this question (or the ilk there-of) asked many times with no good answers that were meant for a URI as opposed to a SQL back-end.

View 1 Replies View Related

Android :: Load Images In OpenGL Without Having Thin Outline Appear Around Images?

Nov 2, 2009

I'm basically using the same method of loading bitmaps in OpenGL that the SpriteMethodTest example uses and have been unable to get rid of an annoying outline that appears around all of my images.

For example, If I were to load an image of a white circle on a white background, I would expect to see nothing. Instead, I would see my circle because its edge would be gray. In SpriteMethodTest, I replaced the background image with white and was able to see that the edges of the android images flying around also don't seem to be rendered correctly.

Does anyone know how to load images in OpenGL without having a thin outline appear around the images?

View 4 Replies View Related

Android :: Full Size Image Back From Camera Using MediaStore.IMAGE_CAPTURE?

Jan 8, 2010

I managed to figure out how to get the camara application to give me an image, but it is rather tiny, only 18k. Has anyone figured out a reliable way to get a full-sized image returned if you are using a MediaStore.IMAGE_CAPTURE intent?

View 2 Replies View Related

Android : Reading File Of Provider.MediaStore.Im­ages.Media.INTERNAL_CONTENT_UR­I

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

Android :: Adding Some Nine Patch Images Breaks All Of My Other Images

Apr 6, 2010

I'm working to convert some background images to nine patch so they scale better on different phones.
The problem is that if I have the following resource structure: drawable-hdpi/background.png drawable-hdpi/button.png drawable-mdpi/background.png drawable-mdpi/button.png drawable-ldpi/background.png drawable-ldpi/button.png and then I drop a new drawable-hdpi/background.9.png file into the mix, it breaks button.png during the pre-compile. The error is "No resource found that matches the given name (at 'background' with value '@drawable/button').Simply removing that one nine patch file fixes the build. Should I be able to have some nine patch images and some normal ones, or to have nine patch only in hdpi but not mdpi or ldpi? This is Eclipse 3.5.1 with the latest ADT.

View 3 Replies View Related

Android :: Save Data From Camera To Disk Using MediaStore On Android?

Mar 16, 2009

I'd been using my own Camera class for taking images and my own database but soon enough I couldn't really keep up with changes and I decided to use the built in camera application in Android to do the job, but I can't seem to get it to save file. What am I missing here? The application seems to save the file but it's just 0 bytes. I looked up the source code of the Camera application and it's looking for the "output" in Extras to save the file.

Public class CameraTest extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);...............

View 5 Replies View Related

Android :: Returning Value From TabActivity

Oct 1, 2009

How can I return a value from TabActivity? It seems that the return value from tab pages vanishes and the caller always receives RESULT_CANCELED instead of RESULT_OK.

View 3 Replies View Related

Motorola Droid X :: Does Google Images Let You Select Images?

Jul 18, 2010

Just curious how many have this issue.If you are unsure select the link below and find out pls.

View 30 Replies View Related

Android :: Add New Image To Android MediaStore InsertVideo Function?

Jan 22, 2010

So our app has the option to take either a picture or a video. If the user takes a picture, we can use the MediaStore.Images.Media.insertImage function to add the new image (via a filepath) to the phone's gallery and generate a content:// style URI. Is there a similar process for a captured video, given that we only have it's filepath?

View 3 Replies View Related

Android :: Geocoder Not Returning Result

May 8, 2009

My application that uses geocoding was working fine till last week and now all of a sudden am not getting proper data from the same.

I used getLocality() , which was returning CITY name previously. But now it is returning NULL.

Is something changed? or Has someone faced the same issue?

My application is on SDK 1.0

View 12 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved