¾ÛÅøÁî
46.¢½.168.138
46.¢½.168.129
46.¢½.168.161
46.¢½.168.136
46.¢½.168.145
46.¢½.168.162
46.¢½.168.144
46.¢½.168.140
115.¢½.135.198
46.¢½.168.139
 
°Ô½Ã¹° 17°Ç
 
¾Èµå·ÎÀ̵å ÆùÀÇ ±âº» Ä«¸Þ¶ó ¾ÛÀ» ÀÌ¿ëÇÑ »çÁø ÃÔ¿µ (Intent)
±Û¾´ÀÌ : ÀÌ°æ¿ë                   ³¯Â¥ : 2015-06-09 (È­) 08:21 Á¶È¸ : 4343
camera.zip (5.4M), Down : 0, 2015-06-09 08:21:17




´Ü¸»¿¡ ÀÖ´Â Ä«¸Þ¶ó ¾ÛÀ» ¶ç¿öÁÖ´Â ¹æ¹ý
¾Û¿¡¼­ »ó´çÈ÷ ¸¹ÀÌ »ç¿ëÇÏ´Â ±â´É
ÀÎÅÙÆ®¸¦ »ç¿ëÇÏ´Â ¹æ¹ýÀ¸·Î ¾Èµå·ÎÀ̵å ÆùÀÇ ±âº» Ä«¸Þ¶ó ¾ÛÀ» ÀÌ¿ëÇؼ­
ÃÔ¿µÇÑ °á°ú¸¦ °¡Á®¿À´Â ¹æ¹ý°ú Á÷Á¢ ÃÔ¿µÇÏ´Â ±â´ÉÀ» ¸¸µå´Â ¹æ¹ýÀÌ ÀÖ´Ù.

* Á÷Á¢ ÃÔ¿µ ±â´ÉÀ» ±¸ÇöÇÒ¶©, Ä«¸Þ¶ó ¹Ì¸®º¸±â¸¦ À§Çؼ­´Â ¿µ»óÀ» ½Ç½Ã°£À¸·Î º¸¿©ÁÖ±â À§Çؼ­´Â ¼º´ÉÀÌ Áß¿äÇؼ­ Çϵå¿þ¾î °¡¼Ó ±â´ÉÀ» »ç¿ëÇÒ ¼ö Àִ ¼­Çǽººä(SurfaceView)¸¦ »ç¿ëÇÑ´Ù.

¾Æ·¡ ¼Ò½º´Â ¾Èµå·ÎÀ̵åÀÇ ±âº» ¾ÛÀ» ÀÌ¿ë(Intent)Çؼ­ ÃÔ¿µÇÏ´Â ¿¹Á¦ ÀÌ´Ù.

1. ·¹À̾ƿô ÆÄÀÏ
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
    android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity">
    <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="New Button"
        android:id="@+id/button"
        android:layout_alignParentTop="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:onClick="onButtonCamera" />
    <ImageView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/imageView"
        android:layout_below="@+id/button"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true" />
</RelativeLayout>


2. ÀÚ¹Ù¼Ò½º
    ImageView imageView;
    File outputFile;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        imageView = (ImageView) findViewById(R.id.imageView);
        File storageDir = Environment.getExternalStorageDirectory();
        outputFile = new File(storageDir, "output.jpg");
    }
    public void onButtonCamera(View v) {
        Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
        intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(outputFile));
        startActivityForResult(intent, 1001);
    }
    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        if(requestCode == 1001) {
            BitmapFactory.Options options = new BitmapFactory.Options();
            options.inSampleSize = 8;
            Bitmap bitmap = BitmapFactory.decodeFile(outputFile.getAbsolutePath(), options);
            imageView.setImageBitmap(bitmap);
        }
    }

3. Æ۹̼Ç
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"></uses-permission>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>
<uses-permission android:name="android.permission.camera" android:required="true"></uses-permission>







 

