Hi Pavel, and thanks for the reply.  I'm happy to share the snippet of
code I have for picture taking, but I have not tried it out yet
because in order to see and use the picture-taking button in my
activity view, I need to get the camera preview in the correct place
first.

I still really need someone to help me on this please!! :)

Here is the code I was looking at trying, but I've done extensive
research on the subject trying to fix my placement of the camera
preview, so here are also some links that may help you with taking the
picture and storing it properly: (HTH!)

http://www.devx.com/SpecialReports/Article/37721/1763?supportItem=5

http://www.devx.com/SpecialReports/Article/37721/1763?

http://www.anddev.org/viewtopic.php?p=704#704

http://www.androidph.com/2008/11/camera-capture.html

http://www.devx.com/SpecialReports/Article/37721/1954

http://www.cs.trincoll.edu/hfoss/wiki/Using_the_Android_camera

Code:
public class ImageCaptureCallback implements PictureCallback  {

            private OutputStream filoutputStream;
            public ImageCaptureCallback(OutputStream filoutputStream) {
                this.filoutputStream = filoutputStream;
            }
            @Override
            public void onPictureTaken(byte[] data, Camera camera) {
                try {
                        Log.v(getClass().getSimpleName(), "onPictureTaken=" + 
data + "
length = " + data.length);
                        filoutputStream.write(data);
                        filoutputStream.flush();
                        filoutputStream.close();
                        } catch(Exception ex) {
                                ex.printStackTrace();
                        }
                }
            }
}


On Aug 28, 1:02 am, Pavel <pavli...@gmail.com> wrote:
> Hey tinyang,
>
> Could you please share the code you use for picture taking? I am
> working on the same thing and having weird issues with it - it does
> not take full sized pictures for unknown reason...
>
> And yeah, sorry, no answer to your question from my side at the moment.
>
> Pavlo
>
> On Thu, Aug 27, 2009 at 9:14 PM, tinyang<gnay...@gmail.com> wrote:
>
> > Hello.
>
> > I just got my camera preview working for my app, but it is not
> > appearing
> > where I want it to appear, and I'm not sure how to get it there.
> > Instead of
> > using the entire screen for the preview, I would like to put it inside
> > a
> > surfaceview in an activity xml gui.  What do I need to change?  Here
> > is my
> > code:
>
> > public class TakePic extends Activity {
>
> > SurfaceView camSurface;
>
> > Preview camPreview;
>
> > @Override
>
> > protected void onCreate(Bundle savedInstanceState) {
>
> > super.onCreate(savedInstanceState);
>
> > requestWindowFeature(Window.FEATURE_NO_TITLE);//hide window title
>
> > camPreview = new Preview(this); //create preview
>
> > setContentView(R.layout.takepic);
>
> > setContentView(camPreview); //set preview as activity content
>
> > camSurface = (SurfaceView) findViewById(R.id.camsurface);
>
> > }
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to