본문 바로가기
[android] background work(AlarmManager) 수행에 대한 이야기 [android] background work(AlarmManager) 수행에 대한 이야기 https://plus.google.com/+AndroidDevelopers/posts/GdNrQciPwqo -구버전 안드로이드에서는 background work 를 위해서 보통 AlarmManager 를 사용했다.AlarmManager 를 사용하면 앱이 foreground 가 아닌 상황에서도 미래 특정 시점에 어떤 일을 하도록 scheduling 을 할 수 있다. -60초 이내에 무언가를 수행하게 하고 싶다면 AlarmManager 는 best choice 가 아닐 수 있다.이 때는 Handler 를 이용해보도록 하자. -API 21+ (5.0 LOS) 부터는 setAlrmClock() API 를 통해서 user.. 2019. 1. 27.
[android] Oreo 에서는 Wakelock 이 소용 없다?! [android] Oreo 에서는 Wakelock 이 소용 없다?! https://developer.android.com/about/versions/oreo/android-8.0-changes -As one of the changes that Android 8.0 (API level 26) introduces to improve battery life, when your app enters the cached state, with no active components, the system releases any wakelocks that the app holds. App 이 cache 상태에 돌입하고, Active component 가 없으면 system 이 자동으로 wakelock 을 해제한다고 되어 .. 2018. 12. 2.
[ios] NSManagedObjectContextDidSaveNotification sent in todayExtension? [ios] NSManagedObjectContextDidSaveNotification sent in todayExtension? 참조 : https://www.innoq.com/en/blog/ios-writing-core-data-in-today-extension/ -context 를 여러 개 사용하는 경우에 context 에 대한 commit 분의 sync 를 맞춰주기 위해CoreData 는 내부적으로 NSManagedObjectContextDidSaveNotification noti 를 보내고,이를 addObserver 해놓은 곳에서는 mergeChangesFromRemoteContextSave 함수를 통해 sync 를 맞춘다. -그러나 todayExtension 에서 context 에 변화를 주었다.. 2018. 2. 10.
[ios tutorial] Local Notification [ios tutorial] Local Notification -앱이 Foreground 상태가 아닐 때 사용자에게 어떤 정보를 알리기 위해 주로 사용한다.앱이 Foreground 상태일 때에는 Notification 이 표시되지 않고, Callback 을 받아 따로 처리해야 한다. -사용자는 Local Notification 과 Remote Notification (Push) 에 대한 차이를 알기 어렵다.둘 다 스크린상의 alert 나 banner, app badge, 사운드 등의 형태로 알람을 제공한다. Permission -iOS8 부터는 badge icons, alert message 표시, 소리 재생 등의 기능을 사용하기 위해서는 interaction type 을 등록 & User 의 Permis.. 2018. 1. 29.
[ios tutorial] UIImage RenderingMode ( Template Image ) [ios tutorial] UIImage RenderingMode ( Template Image ) 출처 :https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/UIKitUICatalog/index.html#//apple_ref/doc/uid/TP40012857-UIView-SW7https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIImage_Class/#//apple_ref/c/tdef/UIImageRenderingMode -UIImageRenderingMode 는 3가지 형태가 있다. Automatic AlwaysOriginal Templ.. 2018. 1. 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] onActivityResult 는 app 이 background 일 때 불리지 않는다 [android] onActivityResult 는 app 이 background 일 때 불리지 않는다 - onActivityResult 는 app 이 background 일 때 불리지 않는다그래서 foreground 로 app 이 올라올 때 불리게 된다. -참고로 FLAG_ACTIVITY_NEW_TASK 를 통해 다른 task 로 수행된 activity 에 대한 결과는 항상 cancel (RESULT_CANCELED) 로 들어온다.( https://developer.android.com/reference/android/app/Activity.html#startActivityForResult(android.content.Intent, int, android.os.Bundle) ) Note that thi.. 2017. 9. 20.
[android] Kiosk mode app 을 만들자! [android] Kiosk mode app 을 만들자! http://www.andreas-schrade.de/2015/02/16/android-tutorial-how-to-create-a-kiosk-mode-in-android/ -Kiosk mode 가 무엇을 말하는가?다른 앱은 실행되지 않는 single app 만 실행하는 그런 앱을 이야기한다. -고려해야 할 상황들은 다음과 같다. back button home button recent app button power button volume button -먼저 kiosk 는 부팅과 동시에 해당 앱이 시작되어야 하기 떄문에, boot complete br 을 처리해야 한다. @Manifest @BootReceiverpublic class BootRec.. 2017. 8. 7.
[iOS Study] 뷰 컨트롤러 [iOS Study] 뷰 컨트롤러 출처 : 아론 힐리가스의 iOS 프로그래밍 -뷰 컨트롤러는 UIViewController 의 하위 클래스 인스턴스이다.뷰 컨트롤러는 뷰 계층구조를 관리한다.뷰 컨트롤러는 계층구조를 구성하는 뷰 객체들을 만들고 뷰 객체와 관련된 이벤트를 제어하고, 윈도우에 뷰 계층구조를 추가하는 역할을 한다. -UIViewController 의 하위 클래스는 중요한 프로퍼티를 하나 상속받는다. @property (nonatomic, strong) UIView *view; 이 프로퍼티는 UIView 인스턴스를 가리킨다.뷰 컨트롤러의 View 가 윈도우의 하위뷰로 추가되면, 뷰 컨트롤러의 뷰계층 전부가 윈도우에 추가된다. -뷰 컨트롤러의 view 는 화면에 보여줄 필요가 있을 때까지 만들어지.. 2016. 2. 18.
반응형