전체 글549 Android 날짜 및 시간 자동 설정 체크 - Automatic date and time check 날짜 및 시간 자동 설정 체크 public static boolean isTimeAutomatic(Context c) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { return Settings.Global.getInt(c.getContentResolver(), Settings.Global.AUTO_TIME, 0) == 1; } else { return android.provider.Settings.System.getInt(c.getContentResolver(), android.provider.Settings.System.AUTO_TIME, 0) == 1; }} 젤리빈 이전에는 Settings 의 System 클래스에서 세팅값 .. 2018. 1. 17. Android 네트워크 시간 가져오는 방법 Android 네트워크 시간 가져오는 방법 해당 어플리케이션이 자동 시간을 해제할 경우 네트워크 시간을 가져오기 위해서 검색했습니다.네트워크 시간을 가져오기 전에 날짜 및 시간 체크가 자동설정으로 되어있는지 체크를 하고 진행했습니다. -> 날짜 및 시간 자동 설정 체크 참고 코드public static final String TIME_SERVER = "pool.ntp.org"; public static long getCurrentNetworkTime() { NTPUDPClient lNTPUDPClient = new NTPUDPClient(); lNTPUDPClient.setDefaultTimeout(3000); long returnTime = 0; try { lNTPUDPClient.open(); Ine.. 2018. 1. 17. switch 의 버튼 비활성화는 setEnabled(boolean) switch 의 버튼 비활성화는 setEnabled(boolean) Android Switch 버튼의 비활성화는 setEnabled() 메서드로 처리를 한다. 2018. 1. 5. 디자인 패턴 - Strategy Pattern 디자인 패턴 - Strategy Pattern Interface 와 구현체들그리고 Interface 를 Delegate 한 ClassDelegate 한 클래스를 사용하는 Main Class 강의 : https://www.inflearn.com/course/%EC%9E%90%EB%B0%94-%EB%94%94%EC%9E%90%EC%9D%B8-%ED%8C%A8%ED%84%B4/ 2018. 1. 2. 새해 시작을 운동으로 다행이도 새해 첫날을 운동과 함께 시작했다. 시작이 나쁘지 않은것 같다. 2018. 1. 1. Listview 관련 Error - The content of the adapter has changed but ListView did not receive a notification. Make sure the content of your adapter is not modified from a background thread, but only from the UI thread Listview 관련 ErrorThe content of the adapter has changed but ListView did not receive a notification. Make sure the content of your adapter is not modified from a background thread, but only from the UI thread 상황 : 현재 SM-T813 디바이스 에서 발생. 성능이 더 좋은 디바이스(SM-T815NO)에서는 발생하지 않는 이슈. 해결 : 참고 블로그의 말대로 UI 쓰레드를 돌리면서 진행. 다만, 이런 문제도 디바이스 성능이 뛰어나면 나오지 않는걸 보고, 디바이스가 너무 좋으면 코드가 개판이래도 돌아가니깐, 내가 짠 코드가 문제 없구나를 생각할.. 2017. 12. 27. 이전 1 ··· 67 68 69 70 71 72 73 ··· 92 다음