안드로이드 메모장

고정 헤더 영역

글 제목

메뉴 레이어

안드로이드 메모장

메뉴 리스트

  • 홈
  • 태그
  • 분류 전체보기 (21)
    • Android Studio (4)
    • Android (11)
    • Java (2)
    • Kotlin (1)
    • 소스 (1)
    • GIT (2)

검색 레이어

안드로이드 메모장

검색 영역

컨텐츠 검색
Android UI Open source

https://www.javatips.net/api/RecyclerViewSnap-master/gravitysnaphelper/src/main/java/com/github/rubensousa/gravitysnaphelper/GravityPagerSnapHelper.java GravityPagerSnapHelper.java example package com.github.rubensousa.gravitysnaphelper; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v7.widget.PagerSnapHelper; import android.support...

Android 2019. 5. 31. 17:31

Android Status bar 접기(올리기)

1sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS));cs 테스트해본 버전은 Android 7.0 갤럭시 S8

Android 2018. 9. 19. 16:03

Android 홈바로가기(Shortcut) 생성

홈바로가기 생성은 아래 코드 참고 사용법 1 2 3 4 5 6 String name = 바로가기의 이름 설정 int flag = 바로가기 실행 시 구분하기 위한 값 (필수가 아니므로 없어도 무방) int resId = 바로가기 아이콘 설정 addShortcut(name, flag, resId); cs 관련 코드 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 private static final String ACTION_INSTALL_SHORTCUT = "..

Android 2018. 9. 17. 17:07

Android APP 재시작 방지

Notification, 홈바로가기에서 앱을 실행 하게 될 경우 앱이 실행되어 있는 상태(홈버튼으로 내린 상태 포함)에서도 재시작이 되는데재시작을 하고 싶지 않은 경우 아래의 코드를 참고하시면 될거 같습니다. Intent를 아래와 같이 정의할 경우 앱이 실행되어 있을 시 화면이 유지(홈버튼으로 내린 상태인 경우 마지막화면에서 Foreground가 됨)되며 그렇지 않은 경우 처음부터 실행이 됩니다. 다른방법도 많이 있겠지만 필자의 경우 이 방법을 통해 해결하였기에 적어봅니다. 1234Intent intent = new Intent(Intent.ACTION_MAIN);intent.addCategory(Intent.CATEGORY_LAUNCHER);intent.setClass(context, StartActi..

Android 2018. 9. 17. 16:35

android App 알림 허용 상태 값 가져오기

디바이스 설정 > 애플리케이션 > 해당 앱 정보 > 알림 > "알림 허용(On/Off)" 상태를 알 수 있는 API 1NotificationManagerCompat.from(context).areNotificationsEnabled();cs

Android 2018. 2. 20. 13:36

Android Log 표시(Log 짤림 현상 개선)

로그를 찍으면서 불편했던 점을 개선하여 만든 커스텀 Log 클래스이다. 찍어 놓은 로그의 위치가 확인이 안될때..JSON형식의 데이터를 로그로 보여줄때... (본인시점) 이 두가지의 불편함을 개선하여 만든 클래스로,첫번째로 보통 TAG란에 클래스명을 넣는데 거기에 하나 더 추가를 하여 로그를 찍게 한 라인을 기입하여,어느 위치에 넣은 로그인지 알 수 있게 하였다.ex) E/MainActivity #25: TEST LOG 두번째로는 구글링을 하면 예제가 많이 나오는 로직이긴 하나 매번 찾는 것도 귀찮기 때문에 넣었다.String이 설정한 사이즈(Length)보다 클 경우 나눠서 출력하는 로직이다. 추후 소스코드로 기재할 예정이며, 지금은 시간이 부족하여 파일을 첨부한다.파일을 참조하기 바란다.

Android 2017. 12. 4. 16:01

android 디바이스에 저장된 연락처 가져오기

1234567891011121314151617181920212223242526272829String[] addressInfo = { ContactsContract.CommonDataKinds.Phone.CONTACT_ID, ContactsContract.CommonDataKinds.Phone.NUMBER, ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME}; Uri uri = ContactsContract.CommonDataKinds.Phone.CONTENT_URI; // 한글/영문/숫자및특수문자 순으로 정렬String sortOrder = "case" + " when substr(" + ContactsContract.CommonDataKinds.Phone.DI..

Android 2017. 10. 17. 14:40

android Status Bar 색상 변경

styles.xml 정의 1 2 3 4 5 6 #ffffff true Colored by Color Scripter cs AndroidManifest.xml에 적용 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 Colored by Color Scripter cs 앱 전체에 적용할 경우 application의 android:theme로 적용하면 된다. 특정 액티비티에서만 적용할 경우 activity의 android:theme에 적용하면 된다. 액티비티 단 Code 정의 1 2 3 4 5 6 7 8 9 10 11 public static void setStatusBarColor(Activity activity, int color) { if (Build.VERSION.SDK_..

Android 2017. 9. 5. 17:55

추가 정보

인기글

최신글

페이징

이전
1 2
다음
TISTORY
안드로이드 메모장 © Magazine Lab
페이스북 트위터 인스타그램 유투브 메일

티스토리툴바