본문 바로가기
[Kotlin] 장점, 단점, 그리고 아쉬운 점 이야기 [Kotlin] 장점, 단점, 그리고 아쉬운 점 이야기 https://medium.com/keepsafe-engineering/lessons-from-converting-an-app-to-100-kotlin-68984a05dcb6https://medium.com/keepsafe-engineering/kotlin-the-good-the-bad-and-the-ugly-bf5f09b87e6f -위 링크의 글을 쓴 필자는 마켓에 출시된 Java 로 되어 있는 앱을 Kotlin 으로 전환했다.많은 사람들이 Kotlin lib 때문에 dex method limit 이 걸릴 것을 걱정하지만,실제 converting 후 proguard 적용시 method count 는 10% 줄어들고, code line 은 30% 줄.. 2018. 1. 15.
[Kotlin Tutorial] Kotlin 의 Type system #2 [Kotlin Tutorial] Kotlin 의 Type system #2 참조 : Kotlin in action 6.2. Primitive and other basic types 6.2.1. Primitive types: Int, Boolean, and more -Kotlin 은 primitive type 과 wrapper type 을 구분하지 않는다. -그렇다면 Int 가 object 라면 Kotlin 은 모든 primitive type 을 실제로 object 로 만드는가?당연히 그렇게 안 했다.compiler 가 대부분의 Int type 을 Java 의 primitive type 으로 변형시킨다.generic, collection 등은 원래 Java 의 Integer 형태만 담을 수 있으므로 이 경.. 2017. 8. 22.
[Java] Reflection Tutorial - Annotations. [Java] Reflection Tutorial - Annotations. What are Java Annotations Java5 에 소개된 기능으로, meta data 를 코드형태로 담을 수 있고, runtime 에 이 meta data 에 접근할 수 있다. pre-compiler 가 코드를 conversion 할 때 사용되기도 한다. Annotation 은 interface 형태이다. @Retention( RetentionPolicy.RUNTIME );@Target( ElementType.TYPE )public @interface TestAnnotation{public String name();public String value();} @TestAnnotation(name="variable", va.. 2013. 12. 23.
[Java] 형 변환에 대한 깊숙한 이야기. 자바, 형 변환에 대한 깊숙한 이야기. 요즘은 Eclipse 를 비롯한 IDE 들이 워낙 잘 되어 있어서, 알아서 에러를 표시해주고 어떻게 고쳐져야 하는지 Suggestion 까지 나와서 잊기 쉬운 간단하면서 당연한 형변환에 대한 이야기를 해본다. 작은 타입의 데이터를 큰 타입의 변수에 할당할 때는 자동 변환된다. 작은 타입과 큰 타입의 예는 int 와 long 의 관계처럼 볼 수 있다.만약 long 타입의 변수가 있는데, 이 변수에 int 값을 넣어주면 자동 형변환이 된다는 이야기이다. int a = 10;long b = a; // OK!! no casting necessary 큰 타입의 데이터를 작은 타입 변수에 할당할 때는 명시적으로 형 변환을 해 주어야 한다. 큰 타입의 데이터릊 작은 타입의 변수.. 2013. 8. 5.
[android] extrernal image file path <-> MediaStore Uri ( conversion ) 안드로이드, external image file path MediaStore Uri ( conversion ) 경우에 따라서 Uri 와 File 을 전환해야 할 경우가 생긴다. external file path >Cursor cursor = getContentResolver().query( Uri.parse"content://media/external/images/media/1" ), null, null, null, null );cursor.moveToNext(); // 예외처리는 생략했습니다. 실제 코드에서는 예외처리를 잘 해주세요.String path = cursor.getString( cursor.getColumnIndex( "_data" ) );Uri uri = Uri.fromFi.. 2013. 8. 5.
반응형