Android : Way To Turn Byte Array From Camera's OnPreviewFrame Into A Picture?

Jul 23, 2010

I ask if there is a simple way because there is a google issue report saying that using decodeByteArray isn't possible. But that report originated in 2008 and I was hoping there was a solution not posted on there. The method listed on the issue report was to decode the format yourself, but I'd prefer to not have to put that in and slow down the program.

Android : Way to turn byte array from camera's onPreviewFrame into a picture?


Android :: Converting Byte Rgb_565 Array Into Argb Or Rgb Array

Jan 12, 2010

I have Picture data in byte rgb_565 array, and I want convert it in a productive way into argb array. Right now I have found only one (little slow) way to do this: Bitmap mPhotoPicture = BitmapFactory.decodeByteArray(imageData, 0 , imageData.length);

where imageData is my byte[] array in rgb_565, and then: int pixels[] = new int[CameraView.PICTURE_HEIGHT*CameraView.PICTURE_WIDTH]; mPhotoPicture.getPixels(pixels, 0,PICTURE_WIDTH, 0, 0, PICTURE_WIDTH, PICTURE_HEIGHT);

The point is I believe creating a Bitmap object is exacting and not necessary in this case. Is there any other faster way to convert rgb_565 array into argb array? I need this because making image processing on rgb_565 array seems to be a little annoying. Or maybe it is not so hard?

View 1 Replies View Related

Android :: Converting Short Array To Byte Array

Feb 16, 2010

I am trying to make an application that would be able to send the user's voice over the network using RTP. I am using the ported stack from hsc (JLIBRTP) and I am able to record user's voice in a saperate thread. the problem is that jlibrtp uses has a class named RTPSession that is responsible for the session and has the sendData method that takes a byte [] as argument and the AudioFormat class I am using to record user's voice is in AudioFormat.ENCODING_PCM_16BIT wich is short. I have tried using 8bit audioformat but I get an illigalargument exception in my htc magic and in my emulator. So is there any way I can convert the short [] to byte [] ? would that be acceptable in order of voice quality?, is the above error a known bug for htc magic or the platform doesn't support 8bit audio format?

View 3 Replies View Related

Android :: Camera Callback OnPreviewFrame?

Nov 10, 2010

I am working on an application in Android and I have to manipulate the data coming from the preview.

I read that the default frame rate is 15fps. I measured the time from one call of the onPreviewFrame function and the next one and I noticed that I got different times depending on the size of the preview (at the moment no other operations are done in this function). How can it be possible? I thought it would be called at any frame so 15 times in a second (approximately every 66ms) independently of the previewFrameSize.

View 2 Replies View Related

Android :: Get A Byte Array From Drawable Resource?

May 13, 2010

I would like to get a byte array from an jpeg image located in my res/drawable file?

View 3 Replies View Related

Android : How To Convert Byte Array In Bitmap?

Mar 19, 2009

I want to store image in sqlite database. I tried to store it using BLOB and String, in both cases it store the image and can retrieve it but when i convert it to Bitmap using BitmapFactory.decodeByteArray(...) it return null. Below is my code please have a look and suggest me where i m making mistake.

View 3 Replies View Related

Android : How To Convert Bitmap To Byte Array?

Aug 12, 2010

Does anyone know how to convert a bitmap to a byte array?

View 2 Replies View Related

Android : How To Display RGB 565 Byte Array On Screen?

Apr 27, 2009

Can please anyone let me know how to display a raw RGB 565 byte array on the screen.

View 2 Replies View Related

Android : Way To Create Byte Array From Bitmap?

Jul 20, 2009

Is it possible to create a byte array from bitmap?How can I do so?

View 3 Replies View Related

Android : How Convert Bitmap To Byte Array?

May 29, 2009

I want to store pictures from the internet in my data base as byte arrays. I get the pictures as bitmaps, but can't find way to convert it to byte array.

View 4 Replies View Related

Android :: Converting Base64 Byte Array To String

Feb 16, 2009

Im trying to convert a byte array which is in Base64 format to String as below. Data was not assigned properly to the String. Do I need to pass the encoding type while creating the new String?

View 3 Replies View Related

