전체 글208 Mac(맥)에서 시작프로그램 등록 및 삭제하기 윈도우에서는 다들 많이 해보신 시작프로그램 등록 및 삭제하기.. 맥에서는 이렇게 합니다. 왼쪽 사과 클릭! 하셔서 시스템 환경설정을 들어가주세요. 들어가시면 사용자 및 그룹 메뉴가 있습니다 클릭 이 화면에서 로그인 항목을 클릭하시면 됩니다. 그럼 리스트에 부팅 시 자동으로 실행되는 시작프로그램이 표기되는데요 저같은경우는 다 삭제해버렸습니다.. 왼쪽에 빨간동그라미에 + - 버튼을 클릭하여 추가 및 삭제가 가능합니다. 2021. 7. 21. Android (타이머) 시간마다 실행하기 (주기별 실행) Timer timer = new Timer(); TimerTask timerTask = new TimerTask() { @Override public void run() { //5초마다 실행 } }; timer.schedule(timerTask,0,5000); ms단위로 적어주시면 됩니다. 2021. 7. 2. Android polling(폴링) 백그라운드에서 API통신 해보기. 안드로이드에서 백그라운드딴에서 앱이 종료되도 주기적으로 서버와 통신하며 상태를 확인해보는 작업을 해볼게요. 프로젝트에서 오른쪽 클릭해서 new - Service - Service 해서 서비스를 상속받는 클래스를 만들어주세요 (안드로이드 4대 컴포넌트!!) public class MyService extends Service { public MyService() { } @Override public IBinder onBind(Intent intent) { // TODO: Return the communication channel to the service. throw new UnsupportedOperationException("Not yet implemented"); } } 이게 초기상태로 작성된 서비스.. 2021. 7. 2. 안드로이드 스튜디오 현재 기기의 배터리 잔량 파악하기. public int getBatteryState(Context context) { Intent batteryStatus = context.registerReceiver(null, new IntentFilter(Intent.ACTION_BATTERY_CHANGED)); int level = batteryStatus.getIntExtra(BatteryManager.EXTRA_LEVEL, -1); int scale = batteryStatus.getIntExtra(BatteryManager.EXTRA_SCALE, -1); float batteryPct = level / (float)scale; return (int)(batteryPct * 100); } 해당 함수를 정의하고 인자(파라미터)값에 Context를.. 2021. 6. 24. 이전 1 ··· 18 19 20 21 22 23 24 ··· 52 다음