본문 바로가기

Android

SwitchCompat 스타일로 디자인 적용하기 SwitchCompat SwitchCompat link 기본 디자인 입히기 뒷배경 track 과 스위치 아이콘 thumb 부분의 drawable 을 수정해서 커스텀 할 수 있다. Thumb Drawble state_checkd 를 통해서 checked 상태와 unchecked 상태를 설정한다. shape_switch_thumb_on shape_switch_thumb_off Track Drwable state_checkd 를 통해서 checked 상태와 unchecked 상태를 설정한다. shape_switch_track_on shape_switch_track_off 전체 코드 원하는 디자인과 조금 다른 짜리몽땅한 모습이 보여진다. (약 34dp) 가로 길이를 조정하기 위해서는 app:switchMinWi.. 더보기
안드로이드 배포 종류, 공개 비공개, 내부 테스트 설정 Set up an open, closed, or internal test 공개, 비공개, 내부 테스트 설정 - Play Console 고객센터 도움이 되었나요? 어떻게 하면 개선할 수 있을까요? 예아니요 support.google.com 프로덕션 : 일반 사용자 테스트 공개 테스트 공개 테스트 버전은 Google Play에서 테스터에게 제공됩니다. 사용자는 스토어 등록정보를 통해 테스트에 참 플레이스토어에서 바로 참여 신청할 수 있음 인원 제한(1000 이상) or 무제한 비공개 테스트 하나 또는 여러 개의 비공개 테스트 버전을 생성 및 관리하여 내가 지정한 테스터를 대상으로 출시 전 버전의 앱을 테스트하세요. email 또는 groups 를 통해서 관리 가능 (G-suite 로 훅 넣을 수 있다는 얘기.. 더보기
Android Proguard Obfuscating and Shrinking your code 프로가드를 통해서 안드로이드 프로젝트의 난독화와 최적화를 할 수 있다. obfuscate: 난독화 Shrink : 수축, 축소 optimize : 최적화 Android Gradle 플러그인 3.4.0 이상을 사용하여 프로젝트를 빌드하는 경우 플러그인은 더 이상 ProGuard를 사용하여 컴파일 시간 코드 최적화 작업을 하지 않습니다. 대신 플러그인은 R8 컴파일러를 이용하여 다음의 컴파일 시간 작업을 처리합니다. proguard 설정 방법 android { buildTypes { debug { mifinyEnalbled false } release { // Enables code shrinking, obfuscation, and optimi.. 더보기
Retrofit + Rx + JUnit 으로 api test 하기 Retofit 을 RX 로 Wrapping 해서 API test 를 실행할 수 있다. Junit5 Gradle 설정testImplementation 'org.junit.jupiter:junit-jupiter-api:5.2.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.2.0'Retrofit Gradle 설정implementation 'com.squareup.retrofit2:retrofit:2.4.0' implementation 'com.squareup.retrofit2:converter-gson:2.4.0' implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0' implementa.. 더보기
Timber 사용하기 (android log) https://github.com/JakeWharton/timber Build.Gradle 에 dependency 를 추가합니다. implementation 'com.jakewharton.timber:timber:4.7.1' // https://github.com/JakeWharton/timber application on Create dㅔ서 다음과 같이 plant 를 설정한다.if (BuildConfig.DEBUG) { Timber.plant(Timber.DebugTree()) } Timber 에서 TAG 를 명시적으로 지정해 주지 않는다면 class name 이 자동으로 TAG 로 처리된다. MainActivity 에서 Timber를 이용하여 로깅을 하는 경우 I/MainActivity: log me.. 더보기
Notification icon Size 내가 갖고 있는 nexus 5 에서 노티가 제대로 보이지 않는게 문제였다. http://developer.android.com/design/style/iconography.html 위 링크를 보면 24 dp 를 기준으로 디자인 하면 된다고 하는데, 해 봐도 내가 원하는 모습이 아니다. 그럼 어떻게 할까? basicNotifications (http://developer.android.com/samples/BasicNotifications/index.html) 샘플을 다운 받아서 보면 정답이 나와있다. 11 개의 아이콘 파일 hdpi : 38 x 38hdpi-v11: 36 x 36hdpi-v9: 24 x 38ldpi-v11: 18 x 18ldpi-v9: 12 x 19mdpi: 25 x 25mdpi-v11:.. 더보기
Crashlytics 로그 아웃 app 에서 유용한 crash 관리를 위한 plug in 으로 crashlytics 를 사용 하던 중app 을 새로운 계정으로 등록하려고 했는데 이미 로그인 되어 있는 계정 때문에 로그아웃 하는 버튼이 없었다. 그러다 검색 ... crashlytics 아이콘 선택 후 ctrl + L 을 누르면 로그아웃 되는 것이었다. 관련 페이지(http://support.crashlytics.com/knowledgebase/articles/214659-how-to-log-out-of-the-crashlytics-plugin) 더보기
APK decompiler 출처는 첨부 파일에 있음 더보기
Service에서 service binding하기 Activity에서 aidl을 이용하여 service를 binding하였듯이 service에서도 service를 binding할 수 있다. 첨부한 예제는 Activity에서 service를 start 시키고 그 서비스가 bindservice함수를 통하여 외부 service를 binding 하는 것이다. 더보기
AIDL 로 service binding하기 AIDL (android interface definitionlanguage) 를 이용하는 방법 Activity 와 Service을 bind하여 사용하는 sample을 작성하였다. activity와 service에 동일한 형태의 aidl 파일을 작성하고 그 형태에 맞게 호출하면 된다. ㅋㅋ 자세한 내용은 소스 참고! 더보기