Android :: StreamCorruptedException While Sending Image As Byte Array Over Bluetooth

Aug 1, 2010

I try to send an image over bluetooth to another device. This works mostly fine, but sometimes, I get a StreamCorruptedException: Wrong format: 0x27 on the receiving device. Anybody knows what this means? And how can I avoid that?

View 1 Replies View Related

Android : How To Convert Byte Array To String / Vice Versa?

Oct 8, 2009

I have to convert a byte array to string in Android, but my byte array contains negative values. If I convert that string again to byte array, values I am getting are different from original byte array values. What can I do to get proper conversion?

View 7 Replies View Related

Get Contents Of Textbox As Byte Array?

Feb 2, 2012

I'm using the following code to encrypt a String (inText) whose output is a byte array named cipherText;

Code:
byte[] cipherText;
cipherText=cipher.doFinal(inText.getBytes());
The cipherText is printed in a textbox as follows:

Code:
encText.setText(new String(cipherText));

Everything works fine until here. However, in the decryption section, I need to get the contents of the textbox as a byte array again. For this purpose, I use the following code:

Code:
byte[] cText;
cText=encText.getText().toString().getBytes();

When I try to do the encryption it gives a 'bad size' error. I found out that the lenghts of the two byte arrays cipherText and cText aren't equal:

Code:
decText.setText(Integer.toString(cText.length));
encText.setText(Integer.toString(cipherText.length));
boolean res=Arrays.equals(cText, cipherText);
result.setText(Boolean.toString(res));

The 'result' textbox always prints 'false' meaning that the two byte arrays cipherText and cText aren't equal. However I convert cipherText to a String to print in a textbox and then read the contents of that textbox, convert to String back and then to Byte Aray again. Obviously some data is lost during these conversions.

View 1 Replies View Related

Android :: Best Approach To Transfer Large Video Files Into Byte Array?

Apr 8, 2010

Please could anyone suggest an approach for transferring a >2MB video from a ContentResolver into a Bytestream, without running out of memory?
See question: http://stackoverflow.com/questions/2599305/android-outofmemoryerror-w...

Here's the current code, which throws an OutOfMemoryError on the byteBuffer.write(buffer, 0, len) line when transferring large videos:

// get bytestream to upload videoByteArray = getBytesFromFile(cR, fileUriString);
public static byte[] getBytesFromFile(ContentResolver cR, String fileUriString) throws IOException { Uri tempuri = Uri.parse(fileUriString);
InputStream is = cR.openInputStream(tempuri);
byte[] b3 = readBytes(is); is.close(); return b3;
}

View 18 Replies View Related

Android :: Store And Retrieve Byte Array (image Data) To And From SQLite Database?

Nov 16, 2010

How do I store and retrieve a byte array (image data) to and from a SQLite database in Android?

View 1 Replies View Related

Motorola Droid :: How To Turn Off Camera Click Sound When Taking Picture?

Nov 22, 2009

Anyone know how to turn off the sound of when a picture is taken, the snap sound?

View 5 Replies View Related

Motorola Droid : Turn Off Flash / Shutter Sound Of Camera When Taking A Picture?

Nov 9, 2009

Is there a way to turn off the flash and/or the shutter sound of the camera when taking a picture?

Flash Mode says auto under it, but the box is grayed out and I cannot select it to change it.

This is the same for the auto focus feature, I am unable to select that as well.

View 4 Replies View Related

Android :: Failed Binder Transaction When Passing Byte - From Camera - Between Intents

Feb 16, 2010

I have a problem with an app that lets the user take a picture. I've posted it on some forums already, but nobody seems to recognize the problem. Hopefully someone here knows a solution :)

I've put the code of taking a picture in a seperate activity. Then I call the camera intent from my main activity using activityForResult. In the camera intent, I use putExtra to return the camera image (as a byte[] without doing anything to it). But when the program transitions back from the camera intent to the parent intent that called it I get a Failed Binder Transaction error in the logcat because the byte[] is too big. But I don't understand this, because the image is not even taken using the maximum resolution :S

The code of my camera intent is:

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

View 6 Replies View Related

