have to make an android project that starts the camera and displays the 
live feed on surfaceview. the display should appear when i run the app and 
on fullscreen. am new to android and running the camera sounds like a good 
start. i have written something on the activity file but the entire code 
will be most helpful.

activity.java

package com.example.uttaran.camera5;

import android.content.Context;
import android.hardware.camera2.*;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.SurfaceHolder;
import android.view.SurfaceView;

public class MainActivity extends AppCompatActivity {

    private CameraDevice camera;
    private CameraDevice.StateCallback callback;
    private Handler handler;
    private SurfaceView surfaceView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    public class cameraManager extends Object {
        CameraManager manager = (CameraManager) 
getSystemService(Context.CAMERA_SERVICE);
    }

    public abstract class cameraDevice extends Object implements 
AutoCloseable{

    }

    class LooperThread extends Thread {

        public void run() {
            Looper.prepare();

            handler = new Handler() {
                public void handleMessage(Message msg) {
                    // process incoming messages here
                }
            };

            Looper.loop();
        }
    }

    String cameraList[] = String[] getCameraIdList();
    String cameraId = cameraList[0];

    openCamera(cameraId, callback, handler);

    onOpened(cameraId){

    }
}

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/05db5597-4447-4e26-91de-be4affc08a7e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to