본문 바로가기
[android] CONNECTIVITY_ACTION deprecated 에 대한 이야기 - Connectivity 가 변경되었을 때 받을 수 있는 broadcast 는 ConnectivityManager.CONNECTIVITY_ACTION 가 있었다. 그러나 이 녀석은 API 28 (POS) 부터 deprecated 되었다. - 사실 이 녀석은 이미 deprecated 의 징조를 띄고 있었다. targetSdk 24 (NOS) 부터 static receiver 로 받을 수 없게 되었고, targetSdk 26 (OOS) 부터는 background restriction 정책으로 이 녀석을 포함한 다른 녀석들도 static receiver 로 받을 수 없게 되었다. 그리고 결국 API 28 (POS) 부터는 deprecated 된 것이다. deprecated 가 되었기 때문에 사실 target.. 2019. 4. 9.
[android] Direct Reply Tutorial https://blog.stylingandroid.com/nougat-direct-reply/ -Direct Reply 는 Notification 으로부터 App Launch 없이 바로 답장을 보내는 기능이다.Message App 에 한정되지 않고 모든 앱이 사용 가능하다. -Direct Reply 는 Android N Nougat 버전에 한해 사용 가능하다. -Direct Reply 의 키는, Notification 을 만들 때 remoteInput 을 추가하는 것이다.// notification 생성private static final String REPLY_KEY = “reply”;private static final String REPLY_LABEL = “Input reply”; // Action.. 2018. 2. 28.
Android O Background 실행 제한 Android O Background 실행 제한 https://developer.android.com/about/versions/oreo/background.html#services -앱이 Background 로 돌 때는 디바이스의 리소스를 사용한다. 예를 들면 RAM, CPU.이런것들이 리소스를 많이 사용하는 게임이나 비디오 시청 등에 방해가 된다.이를 개선하기 위해 Android 8.0 ( API 26 ) 부터는 background 작업에 대한 제한이 추가되었다. Overview -많은 안드로이드 앱과 서비스는 동시에 돌 수 있다.예를 들면 게임을 한 윈도우에서 하면서 다른 윈도우에서는 브라우징을 하고, 백그라운드에서는 음악도 재생할 수 있다.더 많은 앱들이 한번에 돌면서 시스템에 더 많은 부하가 생.. 2017. 10. 20.
[android] Android 6.0(MOS) SDK 에서 바뀐 것들!! [android] Android 6.0(MOS) SDK 에서 바뀐 것들!! https://commonsware.com/blog/2015/08/17/random-musings-android-6p0-sdk.html -ACTION_INSTALL_PACKAGE 를 사용하면서 targetSdkVersion 이 22 이상이면 REQUEST_INSTALL_PACKAGE permission 이 반드시 있어야 한다. -PendingIntent 는 FLAG_IMMUTABLE 이라는 option 이 있다.이것은 PendingIntent 를 invoke 할 때 변형되지 않게 하는 것으로 security 측면에서 좋다. -새로운 Setting screen 들을 Settings 의 action string 을 통해 접근할 수 있.. 2017. 9. 18.
[android] AlarmManager 를 통해 이미 alarm 이 등록되었는지 어떻게 알 수 있을까? Intent intent = getAlarmIntent();PendingIntent pi = PendingIntent.getBroadcast(context, 0, intent, PendingIntent.FLAG_NO_CREATE);boolean isAlarmRegistered = ( pi != null ); FLAG_NO_CREATE flag 는 이미 등록된 PendingIntent 가 있다면 해당 instance 를 아니면 null 을 return 한다. alarmmanager, flag_no_create, isalarmregistered, PendingIntent, [android] AlarmManager 를 통해 이미 alarm 이 등록되었는지 어떻게 알 수 있을까? 2017. 6. 14.
[android] NotificationCompat and its Builder NotificationCompat.Builder.setSmallIcon( int resId ); setSmallIcon 이 지정되지 않으면 notification 은 등록이 아예 되지 않음.Small Icon 은 status bar 에 뜨는 아이콘과 notification view 안의 우측에 표시됨. 만약 large icon 이 지정되지 않으면 notification view 안에 있는 icon 도 이녀석으로 지정됨.만약 large icon 이 지정되어 있다면 content info 자리에 icon 이 같이 표시됨. NotificationCompat.Builder.setLargeIcon( Bitmap bitmap ); Notification View 안에 있는 icon 이 지정됨. Notificatio.. 2013. 11. 21.
[android] TaskStackBuilder Tutorial android TaskStackBuilder Tutorial API Level 11 이상에서는 ( 3.0 / HoneyComb ) back key 를 통한 navigation convention 이 바뀌었다.back key 의 behavior 는 현재 task 에서의 조작만을 의미하고, 다른 task 로의 이동은 없다.이전 task로의 inter task 이동은 "recents" 를 통해서 가능하다. android 3.0 이후에서 한 task stack 에서 다른 task 로 이동하는 경우, 어플리케이션은 back stack 과 history 를 융합시켜서 유저가 back 키 여러번 눌러 launcher 로 나갈 수 있게 해야 한다. back key 를 눌러서 다른 task 로 이동하면 안된다. Task.. 2013. 10. 27.
[android] how can I detect if notification clear button is clicked? android, how can I detect if notification clear button is clicked? [En] Very easy.When you make Notification instance, just add delete intent with setDeleteIntent() method. private Notification getNotification( Context context, Intent intent, String pushMessage ){int notiCount = Application.getNotiMessageCount();NotificationCompat.Builder builder = new NotificationCompat.Builder(context).setSmal.. 2013. 10. 16.
[android] framework 의 service와 broadcast 안드로이드, framework 의 service 와 broadcast 음악앱은 Service 에서 Notification 과 함께하여 음악을 재생한다. 알람시계앱은 AlarmManager 를 이용하여 PendingIntent 로 Broadcast 를 날리고, 그것을 스스로 수신해서 Activity 를 띄운다. 달력앱은 특정 이벤트 알람내용을 알리기 위해 AlarmManager 를 알람시계앱처럼 이용한다. 백그라운드 파일 다운로드는 다운로드가 있을 경우 작동하는 Service. E-mail 앱은 특정 주기마다 새로운 메일을 확인하기 위해 Alarm 을 통해 Service를 실행한다. 구글 앱들은 네트워크 Push 이벤트 수신과 동기화를 위한 Service 를 돌린다. 구글에서 보내주는 앱 관련 Push 도.. 2013. 8. 9.
반응형