Android :: Managing Media Using The Android MediaStore

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.

Android :: Managing media using the Android MediaStore


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

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

View 9 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 :: Managing Contacts

Aug 6, 2010

I am a long time Palm OS user who is just getting started with Android. I have a gmail account and I haven't paid much attention to managing contacts there. I chose to try importing my contacts from Gmail to the Android, and I got a huge list of 5000 people, basically everyone who has ever sent me an email over the last 7 years (and none of them have phone numbers).

View 1 Replies View Related

Android :: Managing The New Calendar App

Sep 3, 2010

With 2.2, the old Calendar and Corporate Calendar have been merged into one. A slight problem for me is that I preferred keeping the two separate. I don't use the Google Calendar much myself, but I share calendars with bandmates so I can see their schedules for booking purposes. Now, when looking at my calendar to see my own work and social schedules, I have to wade through everyone else's scheduled events. I wouldn't mind continued access to others' schedules, but is there an easy way to separate my Google and Outlook calendars, and/or choose whose Google calendar events appear in my Droid calendar? Ideally there would be an easily accessible switch in the menu for whose calendar items I see. Lacking that, is there a way to turn others event on/off from my phone?

View 1 Replies View Related

Android :: Managing Wimax

Oct 19, 2010

You can manage wifi connectivity, and you can kind of manage 3G, but what about 4G, more specifically WiMAX? I saw an API on ClearWire's website, but I am not sure if Google is planning to include WiMAX as part of the SDK. Does anyone have an insight? I am looking for connect/disconnect functionality, failover connection settings, etc.

View 1 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 :: Managing Background Uploads

Oct 21, 2009

In our app we're doing background photo uploads. The current implementation works using a combination of a Service and an AsyncTask. The former will trigger the latter, which will do the actual network I/O.

My question is: since the user can trigger many uploads in parallel, is this the correct implementation pattern? The problem is that I can never call Service.stopSelf() from an upload task when it finishes, because those tasks don't know anything about each other or the service that triggered them (because of the very nature of AsyncTask).

Do I even need a Service here at all? I always thought services were meant for long running background tasks, but their documentation clearly states that one must execute blocking operations in a separate thread. What's the purpose of Services then? You could just fork an AsyncTask from an Activity, it would make no difference at all.

View 3 Replies View Related

Android :: Managing Activities From Service

Jun 1, 2010

I have a service that listens to the serial port. According to data received from serial i switch between particular service states, and start particular activities on state transitions. I would like to accomplish it in following way: Let's assume there is one active Activity1 started from previous state, I call startActivity from service to start a new one Activity2, but I want to simulatenously destroy Activity1 when Activity2 gets on top of the stack. I tried to call finish() in Activity1.onStop but it seems not to work (Activity1.onDestroy() doesn't get called). I'd prefer to finish Activity1 after Activity2 gets on top in order to avoid blinking.

View 5 Replies View Related

Android :: Managing Google ApiKeys

Apr 9, 2010

I have a simple app that uses a Google MapView. Now in the layout file for my map activity, I created an apiKey for the debug keystore and use that. However when I want to deploy my app, I need a seperate apiKey for production (based on when I sign my application), correct?

What I'm wondering is how do people manage these two apiKeys. When developing I want to use the emulator and the debug apiKey, but when I'm deploying / doing some integration testing with my phone, I want to use the production apiKey. To me, it seems that I need to remember before compiling for production, to swap out the apiKeys in my layout file. A very error prone process given my bad memory.

View 13 Replies View Related

Android :: Managing A Suite Of Applications

May 25, 2010

I'm building a suite of applications, meaning that I have a single set of code that gets customized via a single change of an API key. This means that all of the applications have the same activities, same behaviors, but different icons, package names, and application names depending on the client I am building for.

Unfortunately, I haven't figured out a clean way to do this. Because the package name is what the Android Marketplace uses, I've been changing it to com.nilobject.productname.clientname. However, this changes the package for all of the activities to no longer be in the package of the application, since they live in "com.nilobject.productname." Additionally, the autogenerated "R" moves, so all of the references to R in com.nilobject.productname break.

I'm using Eclipse for development. Should I just refactor the activities with each build to be in the same package? Is there a system for this that I don't know about?

View 4 Replies View Related

Android :: Managing Large Graphic Set

Sep 14, 2009

I'm writing a game for a computer class that I'm currently taking for school. The game has a lot of graphics associated with it (mostly in .png format). There is too much data to simply include it as part of the 'res'. The way i'm currently doing it, is to store all of the graphics in a single zip file, in a folder on the SDCard, e.g., / sdcard/Game/PlayerImages.zip (or whatever). And then i'm using the ZipInputStream to read from those, then using the BitmapFactory to decode the stream and then draw them on the canvas. The problem that I'm having is that this method is terribly slow if I add a lot of images into the zip file. The best way I have found thus far is to name the .png files within the zip numerically, then use a for-loop to jump directly to a specific file, but this is still a very slow way of doing it. I would like to use a single file (like zip) to hold all of the files for several reasons. 1., i'm trying to use a file container so i can simply update graphic 4.png and then push it into the zip file (for example) from a server. 2., because android sees all image files on the sdcard when you open the gallery application. 3., easier to prevent data manipulation by doing an md5/sha-1 checksum on 1 zip file, rather than every time a file is opened if it weren't in a container.

View 6 Replies View Related

Android :: Managing Views Programmatically

Mar 31, 2009

I would like to dynamically build a view that would display a certain number of 'rows'. Here is a piece of code I wrote, but it is not working:

CODE:..............

View 2 Replies View Related

Android :: Managing Multiple Notifications

Aug 12, 2010

I am trying to create multiple notifications in my application. To identify each notification uniquely, i have given them an unique identificationId.

Problem: When a notification is selected, Tabs activity is called passing the intent. I want to access the unique notificationId of the notification that was selected in Tabs. I tried intent.putExtra() to save the notificationId in the intent. But, for multiple notifications its overwriting the notificationId and returns the latest one. I dont understand as to why this is happening and how can i avoid this overwriting of notificationId.

View 2 Replies View Related

Android :: Managing Translations Updates

Nov 22, 2009

How would one manage continuous updates to translations? I.e., when releasing a new version, you wouldn't want your translators having to manually copy and paste existing translations from the previous versions, or worse, re-translate everything. Even when for those languages that I translate myself I noticed that when introducing a new string, I basically need to update all the language-specific resources right away, or I will have trouble later on trying to come up with a list of everything that changed.

I'm familiar with gettext, where this problem is solved by basically being able to merge the diff between Original-V1 and Original-V2 into Translation V1.

View 2 Replies View Related







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