본문 바로가기
[Java] regex 를 써보자 - 아주 기초 [Java] regex 를 써보자 - 아주 기초 https://regexone.com/references/java - 자바는 regex 를 java.util.regex pkg 를 통해 제공한다. * Matching a string - regex 작업을 할 때 보통 Java 는 Pattern 을 만들어 text matching 을 한다. 가장 간단한 방법은 Pattern.matches() 를 호출하는 것인데, 이는 input str 과 regexp 를 param 으로 받아서 match 를 수행한다. boolean isMatch = Pattern.matches(String regex, String inputStr) - 위의 방법은 추가정보를 주지 않기 때문에 보통 Pattern 을 compile 하고, Ma.. 2020. 3. 1.
[regex] 정규식의 성능을 개선해보자. [regex] 정규식의 성능을 개선해보자. https://www.javaworld.com/article/2077757/optimizing-regular-expressions-in-java.html Java pattern-matching engine and backtracking -java.util.regex package 는 Nondeterministic Finite Automation(NFA) 라 불리는 pattern-matching engine 을 사용한다. (2007년 글로 지금은 NFA 를 사용하지 않을 수도 있다.)NFA 는 nondeterministic 이라 불리는데, 주어진 string 에 대해 regex 를 match 할 때 각각의 char 들이 regex 의 다른 파트에 대해 여러번 ch.. 2020. 2. 27.
[android] Notification Channel ( Oreo 부터 생김 ) Notification Channel ( Oreo 부터 생김 ) https://medium.com/exploring-android/exploring-android-o-notification-channels-94cd274f604c What are Notification Channels? - Notification Channel 은 notification 들을 groupping 하는 데 사용된다. User 는 Notification Channel 단위로 Notification 설정을 할 수 있다. 여기서 말하는 설정은 예를 들면 Alarm On/Off, Alarm 형태 등이다. - Notification Channel setting 에서 할 수 있는 일은... 1. 모든 Channel 의 Notificati.. 2020. 2. 26.
[android] 성능에 대한 미신들을 때려잡자! ( from Dev Summit 2019 ) -Performance 에 대해서는 항상 measure 를 해봐야 한다. * Kotlin -Kotlin app 은 더 size 가 크고 느릴 것이다. -단순한 밴치마킹용 심플 코드가 아닌, Google Drive 를 converting 해보았다. 16K lines / 171 Files / 41 Build Target Startup time 은 동일 / 25% code line 줄어듬 / 2% 정도 compile code size 가 줄어듬성능은 동일하지만, 유지보수해야 하는 코드가 줄어들었다는데 큰 의미가 있다. * Code pattern Fields Access Patterns (getter/setter) getter/setter 는 expensive 할 것이다. Jetpack benchmark lib.. 2019. 11. 16.
[android] AndroidX 로의 migration : 그 때가 왔다! ( from Dev Summit 19 ) AndroidX 로의 migration : 그 때가 왔다! ( from Dev Summit 19 ) * AndroidX 가 뭔데 - androidx 는 set of tool & guide 이다. 목표는 best practice 적용, boiler plate 제거, 어려운 일을 간단히 해서 핵심에 집중할 수 있게 한다. - Jetpack, Support lib, AndroidX 의 관계는 어떻게 될까? AndroidX 는 Jetpack 을 담고 있다. Jetpack 코드의 pgk name 은 androidx 이다. 그리고 Support lib 28 이 AndroidX 1.0 에 들어왔다. * 왜 Migrate 해야 하지? - Support lib 이 28 에서 지원을 멈추고 이제는 AndroidX 에서 제.. 2019. 11. 15.
[android] Coding in Style: Static Analysis with Custom Lint Rules ( from Dev Summit 19 ) Coding in Style: Static Analysis with Custom Lint Rules ( from Dev Summit 19 ) * Initial project set-up - module 을 만들어서 java-library 로 지정하고, aar 로 패키징해서 배포한다. - apply plugin: 'java-library' apply plugin: 'kotlin' ext { lintVersion = "26.5.1" // android gradle version 에 23 을 더해준다. (걍 그렇게 되었다고 함) } dependencies { compileOnly "org.jetbrains.kotlin:kotlin-stdlib-jdk8" // Lint compileOnly "com.androi.. 2019. 11. 14.
[android] Pie (android 9) 의 변경점 [android] Pie (android 9) 의 변경점 https://developer.android.com/about/versions/pie/android-9.0-changes-all -다음 변경점들은 API level 이나 targeting 에 상관없이 Android 9 platform 에서 동작하는 “모든 앱” 에 적용된다. * Power management 전원 관리 관련된 새로운 기능들이 추가되었다https://developer.android.com/about/versions/pie/power app standby bucket 과 battery saver improvements 가 주 내용이다. * Privacy changes bg app 이 sensor 에 접근하거나, Wi-Fi scan 하.. 2019. 7. 31.
[android] Pie 에서 앱 잘 작동하는지 확인하기 [android] Pie 에서 앱 잘 작동하는지 확인하기 https://developer.android.com/about/versions/pie/android-9.0-migration#ct -targetSdkVersion 을 올리지 않아도 pie(android 9) 에서 제대로 작동하지 않는 경우가 있다.그래서 아래의 것들을 확인해봐야한다. * non-SDK interface 에 대한 제약 -특정 non-SDK interface 에 대한 접근이 막힌다. 이것이 직접적 사용이던, JNI 를 통하던 reflection 을 통하던 말이다.제한된 interface 에 접근하는 것은 NoSuchFieldException 또는 NoSuchMethodException 을 발생시킨다.이에 대한 자세한 내용은.. htt.. 2019. 7. 30.
[android] Pie (9) 의 Power management [android] Pie (9) 의 Power management https://developer.android.com/about/versions/pie/power -Android 9 (API 28) 에서는 전원 관리를 위한 새로운 feature 가 추가되었다.이 전원 관리 기능은 2가지 카테고리로 나뉜다. 1. App standby buckets 시스템이 단말의 CPU, 배터리 등의 리소스 사용을 유저의 사용 패턴에 의해 제한한다. 2. Battery saver 개선 Battery saver 가 켜져 있을 때 시스템이 모든 앱에 대해 제한을 건다. 이건 기존에 있던 기능인데, Pie(9) 에서 개선되었다. * App Standby Buckets -얼마나 최근에 얼마나 자주 앱이 사용되었는지에 대한 유저.. 2019. 7. 29.
반응형