What's the best way to shoot bursts on Android?

I have read a lot of posts here to take bursts of shots for example. from here , here and I am taking batch shots with a maximum camera size of about 1 per second,

The problem is this: I cannot find a better solution to accept the bursts. I know ppl can take 15 to 30 frames per second as mentioned in many apps on Google Play. But what strategies are they using? For api 19-20 coz, I heard they popped up in new api 21, but I don't want to look at this at the moment. I just want to learn the best splash techniques.

I am currently not using any asyncTask, handler class, or loop. I just use the picture callback and put my loop inside like this snippet.

PictureCallback jpegCallback = new Camera.PictureCallback() {
        public void onPictureTaken(byte[] bytes, Camera camera) {
            onPictureJpeg(bytes, camera);


            try{

                _selectedCamera.startPreview();
                stillCount++;
                if(stillCount < 50 ){



                     _selectedCamera.takePicture(shutterCallback, rawCallback, jpegCallback); 
                    picCount.setText("PICTURES: " + stillCount);
                    picCount.setTextColor(Color.WHITE);

                }else {
                    stillCount = 0;

                    Thread.sleep(2000);
                    picCount.setText(" ");
                }

            } catch(Exception e){
                Log.d(LOG_TAG, "Error Starting Preview: " + e.getMessage());
            }

        }
    };

      

Let me know what other ways are possible and which one is good.

PS I am trying to assign GPS coordinates for each snapshot, I take coordinates using requestLocationUpdates, LocationListener, and I have a program that starts GPS, takes snapshots all the time and keeps adding coordinates using ExifInterface. Also let me know what good practices are to assign gps coordinates to the picture, I see the results, but I know they are not set up correctly, I can show more details if anyone wants to answer. Thank.

+3


source to share





All Articles