Right, so I've been at this for the last 10 hours (literally), and I'm kind of at my breaking point.
I'm very new to android dev, but I kind of know the basics from reading. This is my first app, but unfortunately, I'm on a very truncated time table with it.
Anyway, I'm trying to use the camera to capture a photograph in raw data (I need it raw as I need to modify particular pixels).
All day, and 1001 tutorials later, I'm screwing with the concept of anonymous SurfaceHolder.Callback object (implementing surface changed, surface created, and surface destroyed). Then like within the last 30 minutes I find out I can substitute the SurfaceView (in the XML layout) with an ImageView, and make an intent to take a picture, launch the camera, and get the data results back into the imageview in the previous activity - total of like 5 lines.
So what's what? Why are so many tutorials focused on this SurfaceView/SurfaceHolder.Callback concept, when it only takes 5 lines to implement the camera activity..I thought that was the whole purpose of intents, no?
So do I pursue the SurfaceHolder.Callback method? (that method was failing me because when I do camera.startPreview(); it hangs, then I get "Camera ERROR 0" in LogCat), Or do I go with this image view methodology?
Requirements I need to meet:
- The picture I put in the image view is highly pixelated, even for a thumbnail, if I use these two lines:
- Code: Select all
Bitmap thumbNail = (Bitmap)data.getExtras().get("data");
... Is the data all in that thumbnail, and the thumbnail quality just scaled down? Or did that data get lost? If it's lost, I can't have that, I need all picture data.
- Is there a way to modify that data returned from the camera activity at the pixel level (ie. a RAW encoding)?
- SurfaceHolder.Callback vs ImageView (which approach?)
- I need a full quality thumbnail at some point after I tweak some pixels, but I can't care less if it previews it live or not, I can just as easily get it from the camera activity if possible
- This needs to be (I rather have it) compatible with SDK 3 (1.5) (I have another dev who needs to use his phone and he has a G1 running 1.5)
TIA, I'm pulling my hair out, at wit's end, etc.