본문 바로가기
[android] PDF file 읽는 방법 [android] PDF file 읽는 방법 https://commonsware.com/blog/2017/01/04/options-viewing-pdfs.html -ACTION_VIEW action Intent 를 통해 third-party app 으로 권한을 양도 -PdfRenderer 를 써서 직접 구현.https://developer.android.com/reference/android/graphics/pdf/PdfRenderer.html API Level 21 부터 사용할 수 있으나, Bitmap 으로 render 를 시키고, 사용하기가 어렵다.표준을 따른 일부 PDF 들만 rendering 가능하다는 약점이 있다. -pdf.jshttps://mozilla.github.io/pdf.js/ Mozi.. 2018. 3. 16.
[android] 최고의 안드로이드 개발 원칙 [android] 최고의 안드로이드 개발 원칙 https://medium.freecodecamp.com/android-development-best-practices-83c94b027fd3#.fkhdpa3m0cf) 현재 제가 잘 못 하고 있는 것을 빨간 색 마킹 했습니다. ( 결론은 test 군요.. ) -Google 이 추천하는 Android architecture 를 사용하라. -코드 퀄리티를 항상 좋게 유지하라. -Unit test 를 항상 포함하라. JVM 에서 돌 수 있는 Java 코드들은 단말 위에서 테스트하는 것보다 훨씬 빠르다. Android dependency 가 있는 코드들은 Robolectric 을 사용하는 것을 추천한다. Mockito 도 좋다. -Functional UI test .. 2018. 3. 7.
[ios/tutorial] Core Animation 모든 것!! [ios/tutorial] Core Animation 모든 것!! 참고 : https://www.objc.io/issues/12-animations/animations-explained/ -Animation 을 수행하는 방법은 크게 2가지. 1. UIView 의 class method “animateWithDuration:” 을 사용하는 방법2. Core Animation 을 사용하는 방법. Simple Animation 이 아니라면 Core Animation 을 사용하는 것이 추천된다.훨씬 코드의 가독성이 좋고, 더 많은 기능을 제공한다.But, 더 많은 학습을 필요로 한다. 물론 애플의 권장사항은 할수만 있다면 항상 UIKit 에서 제공되는 Animation 을 사용하길 원한다. -Core Anima.. 2017. 11. 30.
[ios/reference] Core Animation [ios/reference] Core Animation https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/CoreAnimation_guide/Introduction/Introduction.html#//apple_ref/doc/uid/TP40004514-CH1-SW1 -Core Animation 은 iOS, OS X 모두에 속하는 animation 에 대한 infra structure 이다. -몇 가지 설정만 해주면, 알아서 animation 을 만들어 수행한다.animation 에 대한 수행은 안쪽에서 알아서 hardware 가속 등을 사용해 rendering 한다. -Core Animation 은 UIKit/ AppKit 아래.. 2017. 11. 19.
[android] VSYNC & Choreographer - Butter Project [android] VSYNC & Choreographer - Butter Project http://developer.android.com/reference/android/view/Choreographer.htmlChoreographer - 발레 안무가 -API 16 ( Jelly Bean ) 부터 사용 가능하다. -animation, input 그리고 drawing timing 을 coordinate 한다. -choreographer 는 VSYNC pulse 타이밍에 event 를 받는다.그리고 이 시간에 다음 display frame 에 대한 작업을 하면 된다. -앱은 일반적으로 choreographer 와 간접적으로 작용한다.animation framework 나 view hierarchy 를 통해.. 2017. 9. 5.
[android] Circular Bitmap 만들기 ( 동그란 프로필 사진 ) [android] Circular Bitmap 만들기 ( 동그란 프로필 사진 ) http://frogermcs.github.io/InstaMaterial-concept-part-6-user-profile/ -public class CircleTransformation implements Transformation { private static final int STROKE_WIDTH = 6; @Override public Bitmap transform(Bitmap source) { int size = Math.min(source.getWidth(), source.getHeight()); int x = (source.getWidth() - size) / 2; int y = (source.getHeight(.. 2017. 7. 13.
[android] Bitmap 변환시 exif 정보 유지시키기 [android] Bitmap 변환시 exif 정보 유지시키기 -Bitmap.createScaledBitmap 을 사용해서 이미지 크기를 변경하면 exif 정보가 날아간다. -exif 정보는 Exchangeable Image File Format ( 교환 이미지 파일 형식 ) 의 약자로, 이미지 파일에 이미지에 대한 정보를 포함하는 메타데이터가 들어있다. jpeg, tiff, riff, wav 포맷에 사용되며, png, gif 에서는 지원되지 않는다. -보통의 exif 정보는 날짜, 시간, 카메라 설정, 저작권, 위치 등의 정보가 저장된다. -여튼 exif 를 유지시켜주려면 아래와 같이 하면 된다.ExifInterface srcExif = new ExifInterface(srcFile.getAbsolut.. 2015. 11. 9.
[android] 일반적이지 않은 사진(이미지) 모양 만들기 #2 [android] 일반적이지 않은 사진(이미지) 모양 만들기 #2 출처 : http://blog.stylingandroid.com/archives/2660 이전 글 : http://aroundck.tistory.com/2971 Shader 는 Canvas 에 그릴 때 fill style 을 정의할 때 사용되며, Paint 객체에 전달하여 사용된다. 이 방법은 BitmapShader 를 이용하며, round corner radius 를 bitmap 의 1/8 사이즈로 한다.그리고 Canvas.drawRoundRect 를 이용하여 기존 이미지 형태의 rounded rect 를 대체한다. public Bitmap processImage(Bitmap bitmap) { Bitmap bmp; bmp = Bitmap.. 2015. 4. 30.
[android] 일반적이지 않은 사진(이미지) 모양 만들기 #1 - 모서리가 둥근 사각형 일반적이지 않은 사진(이미지) 모양 만들기 #1 - 모서리가 둥근 사각형 출처 : http://blog.stylingandroid.com/archives/2656 2가지 이미지를 합성해, 사각형의 이미지를 다른 모양으로 바꿀 수 있다.이번에 알아볼 것은 모서리가 둥근 사각형을 이용하여, 사각형 이미지를 둥근 사각형 모양으로 masking 하는 것이다. public Bitmap combineImages(Bitmap bgd, Bitmap fg) { Bitmap bmp; int width = bgd.getWidth() > fg.getWidth() ? bgd.getWidth() : fg.getWidth(); int height = bgd.getHeight() > fg.getHeight() ? bgd.getHei.. 2015. 4. 11.
반응형