°Ô½Ã¹° 17°Ç
¹øÈ£ Á¦¸ñ ±Û¾´ÀÌ ³¯Â¥ Á¶È¸
17  ¾Èµå·ÎÀ̵å ÆùÀÇ ±âº» Ä«¸Þ¶ó ¾ÛÀ» ÀÌ¿ëÇÑ »çÁø ÃÔ¿µ (Intent) ÀÌ°æ¿ë 06-09 4344
16  °³¹ßÀÚ ÄܼÖÀÇ ÄÜÅÙÃ÷ µî±Þ¿¡¼­ ÀüüÀÌ¿ë°¡ ¼±Åà ¾ÈµÇ´Â °æ¿ì ÀÌ°æ¿ë 07-23 3499
15  ¾Èµå·ÎÀ̵å 4 4 ŶĹ ¹öÀüÀÌ °³¹ßÀÚ¿¡°Ô ÁÖ´Â ¸Þ½ÃÁö ÁÖÈ£¼º 12-25 4648
14  ¸ð¹ÙÀÏ »çÆĸ®¿¡¼­ ½ºÅ©·Ñ ±¸Çö°ú °ü·ÃµÈ ¹®Á¦ ÇѼ­°æ 12-25 3785
13  ¾Èµå·ÎÀ̵å À¥ºä¸¦ ÅëÇØ ¿ÜºÎ¾îÇ÷Π°øÀ¯Çϱâ Ä«Ä«¿ÀÅå °øÀ¯ ÃÖµ¿ÈÆ 12-25 4896
12  Activity µ¥ÀÌÅÍ °ª ³Ñ±â±â ÀÌ°æ¿ë 09-27 3181
11  ¾Û°³¹ß±âȹ¼­ +13 ÀÌ°æ¿ë 07-02 5138
10  ÀÌŬ¸³½º ÆùÆ® ¼öÁ¤Çϱâ ÀÌ°æ¿ë 06-06 4627
9  ¹é¹öÆ° Ŭ¸¯À¸·Î Á¾·á½Ã ¹°¾îº¸±â Ãß±â +2 ÀÌ°æ¿ë 01-11 5253
8  ¾Èµå·ÎÀ̵å activity ŸÀÌƲ¹Ù Á¦°ÅÇϱâ ÀÌ°æ¿ë 01-11 4909
7  ¾Èµå·ÎÀ̵å À¥ºä (WebView) +5 ÀÌ°æ¿ë 01-10 14769
6  AVD¿¡ apk ÆÄÀÏ ¼³Ä¡Çϱâ +2 ÀÌ°æ¿ë 05-30 5327
5  ¸ÆºÏ¿¡¼­ ¾Èµå·ÎÀÌµå ¼³Á¤ (ÃÊ°£´Ü ¸®½ºÆ®) +2 ÀÌ°æ¿ë 04-13 4417
4  02.¾Èµå·ÎÀ̵å À̺¥Æ® ó¸® ÀÌÇØÇϱâ +6 ÀÌ°æ¿ë 10-28 4741
3  01.¾Èµå·ÎÀ̵å ȯ°æ ¼³Ä¡ (³ª¸¸ ¾Ë¾Æº¸´Â ¸Þ´º¾ó ^^) +12 ÀÌ°æ¿ë 10-26 5047
2  ¾Èµå·ÎÀÌµå °³¹ßÀÇ ½ÃÀÛ ÀÌŬ¸³½º ¼³Ä¡ ¹× ¾Èµå·ÎÀ̵å SDK ¿¬µ¿ °úÁ¤ ¼³¸í +10 ÀÌ°æ¿ë 10-04 5048
1  ¾Èµå·ÎÀÌµå °³¹ßÀÇ ½ÃÀÛ Android SDK ¼³Ä¡ °úÁ¤ ¼³¸í +8 ÀÌ°æ¿ë 10-04 8050
 
 
 
Copyright ¨Ï wwwold.androidstudy.co.kr. All rights reserved.