본문 바로가기
Android RenderScript blur Android RenderScript Blur RenderScript 관련 API 들은 API 11 에 등장했다.하지만 Compat library 를 통해 API 8 부터 사용 가능하다. RenderScript 는 Graphic 작업을 할 때 CPU, GPU 중 해당 작업을 최적으로 처리할 수 있는 것을 찾아내서 multiple processor 작업을 하고 나중에 그 결과를 합치는 작업을 하여 성능을 매우 높인다. Native syntax 는 C99 기반으로, OpenCL, CUDA, GLSL 등이랑 비슷하다. private void blur(Bitmap bg, View textView, float radius) { Bitmap overlay .. 2014. 6. 8.
[JNI] bitmap handling source code frame. JNI, bitmap handling source code frame. #include /* Header for class com_example_coloring_utils_FloodFillUtils */#include #include #define LOG_TAG "DEBUG"#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__)#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__) #ifndef _Included_com_example_coloring_utils_FloodFillUtils#define _Included_com_example_co.. 2014. 4. 16.
[android] ThumbnailUtils 요런 녀석 있는 줄 알았삼? android, ThumbnailUtils 요런 녀석 있는 줄 알았삼? API Level 8 ( Froyo ) 부터 사용할 수 있는 녀석으로. 알짜배기 함수들을 제공한다. 베리 굿!! static BitmapcreateVideoThumbnail(String filePath, int kind) static BitmapextractThumbnail(Bitmap source, int width, int height, int options) static BitmapextractThumbnail(Bitmap source, int width, int height) Android, bitmap, createVideoThumbnail, extractThumbnail, froyo, thumbnailutils, Thumb.. 2014. 4. 4.
[android] Bitmap 과 메모리에 대한 이야기. 끝판왕 android, Bitmap 과 메모리에 대한 이야기, 끝판왕! 안드로이드 메모리에 대한 이야기. 한 앱은 Dalvik Heap 과 External 두가지 영역이 존재한다.Dalvik Heap 은 Java 에서 사용하는 메모리라고 보면 되고,External 은 native 메모리라고 보면 된다. Dalvik Heap 영역은 메모리가 꽉 차면 늘긴 하지만 그 공간이 줄지는 않는다.반대로 External 영역은 유동적으로 그 공간이 늘었다 줄었다 한다.( 특히 Ginger Bread 에서는 Java Object 관리를 잘못하면 심심하면 OOM 을 만날 수 있겠다. ) HoneyComb 이전에는 bitmap 은 native memory 에서 관리했으나,HoneyComb 이후에는 bitmap 도 dalvik h.. 2014. 1. 26.
[android] OutOfMemoryError : bitmap size exceeds VM budget 을 해결해보자!!! 안드로이드, OutOfMemoryError : bitmap size exceeds VM budget해결해보자!! OutOfMemoryError: bitmap size exceeds VM budget 해결방법 #1 메니페스트의 applicaation tag 에 android:largeHeap="true" 를 준다.이 경우 원래보다 더 큰 용량의 힙 사이즈를 사용할 수는 있지만,GC 시간이 더 오래 걸리는 등의 문제가 생기기 쉽다.게다가 정확한 heap increase 가 보장되지 않는다. 결국 완벽한 solution 은 되지 못하고, 아주 특수한 상황에 한번씩 엄청난 양의 heap size 가필요할 때만 쓸 수 있는 미봉책정도가 되겠다. OutOfMemoryError: bitmap size exceeds .. 2013. 12. 13.
[android] NotificationCompat and its Builder NotificationCompat.Builder.setSmallIcon( int resId ); setSmallIcon 이 지정되지 않으면 notification 은 등록이 아예 되지 않음.Small Icon 은 status bar 에 뜨는 아이콘과 notification view 안의 우측에 표시됨. 만약 large icon 이 지정되지 않으면 notification view 안에 있는 icon 도 이녀석으로 지정됨.만약 large icon 이 지정되어 있다면 content info 자리에 icon 이 같이 표시됨. NotificationCompat.Builder.setLargeIcon( Bitmap bitmap ); Notification View 안에 있는 icon 이 지정됨. Notificatio.. 2013. 11. 21.
[android] 메모리 최적화에 대한 추가정보들 android, 메모리 최적화에 대한 추가정보들 Activity 나 Fragment 가 멈출 때 비트맵을 재활용하자. - 보통 Activity의 경우 onStop(), Fragment의 경우 onDestryView() 에서 하는 것이 적당하며, Bitmap 이미지의 recycle 을 호출한다. - Activity 나 Fragment 의 종료시에는 View 에 bind 된 drawable 을 끊어주는 것도 중요하다.Drawable.setCallback( null ); 이는 Drawable 이 View 에 bind 되어 있고, View 는 다시 Context 를 통해 Activity 에게 bind 되어 있다는 의미이다. 이를 통해 메모리 릭의 가능성을 배제할 수 있다. 이미지를 load 할 때 줄여서 읽는다.. 2013. 11. 11.
[android] Bitmap too large to be uploaded into a texture android, Bitmap too large to be uploaded into a texture ImageView 등에 Bitmap 을 표시할 때 사이즈 제한이 있다.다음 에러 메세지를 보면 알 수 있는데, 필자가 decoding 하여 ImageView 에 올리려 했던 것은 4288 x 2848 사이즈. 그러나 maximum 은 4096 x 4096 사이즈까지만 가능하다. Bitmap too large to be uploaded into a texture (4288x2848, max=4096x4096) 참고하여 만약 bitmap 사이즈가 4096 x 4096 보다 크다면,미리 sample size 를 조절하여 사이즈를 조절하여 decoding 하거나,아니면 디코딩 후 resize 를 하여 ImageV.. 2013. 10. 31.
[android] camera take and crop ( 사진 찍으면서 crop 까지 하기 ) 안드로이드, 사진 찍으면서 crop 까지 하기 갤러리로부터 이미지 선택하며 크롭하는 방법. Camera 로 사진을 찍으면서 Crop 까지 하는 sample code. private static final int REQUEST_CODE_PROFILE_IMAGE_CAPTURE = 545;private static final int REQUEST_CODE_PROFILE_IMAGE_CROP = 2103; private static final String TYPE_IMAGE = "image/*";private static final int PROFILE_IMAGE_ASPECT_X = 3;private static final int PROFILE_IMAGE_ASPECT_Y = 1;private static fina.. 2013. 8. 5.
반응형