Using Camera in Android Application

Posted by Unknown Rabu, 01 Agustus 2012 0 komentar

The picture speaks more then your words. The picture is the key ingredient for a application interacting with physical world.


Android provides the very easy interface with the existing camera application to quickly integrate the camera function to your application. You can take picture and easily access the image data in your application with very few line of code in android.


This post is explaining the quick integration of the existing camera application with your own android application.


To capture the photo from existing camera application you can use the following line of code.


private void dispatchTakePictureIntent(int actionCode) {
Intent PictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult
(PictureIntent, actionCode);
}


To get the photo in your application you simple need to implement onActivityResult() method which. The image data bundled in the extras as a bitmap and return to the caller in onActivityResult method.


private void onActivityResult(Intent intent) {
Bundle extras = intent.getExtras();
Bitmap mImageBitmap
= (Bitmap) extras.get("data");

}

Now you can play with this bitmap data in your application.


Thanks
Creative Android Apps

TERIMA KASIH ATAS KUNJUNGAN SAUDARA
Judul: Using Camera in Android Application
Ditulis oleh Unknown
Rating Blog 5 dari 5
Semoga artikel ini bermanfaat bagi saudara. Jika ingin mengutip, baik itu sebagian atau keseluruhan dari isi artikel ini harap menyertakan link dofollow ke http://apk-xda.blogspot.com/2012/08/using-camera-in-android-application.html. Terima kasih sudah singgah membaca artikel ini.

0 komentar:

Posting Komentar

Trik SEO Terbaru support Online Shop Baju Wanita - Original design by Bamz | Copyright of apk xda.