전체 글 528

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 클래스에서 세팅값 ..

Dev/Android 2018.01.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..

Dev/Android 2018.01.17

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 쓰레드를 돌리면서 진행. 다만, 이런 문제도 디바이스 성능이 뛰어나면 나오지 않는걸 보고, 디바이스가 너무 좋으면 코드가 개판이래도 돌아가니깐, 내가 짠 코드가 문제 없구나를 생각할..

Dev/Error 2017.12.27

카메라 앱 열면서 앱 중지 android.os.FileUriExposedException

카메라 앱 열면서 앱 중지android.os.FileUriExposedException 현상 : 카메라 앱 열면서 앱 중지 원인 : targetSdkVersion 을 올렸기 때문에 발생 (23 -> 26)해결 : 이전대로 targetSkdVersion 을 낮추던지 아래와 같이 파일 접근 방법을 바꾸던지Uri photoURI = FileProvider.getUriForFile(context, context.getApplicationContext().getPackageName() + ".my.package.name.provider", createImageFile()); E/AndroidRuntime: FATAL EXCEPTION: mainProcess: com.iofit.tablet, PID: 30756an..

Dev/Error 2017.12.22