728x90 전체 글231 [android studio] camera 기능 추가 Manifest에 추가 안에 provider 추가 res/xml/filepaths.xml 추가 intent안에 url 형식을 변경 Uri uri = FileProvider.getUriForFile(getApplicationContext(), "com.example.captureintent", file); intent.putExtra(MediaStore.EXTRA_OUTPUT, uri); Android 29부터는 Menifest의 application 태그에 android:requestLegacyExternalStorage="true" 를 추가되어야 한다. 2021. 10. 24. [android studio] design 라이브러리 추가시 오류 implementation 'com.android.support:design:28.0.0' 위와같이 입력하였는데, 에러가 나온다. com.android.support:design:28.0.0 경로는 com.google.android.material:material:1.0.0-rc01 위의 경로로 변경되었다. dependencies안에 변경된 경로로 수정 후 해당 오류가 해결되었다. 2021. 10. 24. [android studio] android build.gradle 에 androidX이외의 라이브러리 추가 후 오류시 gradle.properties에 아래 속성을 추가하면 문제가 해결 #AndroidX 이외의 라이브러리 사용 android.enableJetifier=true #AndroidX 라이브러리 사용 android.useAndroidX=true 2021. 10. 24. [android studio] 디버깅(debuging) 단축키 Shift + F9 :디버깅 시작 F9 : 다음 중단점 만날 때까지 실행 F7 : 멈춘 라인의 메서드 상세히 보기 Shift + F8 : 현제 메서드 빠져나갈 때까지 실행 F8 : 소스 코드 한줄 실행 alt + F9 : 마우스 커서 위치까지 실행 ctrl + alt + F9 : 마우스 커서 위치까지 강제 실행 2021. 10. 24. [android studio] image 회전시키기, bitmap 이미지 회전 아래 메서드를 이용하여 이미지를 회전 시킬 수 있다. // 이미지 회전 함수 public Bitmap rotateImage(Bitmap src, float degree) { // Matrix 객체 생성 Matrix matrix = new Matrix(); // 회전 각도 셋팅 matrix.postRotate(degree); // 이미지와 Matrix 를 셋팅해서 Bitmap 객체 생성 return Bitmap.createBitmap(src, 0, 0, src.getWidth(), src.getHeight(), matrix, true); } drawable을 bitmap으로 변환시킨 뒤 회전처리를 할 수도 있고, imageView의 이미지를 아래와 같이 BitmapDrawable로 변환시킨 뒤 bitmap.. 2021. 10. 24. [android studio] Drawable을 Bitmap으로, Bitmap을 Drawable로 변경하기 Drawable을 Bitmap으로 변경 Bitmap bitmap = BitmapFactory.decodeResource(getResources(),R.drawable.[drawable명칭]); 또는, Bitmap bitmap = ((BitmapDrawable)drawable).getBitmap(); Bitmap을 Drawable로 변경 Drawable drawable = new BitmapDrawable(bitmap); Drawable을 Bitmap으로 변경한 뒤 canvas에 넣거나 수정할 경우 [Immutable bitmap passed to Canvas constructor]라는 예외 error가 발생하는 경우가 있다. 이런경우, 아래와 같이 bitmap을 복사한 뒤 사용하면 error를 피해갈 수.. 2021. 10. 24. 이전 1 ··· 32 33 34 35 36 37 38 39 다음 728x90