{"id":44745,"date":"2021-02-16T13:17:09","date_gmt":"2021-02-16T04:17:09","guid":{"rendered":"https:\/\/www.charlezz.com\/?p=44745"},"modified":"2021-02-16T13:17:09","modified_gmt":"2021-02-16T04:17:09","slug":"mediastore%ec%97%90-%ec%9d%b4%eb%af%b8%ec%a7%80-%eb%b9%84%eb%94%94%ec%98%a4-%ec%a7%88%ec%9d%98-%ec%8b%9c%ea%b0%84-%eb%b9%84%ea%b5%90-%ed%85%8c%ec%8a%a4%ed%8a%b8","status":"publish","type":"post","link":"https:\/\/charlezz.com\/?p=44745","title":{"rendered":"MediaStore\uc5d0 \uc774\ubbf8\uc9c0, \ube44\ub514\uc624 \uc9c8\uc758 \uc2dc\uac04 \ube44\uad50 \ud14c\uc2a4\ud2b8"},"content":{"rendered":"<h3><\/h3>\n<h3><a href=\"https:\/\/www.charlezz.com\/wordpress\/wp-content\/uploads\/2021\/02\/www.charlezz.com-mediastore-images.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/www.charlezz.com\/wordpress\/wp-content\/uploads\/2021\/02\/www.charlezz.com-mediastore-images.png\" alt=\"\" width=\"225\" height=\"225\" class=\"aligncenter size-full wp-image-44746\" srcset=\"https:\/\/charlezz.com\/wordpress\/wp-content\/uploads\/2021\/02\/www.charlezz.com-mediastore-images.png 225w, https:\/\/charlezz.com\/wordpress\/wp-content\/uploads\/2021\/02\/www.charlezz.com-mediastore-images-150x150.png 150w\" sizes=\"(max-width: 225px) 100vw, 225px\" \/><\/a>\ubc30\uacbd<\/h3>\n<p>\ub2e4\uc591\ud55c \uc9c8\uc758\ub97c \ud1b5\ud574, \uac00\uc7a5 \ube60\ub978 \uc751\ub2f5\uc2dc\uac04\uc744 \ubcf4\uc774\ub294 \ubc29\ubc95\uc744 \uc54c\uc544\ubcf8\ub2e4.<\/p>\n<h3>\ud14c\uc2a4\ud2b8 \ud658\uacbd<\/h3>\n<p>Galaxy S9, \uc774\ubbf8\uc9c0 80507\uac1c, \ub3d9\uc601\uc0c1 29\uac1c<\/p>\n<h3>\ucffc\ub9ac \ud0c0\uc785<\/h3>\n<p><strong>1\ubc88\ud0c0\uc785 &#8211; \ud30c\uc77c \ucf58\ud150\uce20 Uri\u00a0 + \uc774\ubbf8\uc9c0 \ud0c0\uc785\ub9cc \uac70\ub974\uae30<\/strong><\/p>\n<pre class=\"lang: decode:true\">contentResolver.query(\r\n    MediaStore.Files.getContentUri(\"external\"),\r\n    null,\r\n    MediaStore.Files.FileColumns.MEDIA_TYPE + \" = ?\",\r\n    arrayOf(\"${MediaStore.Files.FileColumns.MEDIA_TYPE_IMAGE}\"),\r\n    null)<\/pre>\n<p><strong>2\ubc88\ud0c0\uc785 &#8211; \uc774\ubbf8\uc9c0 \ucf58\ud150\uce20 Uri\u00a0<\/strong><\/p>\n<pre class=\"lang: decode:true\">contentResolver.query(\r\n    MediaStore.Images.Media.EXTERNAL_CONTENT_URI, \r\n    null, \r\n    null,\r\n    null,\r\n    null\r\n)<\/pre>\n<p><strong>3\ubc88\ud0c0\uc785 &#8211; \ud30c\uc77c \ucf58\ud150\uce20 Uri + \uc774\ubbf8\uc9c0 or \ube44\ub514\uc624 \ud0c0\uc785 \uac70\ub974\uae30<\/strong><\/p>\n<pre class=\"lang: decode:true\">contentResolver.query(\r\n    MediaStore.Files.getContentUri(\"external\"),\r\n    null,\r\n    MediaStore.Files.FileColumns.MEDIA_TYPE + \" = ? OR \"+ MediaStore.Files.FileColumns.MEDIA_TYPE + \" = ?\",\r\n    arrayOf(\"${MediaStore.Files.FileColumns.MEDIA_TYPE_IMAGE}\", \"${MediaStore.Files.FileColumns.MEDIA_TYPE_VIDEO}\"),\r\n    null\r\n)<\/pre>\n<p><strong>4\ubc88\ud0c0\uc785 &#8211; \uc774\ubbf8\uc9c0 \ucf58\ud150\uce20 Uri\u00a0 \ubc0f \ube44\ub514\uc624 \ucf58\ud150\uce20 Uri\u00a0 \uba38\uc9c0\ud558\uae30<\/strong><\/p>\n<pre class=\"lang:null decode:true lang:\">val imageCursor = contentResolver.query(\r\n    MediaStore.Images.Media.EXTERNAL_CONTENT_URI, \r\n    null, \r\n    null,\r\n    null,\r\n    null\r\n)\r\n\r\nval videoCursor = contentResolver.query(\r\n    MediaStore.Video.Media.EXTERNAL_CONTENT_URI, \r\n    null, \r\n    null,\r\n    null,\r\n    null\r\n)\r\n\r\nMergeCursor(arrayOf(imageCursor, videoCursor))<\/pre>\n<h3>\ud37c\ud3ec\uba3c\uc2a4 \ube44\uad50<\/h3>\n<p><strong>1\ud68c\ucc28<\/strong><\/p>\n<p>1\ubc88 \ud0c0\uc785 \uc751\ub2f5 \uc18c\uc694\uc2dc\uac04 = 235ms<br \/>\n2\ubc88 \ud0c0\uc785 \uc751\ub2f5 \uc18c\uc694\uc2dc\uac04 = 212ms<br \/>\n3\ubc88 \ud0c0\uc785 \uc751\ub2f5 \uc18c\uc694\uc2dc\uac04 = 221ms<br \/>\n4\ubc88 \ud0c0\uc785 \uc751\ub2f5 \uc18c\uc694\uc2dc\uac04 = 212ms<\/p>\n<p><strong>100\ud68c \ub204\uc801 \ud3c9\uade0<\/strong><\/p>\n<p>1\ubc88 \ud0c0\uc785 \uc751\ub2f5 \uc18c\uc694\uc2dc\uac04 = 219ms<br \/>\n2\ubc88 \ud0c0\uc785 \uc751\ub2f5 \uc18c\uc694\uc2dc\uac04 = 201ms<br \/>\n3\ubc88 \ud0c0\uc785 \uc751\ub2f5 \uc18c\uc694\uc2dc\uac04 = 225ms<br \/>\n4\ubc88 \ud0c0\uc785 \uc751\ub2f5 \uc18c\uc694\uc2dc\uac04 = 210ms<\/p>\n<h3>\ud14c\uc2a4\ud2b8\ud558\uba74\uc11c \ub290\ub080 \uc810<\/h3>\n<ul>\n<li>\uc9c8\uc758 \uc2dc\ub9c8\ub2e4 \uc751\ub2f5 \uc18c\uc694\uc2dc\uac04\uc740 \uc57d\uac04\uc758 \ucc28\uc774\uac00 \uc788\ub2e4. (\uc624\ucc28 \ubc94\uc704\ub294 \ud2b9\uc815\ud560\uc218 \uc5c6\uc74c)<\/li>\n<li>\uae30\uae30\uc5d0 \ud3ec\ud568\ub41c \ube44\ub514\uc624\uac00 \ub108\ubb34 \uc801\uc5b4 4\ubc88 \ud0c0\uc785\uacfc \ub2e4\ub978 \ud0c0\uc785\uc758 \ucffc\ub9ac \uc2dc\uac04\uc774 \ucc28\uc774\uac00 \ud06c\uc9c0 \uc54a\uc558\ub2e4. \uc774\ubbf8\uc9c0 \uc640 \ube44\ub514\uc624 \ud30c\uc77c\uc774 \ubaa8\ub450 \ub9ce\uc744 \uacbd\uc6b0 4\ubc88 \ud0c0\uc785\uc758 \ucffc\ub9ac\ub294 \uac00\uc7a5 \uc2dc\uac04\uc774 \uc624\ub798 \uac78\ub9b4 \uac83\uc73c\ub85c \uae30\ub300\ud55c\ub2e4.<\/li>\n<li>\ud655\uc2e4\ud558\uc9c0 \uc54a\uc9c0\ub9cc 1~4\ubc88 \uc21c\uc73c\ub85c \ucffc\ub9ac\ub97c \ud574\uc11c \uccab\ubc88\uc9f8\u00a0 \ucffc\ub9ac\uac00 \uc2dc\uac04\uc774 \uac00\uc7a5 \ud06c\uac8c \ub098\uc628 \uac83 \uac19\ub2e4. \ucd5c\ucd08 \ucffc\ub9ac \uc774\ud6c4 \ub450\ubc88\uc9f8 \ucffc\ub9ac\ubd80\ud130\ub294 \uc2dc\uac04\uc774 \uc904\uc5b4\ub4dc\ub294 \uac83 \uac19\ub2e4. (\ub3c4\ub300\uccb4 \uc65c? DBMS \ub0b4\ubd80 \uce90\uc2f1?)\u00a0<br \/>\n1~4\ubc88 \uc21c\uc73c\ub85c 100\ud68c \uc774\uc0c1 \ub8e8\ud504 \ub3cc\uba70 \ud3c9\uade0\uac12\uc744 \ub0b4\ubcf8 \uacb0\uacfc 1\ubc88 \ud0c0\uc785\uc758 \ud3c9\uade0 \uc18c\uc694 \uc2dc\uac04\uc774 \uc904\uc5b4\ub4dc\ub294 \uac83\uc744 \ud655\uc778\ud588\ub2e4.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\ubc30\uacbd \ub2e4\uc591\ud55c \uc9c8\uc758\ub97c \ud1b5\ud574, \uac00\uc7a5 \ube60\ub978 \uc751\ub2f5\uc2dc\uac04\uc744 \ubcf4\uc774\ub294 \ubc29\ubc95\uc744 \uc54c\uc544\ubcf8\ub2e4. \ud14c\uc2a4\ud2b8 \ud658\uacbd Galaxy S9, \uc774\ubbf8\uc9c0 80507\uac1c, \ub3d9\uc601\uc0c1 29\uac1c \ucffc\ub9ac \ud0c0\uc785 1\ubc88\ud0c0\uc785 &#8211; \ud30c\uc77c \ucf58\ud150\uce20 Uri\u00a0 + \uc774\ubbf8\uc9c0 \ud0c0\uc785\ub9cc \uac70\ub974\uae30 contentResolver.query( MediaStore.Files.getContentUri(&#8220;external&#8221;), null, MediaStore.Files.FileColumns.MEDIA_TYPE + &#8221; = ?&#8221;, arrayOf(&#8220;${MediaStore.Files.FileColumns.MEDIA_TYPE_IMAGE}&#8221;), null) 2\ubc88\ud0c0\uc785 &#8211; \uc774\ubbf8\uc9c0 \ucf58\ud150\uce20 Uri\u00a0 contentResolver.query( MediaStore.Images.Media.EXTERNAL_CONTENT_URI, null, null, null, null [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"inline_featured_image":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[16],"tags":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/charlezz.com\/index.php?rest_route=\/wp\/v2\/posts\/44745"}],"collection":[{"href":"https:\/\/charlezz.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/charlezz.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/charlezz.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/charlezz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=44745"}],"version-history":[{"count":1,"href":"https:\/\/charlezz.com\/index.php?rest_route=\/wp\/v2\/posts\/44745\/revisions"}],"predecessor-version":[{"id":44747,"href":"https:\/\/charlezz.com\/index.php?rest_route=\/wp\/v2\/posts\/44745\/revisions\/44747"}],"wp:attachment":[{"href":"https:\/\/charlezz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=44745"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/charlezz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=44745"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/charlezz.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=44745"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}