Android : Way To Obtain Bitmap From Data In OnPreviewFrame?

May 16, 2009

I need to capture an image from camera and display on surfaceview for my project. I am trying to obtain bitmap from data in onPreviewFrame method of previewCallback and display on surface using canvas.

View 5 Replies View Related

Android :: Convert Json Array To Normal Java Array

Aug 3, 2010

Is there a way to convert JSON Array to normal Java Array for android ListView data binding?

View 2 Replies View Related

Android :: How To Take Picture Using Camera App?

Oct 26, 2010

How to take a picture using the Camera App and have it NOT appear in the Gallery?

View 7 Replies View Related

Android :: Taking Picture - Use Camera In Sdk 1.6

Sep 19, 2009

I tried an old(er) example / tutorial to capture a picture from the camera. But "android.hardware.CameraDevice;" cannot be resolved. Has the name changed or have somebody a good tutorial for android 1.6 and the camera? If I press a button, I want to open the Camera and make a picture. After that i want to save the picture on a sdcard and go back to my activity.

View 3 Replies View Related

Android :: Watermark The Camera Picture

Aug 30, 2010

How can I add a watermark in the picture (.jpeg)? I have this project in mind where I'd like to have such feature - to take a picture using the camera (already developed this) and then make it watermarked. So basically just take the .jpeg file and then blend it with some .png file that is semi transparent.

View 4 Replies View Related

Android :: Crop A Picture After Using Camera To Take It

Dec 29, 2009

In the following code, I am able to get the photo editor to come up after I take a picture, and am able to crop it. However, the aspectX and aspectY does not seem to be in effect, as the aspect ratio is not locked at all.

What I is that after taking a picture, the crop/editor comes up, with a fixed aspect ratio of 1:1.

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

View 7 Replies View Related

Android :: Navigating An Array - String Array

Oct 12, 2010

I'm new to android developing but right now I'm working on an application that displays Random Facts. Since I don't want it to be in a random order, I would like to have them in a list. I would like to order through them one by one and show them using TextView.

Resources res = getResources();
myString = res.getStringArray(R.array.FactsArray);

That's what I have so far. If I'm right, that just establishes the array so I can be able to use it later. What I had before was rgenerator which chose a random string from the array and displayed it when I clicked a button.

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

But Like I said, I would like to just order through them one by one when a button is clicked.

View 1 Replies View Related

Android :: Convert JSON Array To Array

Jul 27, 2010

Is there a simple way to convert a JsonArray to a standard Java Array? Obviously, you can iterate and do it explicitly, but I wanted to see if there was a direct way to do so.

View 2 Replies View Related

Android :: Taking A Picture With Camera - Without SurfaceView

Oct 28, 2010

Hi Guys! I'm coding a little app, but I don't know what I'm doing wrong. The App does the following: - Launches a Service which listens for an sms, then captures a picture with the cam and sends it to a predefined email adress. (no, i'm not trying to spy somebody out... I'm using the app to get a "3G-Webcam", sort of at least)

The problem: My App works great in the emulator, but as soon as I try it on my HTC Magic (cm6, android 2.2) it stops working.

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

The permissions are all set, even the write to SD-card. What am I missing?

Note: I'm not using a surfaceview. Code:

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

View 2 Replies View Related

Android :: Image Processing On Picture Taken From Camera

Jan 11, 2010

I'm writing an application for Android. I need to make some image processing on the picture taken from camera.I use Camera.PictureCallback to get the photo, and I get picture in byte array.The problem is I want to make operations on every pixel of photo (some filtering and other stuff) so I guess, have photo in byte array is not a bad idea. But I don't know how interpret information in this byte array... The only way I know to make the processing is use BitmapFactory.decodeByteArray() and then use Bitmap object. Is this a good way to handle a lot of image processing?

View 1 Replies View Related

Android :: Way To Put Picture Directly In Camera Folder?

Mar 29, 2009

I'm trying for my app to create a picture this way... It works fine, except when doing this, the picture is written in the "Camera" folder (/sdcard/dcim/Camera). Since the picture was not taken with the camera, this is not desirable. Is there any way to put it directly in dcim?

View 3 Replies View Related







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