1.Snackbar Toast와 비슷하지만 View를 기준으로 message를 보여줌 Snackbar Color Change기본 배경 색 변경snackbar.getView().setBackgroundColor(colorId);용도 별로 다른 색을 사용하는 방법사용 방법Snackbar snackbar = Snackbar.make(getView(), R.string.hello_snackbar, Snackbar.LENGTH_SHORT);ColoredSnackBar.alert(snackbar).show();Classpublic class ColoredSnackbar { private static final int red = 0xfff44336; private static final int green = 0xff..
메타 데이터의 끝으로 건너뛰기출처: http://aroundck.tistory.com/59 BitmapFactory.decodeXXXX function 들을 보면 똑같은 메소드가 2개씩 overloading 되어 있습니다. 같은 이름이지만 signature 가 다르죠. 마지막 parameter 로 BitmapFactory.Options 를 받느냐 안 받느냐의 차이죠. 이 BitmapFactory.Options 가 decode 를 하면서 옵션을 주는 녀석인데, 요놈이 Resize 와 관련이 있습니다. BitmapFactory.Options 에도 여러가지가 있지만, Resize 쪽에서 꼭 봐야 할 옵션은 inSampleSize 입니다. 이 녀석은 decode 시 얼마만큼 줄여서 decoding 을 할지를 결..
해상도가 큰 파일을 읽어서 Bitmap.createBitmap을 하면 out of memory가 발생합니다.안드로이드 약 2.8메가 이상의 힙메모리 사용시 out of memory가 발생하게 되는데요.이미지를 메모리에 올리지 않고 그 넓이와 높이를 구하는 방법입니다.이것으로 사이즈를 구해서 가능한 현재 화면의 해상도에 맞게 줄여서 사용하셔야 할듯 합니다. public static int getBitmapOfWidth( String fileName ){try {BitmapFactory.Options options = new BitmapFactory.Options();options.inJustDecodeBounds = true;BitmapFactory.decodeFile(fileName, options);r..
Mac adb 위치/Users/USERNAME/Library/Android/sdk/platform-tools ~]530$ cd /Users/USERNAME/Library/Android/sdk/platform-tools/--------------------------------------------------------------------------------[USERNAME@USERNAME-MacBook-Pro:~/Library/Android/sdk/platform-tools]531$ lsNOTICE.txt adb api dmtracedump etc1tool fastboot hprof-conv lib package.xml restarting source.properties sqlite3 systrace..
AndroidManifest.xml 파일에 provider태그를 추가한다.태그의 위치는 application 내부에 위치하도록 한다. App의 Pacakage이름을 이용하여 authorities를 부여하는데 run 모드에 따라서 package 이름이 변경 될 수 있기 때문에 ${applicationId}를 사용하여 이에 대한 문제를 해결한다. (debug / Release 모드에서 app의 이름이 suffix가 붙는 경우) 공유할 내부 폴더의 위치를 res/xml/file_path.xml에 기록한다.특정 파일 또는 특정 Directory 하위의 파일을 정하여 공유할 수도 있고 Runtime에서 파일이 동적으로 생성되거나 경로가 바뀌는 경우내부 폴더의 root 폴더를 지정하면 하위 폴더의 파일들을 공유할 ..
구분장점단점Internal(cache /file)context.getCacheDir()context.getFilesDir()- Permission 필요없음- 외부 앱에서 접근 불가능(Contents provider를 이용해 파일에 대한 접근, 복사는 가능)- 외부로 부터 파일을 보호- 앱 삭제시 삭제 가능External private (cache/file)context.getExternalCacheDir()context.getExternalFilesDir()- 외부 앱에서 경로를 통해 접근 가능- Permission 필요- 앱 삭제시 삭제 가능- SD 카드 상태에 따라서 사용 불가능External publicandroid.os.Environment.getExternalStorageDirectory()- ..