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
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
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
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
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
Sep 8, 2012
First there is this:
Code:
File wave1 = new File(wavFile1);
if(!wave1.exists())
throw new Exception(wave1.getPath() + " - File Not Found");
[Code]...
but android dosen't support java.sound.sampled
there is also this:
Code:
private void merge2WavFiles(String wavFile1, String wavFile2, String newWavFilePath) {
long RECORDER_SAMPLERATE = 44100;
long RECORDER_BPP = 16;
[Code]...
but is also dosen't work.
In all cases the result sound file is empty without sound.
How can I merge two *.wav files?
View 1 Replies
View Related
Mar 16, 2010
I'm trying to use a standard Intent that will take a picture, then allow approval or retake. Then I want to save the picture into a file.
View 2 Replies
View Related
Apr 23, 2010
I am still not able to save a picture when I send an intent asking for a photo to be taken. Here's what I am doing:
Make a URI representing the pathname
android.content.Context c = getApplicationContext();
String fname = c.getFilesDir().getAbsolutePath()+"/parked.jpg";
java.io.File file = new java.io.File( fname );
Uri fileUri = Uri.fromFile(file);
Create the Intent (don't forget the pkg name!) and start the activity
private static int TAKE_PICTURE = 22;
Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE );
intent.putExtra("com.droidstogo.boom1." + MediaStore.EXTRA_OUTPUT, fileUri);
startActivityForResult( intent, TAKE_PICTURE );
The camera activity starts, and I can take a picture, and approve it.
My onActivityResult() then gets called. But my file doesn't get written.
The URI is: file:///data/data/com.droidstogo.boom1/files/parked.jpg
I can create thumbnail OK (by not putting the extra into the Intent), and can write that file OK, and later read it back).
View 5 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
Sep 16, 2012
I just purchased the Razr Maxx and am having trouble finding the original file of the picture. For instance, I would find an image in my gallary that is 1.41MB, but when I go under My Files, the closest I can find is the same image under DCIM>.thumbnails at 28k. Where would I find the 1.41MB image on my phone?
View 3 Replies
View Related
Sep 28, 2013
Is there a way to see the file names of the pictures on my Motorola Droid Razr phone? I can see them when I connect to my PC and use Windows Explorer but I only see the pictures on the phone.
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
Mar 20, 2010
I am new to this phone and so far so good.Working things out and getting it set up like I want it. I have two photograph widgets on one of my screens, one set up for newly taken pictures and one set up for newly shot video. The only problem is, I don't know how to change the default video save location. I am using the astro file manager and have seen that all videos and pictures save into a file named DCIM on my SD card. How do I change this to make it save pictures and videos into different files?I have made a different file for my videos and manually moved them into the folder but the phone is still saving new videos to the same old default place.
View 4 Replies
View Related
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
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
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
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
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
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
Nov 9, 2010
Looking for an app where I can take a pic (got the droid x 8MP camera) and want to take pic of a text document and have it convert the text to a text file?
View 3 Replies
View Related
Aug 5, 2010
When user presses a button from a webview, I open a scrollview activity with some buttons and edittext fields.
Once the user enters the fields and presses the 'create' button, from scrollview activity, I want the results from the called activity to be accessible. How can I do thi?
View 1 Replies
View Related
Feb 14, 2009
We can convert from Intent to URI and from URI to Intent. From Intent to URI string Intent intent1 = new Intent ();
String uriString = intent1.toURI ();
From URI string to Intent Uri uri = Uri.parse (uriString);
Intent intent2 = new Intent ();
intent2.setData (uri)
After conversion, intent1 and inten2 should be same. for example:
Intent intent1 = new Intent ();
intent1.addCategory (Intent.CATEGORY_HOME);
intent1.addCategory (Intent.CATEGORY_LAUNCHER);
Log.v ("", "Intent1 = " + intent1);
if (intent1.hasCategory (Intent.CATEGORY_HOME))
Log.v ("Intent1", "#1 hasCategory TRUE");
else Log.v ("Intent1", "#1 hasCategory FALSE");
String str = intent1.toURI ();
Uri uri = Uri.parse (str);
Intent intent2 = new Intent ();
intent2.setData (uri);
Log.v ("", "Intent2 = " + intent2);
if (intent2.hasCategory (Intent.CATEGORY_HOME))
Log.v ("Intent2", "#2 hasCategory TRUE");
else Log.v ("Intent2", "#2 hasCategory FALSE");
result Intent1 = { categories=android.intent.category.HOME,android.intent.category.LAUNCHER} } #1 hasCategory TRUE
Intent2 {data=#Intent;
category=android.intent.category.HOME;
category=android.intent.category.LAUNCHER;
end } #2 hasCategory FALSE
In this sample code, Intent2 is a conversion result from Intent1. If you run this sample code, Intent1 result and Intent2 result are different. Because Intent1 and Intent2 have a same Intent.CATEGORY_HOEM, the result should be Intent1 and Intent2 is TRUE (intent.hasCategory). I think this is bug. And the hint is Intent1 and Intent2 's toString result is different.
Intent1 = {categories=android.intent.category.HOME,android.intent.category.LAUNCHER}
Intent2 = { data=#Intent;category=android.intent.category.HOME
category= android.intent.category.LAUNCHER;end }
I don't know how to convert Intent to URI(String) and convert URI (String) to Intent. I want to save Intent to DB and read Intent from DB.
View 3 Replies
View Related
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
Jan 21, 2010
According to my research, which includes reputable sources (Mark Murphy et al), the most preferred way of polling a remote source and presenting said data to the user is by creating a service and using AsyncTask within that service to do the polling. I have done that.But, when I read the docs there seem to be several "Threading Rules" that conflict with this way of doing things: "The task instance must be created on the UI thread." and "execute(Params...) must be invoked on the UI thread." As stated, I have created the task instance on the Service thread (not the UI thread). Am I missing something? Also, when the AsyncTask finished, I sent out a Broadcast on onPostExecute, which is then picked up by the Activity, telling it to retrieve the final value again from the service (since I couldn't obviously update the UI from the service). I couldn't figure out any other way to return the result of the AsyncTask. Is this the correct practice?
View 8 Replies
View Related
Mar 22, 2010
Here is what I got while running a test case of open core . *************** # pvplayer_ engine _test -test 1 1 SDK Labeled: PVDEV_ CORE_RELEASE_6.506.4.1 built on 20090312 Test Program for pvPlayer engine class. Input file name 'test.mp4' Test case range 1 to 1 Compressed output Video(No) Audio(No)Log level 8; Log node 0 Log Text 0 Log Mem 0 Starting Test 1: Open-Play-Stop-Reset Results for Test Case 1: Successes 1, Failures 1 Total Execution time for file test.mp4 is : 2.712000 seconds# *************** I want to ask why it shows 1 success and 1 failure . there should be only 1 pass or 1 fail only . Do each test case have multiple sub-tests within them ? which class in source code finally decide whether it is pass or faiL?
View 2 Replies
View Related
Sep 24, 2010
I create a table like that
CODE:...........
I update it this way
CODE:..........
I do see the change in eclipse with DDMS questoid
But when i try to retrieve the value I get nothing ....
CODE:.........
I've tried some variant like
CODE:............
With no success
Is this problem come from the type (integer) of my column ?
View 1 Replies
View Related