'Computer'에 해당되는 글 40건
- 2018.07.27 [Android Studio] 기본 세팅 (글자 크기 / Eclipse 단축기 설정)
- 2018.07.27 [Android Studio]Fragment + NavigationView사용하기
- 2018.07.27 [Android/Node.js] Query(URL)로 값을 전달했을 때, 원래 값으로 Decode하는 법
- 2018.07.27 [Android Studio] curPkgName is not in list 에러 처리 방법
- 2018.07.27 1인 Android 개발자에게 도움이 되는 행사/정보/단톡
- 2018.07.27 [Android Studio] 폰트(Font)가 필요하다면?
- 2018.07.27 [Android Studio]Retrofit2 + GSON 에러 - 무한루프(?) 해결
- 2018.07.27 [Android Studio]retrofit+Node.js, Expected BEGIN_OBJECT but was BEGIN_ARRAY에러
- 2018.07.27 [Android Studio] Spinner, default 주기
- 2018.07.27 [Android Studio] Context정리 - getContext(), getBaseContext(), getApplicationContext() 등
1. 글자 크기: File > Setting > Font
2. 단축키 설정: File > Setting > Keymap
'Computer > Android' 카테고리의 다른 글
NavigationView을 사용할 때, 앱이 구동되는 내내 어디든지 혹은 두 곳(Activity) 이상에서 NavigationView를 사용(보이게)하려면
크게 두 가지 방법이 있을 것이다.
하나는 최상단의 Layout을 L, NavigationView를 N, Fragment를 F, 아무것도 아닌 것을 X라고 했을 때에,
LFNL 처럼 되어서 LXNL이란 형식은 유지된 채, F부분만 다른 걸로 계속 replace를 해주는 방법.
이렇게 하면, 중복되는 부분(NavigationView)은 계속 재활용할 수 있게 된다.
다른 하나는 매 Layout마다 NavigationView를 만들어 작성하는 것이다.
이렇게 되면, NavigationView를 Layout 마다 만들어야 하므로 여러개 사용이 된다.
activity_main: LXNL
activity_setting: LXNL
...
와 같은 형태로 말이다.
이렇게 되면 XML에서 뿐만 아니라 Java에서도 코드가 계속 중복되게 된다.
결론적으로 redundant를 피하므로 전자가 낫다.
즉,
하나의 Layout에서 Fragment란 View를 사용하여 그 부분만 바뀌게끔 하면 된다.
(단, NavigationView이 접혔을 때에 기본으로 보여지는 각각에 화면에 맞는 여러개의 Layout은 원래 필요하다.
파일명은 fragment_xxx식으로 하나, 내용은 LFNL에서, F부분만 여러 파일로 나누므로 NavigationView나 기타 Fragment가 아닌 부분을 작성하지 않으므로 activity_xxx와 좀 살짝 다르다.)
MainActivity.java와 AFragment, BFragment가 있다고 하자.
AB화면에서도 NavigationView를 보여주고 싶으면 이 두 Fragment를 하나의 Activity로 묶어주고, 그 Activity가 NavigationView를 가지고 있는 상태에서 AFragment, BFragment로만 Fragment부분을 replace해주면 된다.
*Fragment는 android.support.v4.app.Fragment이다.
이런식으로 해주면 되겠다.
*Fragment는 onCreate, onCreateView, onActivityCreated 이렇게 기본적으로 세가지 중요한 메소드를 오버라이드해서 사용하게 된다.
MainActivity는 다음과 같이 하면 된다.
Fragment의 레이아웃은
이런식으로 내부에 원하는 데코레이션대로 만들면 된다.
'Computer > Android' 카테고리의 다른 글
Body로 data를 보내게 되면 깨지지 않는데에 반하여 URL로 data를 보내는 Query방식이면 보통 URL주소창에서 한글이 깨져 보이는 식으로 깨지게 된다. 예를들어, '@'는 '%40'처럼 보이는데, 이를 해결하기 위해서는 decodeURI()을 사용하면 해결할 수 있다. 그 반대는 encodeURI()이다.
* URL이 아니라 URI이다.
'Computer > Android' 카테고리의 다른 글
[Android Studio] 기본 세팅 (글자 크기 / Eclipse 단축기 설정) (0) | 2018.07.27 |
---|---|
[Android Studio]Fragment + NavigationView사용하기 (0) | 2018.07.27 |
[Android Studio] curPkgName is not in list 에러 처리 방법 (0) | 2018.07.27 |
1인 Android 개발자에게 도움이 되는 행사/정보/단톡 (0) | 2018.07.27 |
[Android Studio] 폰트(Font)가 필요하다면? (0) | 2018.07.27 |
HUAWEI 폰에서만 나오는 에러로 폰 자체에서 발생하는 에러이기 때문에 어떻게 할 수가 없다.
히지만, 디버깅할 때 1초정도마다 계속 뜨는 것은 되게 annoying하다.
다른 폰이 있다면, 그것을 사용하는 게 낫겠지만, 그렇지 않다면 지금 상태에서 무엇을 해야할 것이다.
해결방법은 없으나 완화방법은 반복되는 로그들을 숨기는 것이다.
그럼 전부 사라지며 이후 나오는 에러도 눈에 보이지 않는다.
마음이 상쾌함...
'Computer > Android' 카테고리의 다른 글
[Android Studio]Fragment + NavigationView사용하기 (0) | 2018.07.27 |
---|---|
[Android/Node.js] Query(URL)로 값을 전달했을 때, 원래 값으로 Decode하는 법 (0) | 2018.07.27 |
1인 Android 개발자에게 도움이 되는 행사/정보/단톡 (0) | 2018.07.27 |
[Android Studio] 폰트(Font)가 필요하다면? (0) | 2018.07.27 |
[Android Studio]Retrofit2 + GSON 에러 - 무한루프(?) 해결 (0) | 2018.07.27 |
혼자 Android 앱을 개발하는 사람들이 많다. 하지만, 세금문제라든지 관리 등 여러가지 검색을해도 잘 알지 못하는 것들이 많고 경험 공유나 노하우 같은 것도 부족하다. 하지만 다행히도 1인 개발자들(비 1인 개발자들에게도)에게 도움이 될만한 행사가 있다.
바로 여기...
https://ted.event-us.kr
하지만 행사가 흔하지 않다. 두 달에 한 번 꼴 하는 거 같고, 참가비는 아쉽게도 25000~30000원 정도로 유료다. 그렇지만 내용을 보면 그만한 값어치를 하고 오히려 값어치를 할 수 있을 것 같다.(아직 참관을 해보지 못해서 그냥 예상일뿐)
이런 곳에서 좋은 이야기를 서로 나누면 좋겠지만, '지식'이라기보다도 먹고 살기 위한 '노하우'이므로 이런 류의 강의는 자기 그릇을 챙기고 나서 남들이 알아도 상관없는 것들을 알려주는 것들이 대부분이라, 청자들의 시원한 곳을 긁어주지 못한 경우들이 어떤지는 모르겠지만, 주제만을 본다면, 낚시가 아니길 바란다.
기타, 개인앱개발 관련 정책이나 세금, 기타 정보가 궁금하시면 이 오픈채팅방에서 문의하시면 답변받을 수 있을 거다.
https://open.kakao.com/o/gzIgCbk
참여코드: chope
'Computer > Android' 카테고리의 다른 글
[Android/Node.js] Query(URL)로 값을 전달했을 때, 원래 값으로 Decode하는 법 (0) | 2018.07.27 |
---|---|
[Android Studio] curPkgName is not in list 에러 처리 방법 (0) | 2018.07.27 |
[Android Studio] 폰트(Font)가 필요하다면? (0) | 2018.07.27 |
[Android Studio]Retrofit2 + GSON 에러 - 무한루프(?) 해결 (0) | 2018.07.27 |
[Android Studio]retrofit+Node.js, Expected BEGIN_OBJECT but was BEGIN_ARRAY에러 (0) | 2018.07.27 |
모두 상업용도로 사용가능하다. 단, 폰트 자체만을 판매하는 것은 안 된다.
구글폰트(https://fonts.google.com)
All fonts are released under open source licenses. You can use them in any non-commercial or commercial project.
네이버 나눔글꼴 - http://hangeul.naver.com/2017/nanum
'Computer > Android' 카테고리의 다른 글
[Android Studio] curPkgName is not in list 에러 처리 방법 (0) | 2018.07.27 |
---|---|
1인 Android 개발자에게 도움이 되는 행사/정보/단톡 (0) | 2018.07.27 |
[Android Studio]Retrofit2 + GSON 에러 - 무한루프(?) 해결 (0) | 2018.07.27 |
[Android Studio]retrofit+Node.js, Expected BEGIN_OBJECT but was BEGIN_ARRAY에러 (0) | 2018.07.27 |
[Android Studio] Spinner, default 주기 (0) | 2018.07.27 |
Stackoverflow
gson type
!!! FAILED BINDER TRANSACTION !!!
등이 에러가 났다. 3일 동안 앱 진행을 못했다. 결국 해냈다. 정확한 원인은 모르겠지만, 다음과 같이 하면된다.
이전엔 이렇게 Gson을 선언 했었다.
여기에 excludeFieldsWithoutExposeAnnotation()를 추가해준다.
그리고 사용되는 파라미터들에 @Expose 어노테이션을 붙여준다.
일단, SearchItem은 이렇게 하지 않아도 되는데, UserItem에서 문제가 발생했기 때문에 다른 Item들도 바꿔줘야한다. UserItem에서 문제가 발생한 이유는 서버와 통신을 할 때 사용되지 않는 변수들이 있어서 그런 것 같다.
'Computer > Android' 카테고리의 다른 글
1인 Android 개발자에게 도움이 되는 행사/정보/단톡 (0) | 2018.07.27 |
---|---|
[Android Studio] 폰트(Font)가 필요하다면? (0) | 2018.07.27 |
[Android Studio]retrofit+Node.js, Expected BEGIN_OBJECT but was BEGIN_ARRAY에러 (0) | 2018.07.27 |
[Android Studio] Spinner, default 주기 (0) | 2018.07.27 |
[Android Studio] Context정리 - getContext(), getBaseContext(), getApplicationContext() 등 (0) | 2018.07.27 |
[Android Studio]retrofit+Node.js, Expected BEGIN_OBJECT but was BEGIN_ARRAY에러
| Computer/Android 2018. 7. 27. 16:311. Expected BEGIN_OBJECT but was BEGIN_ARRAY
이 문제는 db에서 결과물(result)을 받고 res.status(200).send(result)라고 보냈는데, Array로 인식하는 경우다. 즉, [{...},{...}]처럼 [, ]로 감싸져서 그런건데, 결과물이 단 하나라면, 그냥 res.status(200).send(result[0])을 해줄 수도 있겠지만,
gson에서 변환할 땐 [, ]형식이어야하는 지 에러가 났다.
그래서 클라이언트 단에서 Array<XXXItem>형식으로 그냥 받아서 그냥 get(0)으로 처리를 했다.
2. Expected BEGIN_ARRAY but was BEGIN_OBJECT
1과 반대의 경우로, 클라이언트 단에서 Array<XXXItem>으로 되어있다면, 객체 하나로 바꿔보자. 이것도 서버와 클라이언트 간에 형식이 맞지 않아서 생기는 문제다.
'Computer > Android' 카테고리의 다른 글
[Android Studio] 폰트(Font)가 필요하다면? (0) | 2018.07.27 |
---|---|
[Android Studio]Retrofit2 + GSON 에러 - 무한루프(?) 해결 (0) | 2018.07.27 |
[Android Studio] Spinner, default 주기 (0) | 2018.07.27 |
[Android Studio] Context정리 - getContext(), getBaseContext(), getApplicationContext() 등 (0) | 2018.07.27 |
[Android Studio] EditText - Java로 수정 가능/불가능하게 만들기(editable) (0) | 2018.07.27 |
1. 일반적으로 기본값은 일단, string-array의 첫번째 아이템으로 주면 된다.
2. 하지만, 0번째 아이템이 아닌 아이템을 default로 설정해줘야할 때가 있다. 그럴 때, 아이템 번호로 한다면 헷갈리므로 String으로 정하는 게 확실할 거다.
순서는 다음과 같다
default로 줄 item이름을 검색한다 > item의 position을 가져온다 > 해당 position을 default로 세팅한다.
'Computer > Android' 카테고리의 다른 글
[Android Studio]Retrofit2 + GSON 에러 - 무한루프(?) 해결 (0) | 2018.07.27 |
---|---|
[Android Studio]retrofit+Node.js, Expected BEGIN_OBJECT but was BEGIN_ARRAY에러 (0) | 2018.07.27 |
[Android Studio] Context정리 - getContext(), getBaseContext(), getApplicationContext() 등 (0) | 2018.07.27 |
[Android Studio] EditText - Java로 수정 가능/불가능하게 만들기(editable) (0) | 2018.07.27 |
[Android Studio] Admob 광고 달기 - 배너 광고, 전면 광고 (0) | 2018.07.27 |
[Android Studio] Context정리 - getContext(), getBaseContext(), getApplicationContext() 등
| Computer/Android 2018. 7. 27. 16:29일단 Context가 뭔가? 네이버 사전에 의하면 '맥락, 정황' 뭐 이런 뜻이다. (미국 발음으론 [칸텍스트], 영국식은 [컨텍스트])
Spring Framework를 배울 때도, getContextPath()라는 게 있었다. Spring에선 기본 주소를 의미했다.
이를 테면, www.naver.com 이 기본 주소고 www.naver.com/a/bc/d 뭐 이런식으로 뭐가 붙게 되면 기본 주소가 아니다.
프로젝트 폴더 안의 특정 위치에서 가져 오려면 절대 경로가 필요하고 그때 필요했던 것이 getContextPath()였다.
이를 테면,
-project
-css
-js
-img
-view
이런식으로 있다고 치자면, 현재의 위치는 view안의 jsp파일들이고, 그것을 기준으로 하게 되면 img파일이나 다른 리소스를 찾기가 힘들다. 그래서 getContextPath()/img 와 같은 방식으로 어디서나 현재의 경로에 상관없이 절대경로로 이미지 파일을 가져올 수 있었다.
그렇다면, Android Studio에서의 Context는 무엇일까?
한글 자료에서는 뭔가 명쾌한 해답을 얻지 못하고 오히려 헷갈리기에 영어 자료를 찾아보았다.
공식 문서에서의 설명은 다음과 같다.
Interface to global information about an application environment. This is an abstract class whose implementation is provided by the Android system. It allows access to application-specific resources and classes, as well as up-calls for application-level operations such as launching activities, broadcasting and receiving intents, etc.
즉, 앱에 대한 전반적인 정보를 가지고 있는 인터페이스(Java의 인터페이스가 아니라, 어떠한 두 가지를 연결해주는 역할을 뜻하는 듯하다. 안드로이드 OS와 Java를 뜻하는 거 같다.)이며 안드로이드 시스템으로부터 제공되는 추상클래스로 Activity를 띄워준다던가, Broadcast(안드로이드 4대요소)를 한다던가, Intent를 받는다 던가와 같은 것처럼 앱의 자원과 클래스에 접근을 하도록해준다.
다음은 Stack Overflow의 내용이다.
It's the context of current state of the application/object. It lets newly-created objects understand what has been going on. Typically you call it to get information regarding another part of your program (activity and package/application).
여기서 context에 대해 물어봤는데 'It's context of ...'라는 식으로 설명하다니... '그래서 context가 뭔데?'란 생각이 잠시 들었지만, information이라고 해석하면 될 거 같다.
즉, 앱이나 객체의 현재 상태 정보인 셈.
그럼 왜 Context가 필요할까? (정확한 자료는 못 찾았지만, 사람들의 생각을 정리해보았다.)
1. 보안 문제
Context는 기억 장치의 입출력, 네트워크 자원과 그래픽에 대해 관장할 수 있다. 그러므로 context만 알게 되면 보안상에 문제가 발생될 수 있다. 자신의 앱에 접근하려는 앱의 Context를 알면 차단할 수도 있을 것.
2. 자바와 안드로이드의 연결 고리 역할
Device Location이나, 사진 찍기, 백그라운드 서비스를 돌리기 위해서 자바와 안드로이드 OS간에 연결 역할을 해주는 게 필요한 데, 이것이 context의 역할임.
그럼, 언제 사용할까??
위에서도 살짝 언급은 했지만, 이곳(Stack Overflow)을 통하면 다음과 같다고 설명한다.
- Loading a resource.
- Launching a new activity.
- Creating views.
- obtaining system service.
추가적으로 위에서 설명했듯이 다른 앱이나 자원(Device Location, Camera, Background Service)에 접근이 가능하다.
Context를 얻는 종류는 어떻게 되며 언제 사용 될까?
일단, Context 클래스를 살펴보자. (클릭)
Document에서의 정보를 빌려본다면
상수
ACCESSIBILITY_SERVICE Use with getSystemService(String) to retrieve a AccessibilityManager for giving the user feedback for UI events through the registered event listeners. |
ACCOUNT_SERVICE Use with getSystemService(String) to retrieve a AccountManager for receiving intents at a time of your choosing. |
ACTIVITY_SERVICE Use with getSystemService(String) to retrieve a ActivityManager for interacting with the global system state. |
ALARM_SERVICE Use with getSystemService(String) to retrieve a AlarmManager for receiving intents at a time of your choosing. |
APPWIDGET_SERVICE Use with getSystemService(String) to retrieve a AppWidgetManager for accessing AppWidgets. |
APP_OPS_SERVICE Use with getSystemService(String) to retrieve a AppOpsManager for tracking application operations on the device. |
AUDIO_SERVICE Use with getSystemService(String) to retrieve a AudioManager for handling management of volume, ringer modes and audio routing. |
BATTERY_SERVICE Use with getSystemService(String) to retrieve a BatteryManager for managing battery state. |
BIND_ABOVE_CLIENT Flag for bindService(Intent, ServiceConnection, int): indicates that the client application binding to this service considers the service to be more important than the app itself. |
BIND_ADJUST_WITH_ACTIVITY Flag for bindService(Intent, ServiceConnection, int): If binding from an activity, allow the target service's process importance to be raised based on whether the activity is visible to the user, regardless whether another flag is used to reduce the amount that the client process's overall importance is used to impact it. |
BIND_ALLOW_OOM_MANAGEMENT Flag for bindService(Intent, ServiceConnection, int): allow the process hosting the bound service to go through its normal memory management. |
BIND_AUTO_CREATE Flag for bindService(Intent, ServiceConnection, int): automatically create the service as long as the binding exists. |
BIND_DEBUG_UNBIND Flag for bindService(Intent, ServiceConnection, int): include debugging help for mismatched calls to unbind. |
BIND_EXTERNAL_SERVICE Flag for bindService(Intent, ServiceConnection, int): The service being bound is an isolated, external service. |
BIND_IMPORTANT Flag for bindService(Intent, ServiceConnection, int): this service is very important to the client, so should be brought to the foreground process level when the client is. |
BIND_NOT_FOREGROUND Flag for bindService(Intent, ServiceConnection, int): don't allow this binding to raise the target service's process to the foreground scheduling priority. |
BIND_WAIVE_PRIORITY Flag for bindService(Intent, ServiceConnection, int): don't impact the scheduling or memory management priority of the target service's hosting process. |
BLUETOOTH_SERVICE Use with getSystemService(String) to retrieve a BluetoothManager for using Bluetooth. |
CAMERA_SERVICE Use with getSystemService(String) to retrieve a CameraManager for interacting with camera devices. |
CAPTIONING_SERVICE Use with getSystemService(String) to retrieve a CaptioningManager for obtaining captioning properties and listening for changes in captioning preferences. |
CARRIER_CONFIG_SERVICE Use with getSystemService(String) to retrieve a CarrierConfigManager for reading carrier configuration values. |
CLIPBOARD_SERVICE Use with getSystemService(String) to retrieve a ClipboardManager for accessing and modifying the contents of the global clipboard. |
COMPANION_DEVICE_SERVICE Use with getSystemService(String) to retrieve a CompanionDeviceManager for managing companion devices |
CONNECTIVITY_SERVICE Use with getSystemService(String) to retrieve a ConnectivityManager for handling management of network connections. |
CONSUMER_IR_SERVICE Use with getSystemService(String) to retrieve a ConsumerIrManager for transmitting infrared signals from the device. |
CONTEXT_IGNORE_SECURITY Flag for use with createPackageContext(String, int): ignore any security restrictions on the Context being requested, allowing it to always be loaded. |
CONTEXT_INCLUDE_CODE Flag for use with createPackageContext(String, int): include the application code with the context. |
CONTEXT_RESTRICTED Flag for use with createPackageContext(String, int): a restricted context may disable specific features. |
CROSS_PROFILE_APPS_SERVICE Use with getSystemService(String) to retrieve a CrossProfileApps for cross profile operations. |
DEVICE_POLICY_SERVICE Use with getSystemService(String) to retrieve a DevicePolicyManager for working with global device policy management. |
DISPLAY_SERVICE Use with getSystemService(String) to retrieve a DisplayManager for interacting with display devices. |
DOWNLOAD_SERVICE Use with getSystemService(String) to retrieve a DownloadManager for requesting HTTP downloads. |
DROPBOX_SERVICE Use with getSystemService(String) to retrieve a DropBoxManager instance for recording diagnostic logs. |
EUICC_SERVICE Use with getSystemService(String) to retrieve a EuiccManager to manage the device eUICC (embedded SIM). |
FINGERPRINT_SERVICE Use with getSystemService(String) to retrieve a FingerprintManager for handling management of fingerprints. |
HARDWARE_PROPERTIES_SERVICE Use with getSystemService(String) to retrieve a HardwarePropertiesManager for accessing the hardware properties service. |
INPUT_METHOD_SERVICE Use with getSystemService(String) to retrieve a InputMethodManager for accessing input methods. |
INPUT_SERVICE Use with getSystemService(String) to retrieve a InputManager for interacting with input devices. |
IPSEC_SERVICE Use with getSystemService(String) to retrieve a IpSecManager for encrypting Sockets or Networks with IPSec. |
JOB_SCHEDULER_SERVICE Use with getSystemService(String) to retrieve a JobScheduler instance for managing occasional background tasks. |
KEYGUARD_SERVICE Use with getSystemService(String) to retrieve a NotificationManager for controlling keyguard. |
LAUNCHER_APPS_SERVICE Use with getSystemService(String) to retrieve a LauncherApps for querying and monitoring launchable apps across profiles of a user. |
LAYOUT_INFLATER_SERVICE Use with getSystemService(String) to retrieve a LayoutInflater for inflating layout resources in this context. |
LOCATION_SERVICE Use with getSystemService(String) to retrieve a LocationManager for controlling location updates. |
MEDIA_PROJECTION_SERVICE Use with getSystemService(String) to retrieve a MediaProjectionManagerinstance for managing media projection sessions. |
MEDIA_ROUTER_SERVICE Use with getSystemService(String) to retrieve a MediaRouter for controlling and managing routing of media. |
MEDIA_SESSION_SERVICE Use with getSystemService(String) to retrieve a MediaSessionManager for managing media Sessions. |
MIDI_SERVICE Use with getSystemService(String) to retrieve a MidiManager for accessing the MIDI service. |
MODE_APPEND File creation mode: for use with openFileOutput(String, int), if the file already exists then write data to the end of the existing file instead of erasing it. |
MODE_ENABLE_WRITE_AHEAD_LOGGING Database open flag: when set, the database is opened with write-ahead logging enabled by default. |
MODE_MULTI_PROCESS This constant was deprecated in API level 23. MODE_MULTI_PROCESS does not work reliably in some versions of Android, and furthermore does not provide any mechanism for reconciling concurrent modifications across processes. Applications should not attempt to use it. Instead, they should use an explicit cross-process data management approach such as ContentProvider. |
MODE_NO_LOCALIZED_COLLATORS Database open flag: when set, the database is opened without support for localized collators. |
MODE_PRIVATE File creation mode: the default mode, where the created file can only be accessed by the calling application (or all applications sharing the same user ID). |
MODE_WORLD_READABLE This constant was deprecated in API level 17. Creating world-readable files is very dangerous, and likely to cause security holes in applications. It is strongly discouraged; instead, applications should use more formal mechanism for interactions such as ContentProvider, BroadcastReceiver, and Service. There are no guarantees that this access mode will remain on a file, such as when it goes through a backup and restore. |
MODE_WORLD_WRITEABLE This constant was deprecated in API level 17. Creating world-writable files is very dangerous, and likely to cause security holes in applications. It is strongly discouraged; instead, applications should use more formal mechanism for interactions such as ContentProvider, BroadcastReceiver, and Service. There are no guarantees that this access mode will remain on a file, such as when it goes through a backup and restore. |
NETWORK_STATS_SERVICE Use with getSystemService(String) to retrieve a NetworkStatsManager for querying network usage stats. |
NFC_SERVICE Use with getSystemService(String) to retrieve a NfcManager for using NFC. |
NOTIFICATION_SERVICE Use with getSystemService(String) to retrieve a NotificationManager for informing the user of background events. |
NSD_SERVICE Use with getSystemService(String) to retrieve a NsdManager for handling management of network service discovery |
POWER_SERVICE Use with getSystemService(String) to retrieve a PowerManager for controlling power management, including "wake locks," which let you keep the device on while you're running long tasks. |
PRINT_SERVICE PrintManager for printing and managing printers and print tasks. |
RECEIVER_VISIBLE_TO_INSTANT_APPS Flag for registerReceiver(BroadcastReceiver, IntentFilter): The receiver can receive broadcasts from Instant Apps. |
RESTRICTIONS_SERVICE Use with getSystemService(String) to retrieve a RestrictionsManager for retrieving application restrictions and requesting permissions for restricted operations. |
SEARCH_SERVICE Use with getSystemService(String) to retrieve a SearchManager for handling searches. |
SENSOR_SERVICE Use with getSystemService(String) to retrieve a SensorManager for accessing sensors. |
SHORTCUT_SERVICE Use with getSystemService(String) to retrieve a ShortcutManager for accessing the launcher shortcut service. |
STORAGE_SERVICE Use with getSystemService(String) to retrieve a StorageManager for accessing system storage functions. |
STORAGE_STATS_SERVICE Use with getSystemService(String) to retrieve a StorageStatsManager for accessing system storage statistics. |
SYSTEM_HEALTH_SERVICE Use with getSystemService(String) to retrieve a SystemHealthManager for accessing system health (battery, power, memory, etc) metrics. |
TELECOM_SERVICE Use with getSystemService(String) to retrieve a TelecomManager to manage telecom-related features of the device. |
TELEPHONY_SERVICE Use with getSystemService(String) to retrieve a TelephonyManager for handling management the telephony features of the device. |
TELEPHONY_SUBSCRIPTION_SERVICE Use with getSystemService(String) to retrieve a SubscriptionManager for handling management the telephony subscriptions of the device. |
TEXT_CLASSIFICATION_SERVICE Use with getSystemService(String) to retrieve a TextClassificationManager for text classification services. |
TEXT_SERVICES_MANAGER_SERVICE Use with getSystemService(String) to retrieve a TextServicesManager for accessing text services. |
TV_INPUT_SERVICE Use with getSystemService(String) to retrieve a TvInputManager for interacting with TV inputs on the device. |
UI_MODE_SERVICE Use with getSystemService(String) to retrieve a UiModeManager for controlling UI modes. |
USAGE_STATS_SERVICE Use with getSystemService(String) to retrieve a UsageStatsManager for querying device usage stats. |
USB_SERVICE Use with getSystemService(String) to retrieve a UsbManager for access to USB devices (as a USB host) and for controlling this device's behavior as a USB device. |
USER_SERVICE Use with getSystemService(String) to retrieve a UserManager for managing users on devices that support multiple users. |
VIBRATOR_SERVICE Use with getSystemService(String) to retrieve a Vibrator for interacting with the vibration hardware. |
WALLPAPER_SERVICE Use with getSystemService(String) to retrieve a com.android.server.WallpaperService for accessing wallpapers. |
WIFI_AWARE_SERVICE Use with getSystemService(String) to retrieve a WifiAwareManager for handling management of Wi-Fi Aware. |
WIFI_P2P_SERVICE Use with getSystemService(String) to retrieve a WifiP2pManager for handling management of Wi-Fi peer-to-peer connections. |
WIFI_RTT_RANGING_SERVICE Use with getSystemService(String) to retrieve a WifiRttManager for ranging devices with wifi Note: this is a replacement for WIFI_RTT_SERVICE above. |
WIFI_SERVICE Use with getSystemService(String) to retrieve a WifiManager for handling management of Wi-Fi access. |
WINDOW_SERVICE Use with getSystemService(String) to retrieve a WindowManager for accessing the system's window manager. |
상수만 봐도 대략적으로 어떤 느낌인지 온다.
context를 얻는 방법은 다음과 같다고 한다.
getApplicationContext()
getContext()
getBaseContext()
this (Application, Activity, Service and IntentService와 같은 Context를 상속 받은 클래스는 자기 자신을 지칭하여 context사용 가능).
여기서 this와 getContext()는 동일하다고 한다.
그럼 그들의 차이를 알기 위해 이번엔 메소드에 대해 살펴보자.
bindService(Intent service, ServiceConnection conn, int flags) Connect to an application service, creating it if needed. |
checkCallingOrSelfPermission(String permission) Determine whether the calling process of an IPC or you have been granted a particular permission. |
checkCallingOrSelfUriPermission(Uri uri, int modeFlags) Determine whether the calling process of an IPC or you has been granted permission to access a specific URI. |
checkCallingPermission(String permission) Determine whether the calling process of an IPC you are handling has been granted a particular permission. |
checkCallingUriPermission(Uri uri, int modeFlags) Determine whether the calling process and user ID has been granted permission to access a specific URI. |
checkPermission(String permission, int pid, int uid) Determine whether the given permission is allowed for a particular process and user ID running in the system. |
checkSelfPermission(String permission) Determine whether you have been granted a particular permission. |
checkUriPermission(Uri uri, String readPermission, StringwritePermission, int pid, int uid, int modeFlags) Check both a Uri and normal permission. |
checkUriPermission(Uri uri, int pid, int uid, int modeFlags) Determine whether a particular process and user ID has been granted permission to access a specific URI. |
clearWallpaper() This method was deprecated in API level 5. Use WallpaperManager.clear() instead.This method requires the caller to hold the permissionManifest.permission.SET_WALLPAPER. |
createConfigurationContext(Configuration overrideConfiguration) Return a new Context object for the current Context but whose resources are adjusted to match the given Configuration. |
createContextForSplit(String splitName) Return a new Context object for the given split name. |
createDeviceProtectedStorageContext()Return a new Context object for the current Context but whose storage APIs are backed by device-protected storage. |
createDisplayContext(Display display) Return a new Context object for the current Context but whose resources are adjusted to match the metrics of the given Display. |
createPackageContext(String packageName, int flags) Return a new Context object for the given application name. |
databaseList() Returns an array of strings naming the private databases associated with this Context's application package. |
deleteDatabase(String name) Delete an existing private SQLiteDatabase associated with this Context's application package. |
deleteFile(String name) Delete the given private file associated with this Context's application package. |
deleteSharedPreferences(String name) Delete an existing shared preferences file. |
enforceCallingOrSelfPermission(String permission, String message) If neither you nor the calling process of an IPC you are handling has been granted a particular permission, throw a SecurityException. |
enforceCallingOrSelfUriPermission(Uri uri, int modeFlags, Stringmessage )If the calling process of an IPC or you has not been granted permission to access a specific URI, throw SecurityException. |
enforceCallingPermission(String permission, String message) If the calling process of an IPC you are handling has not been granted a particular permission, throw a SecurityException. |
enforceCallingUriPermission(Uri uri, int modeFlags, String message) If the calling process and user ID has not been granted permission to access a specific URI, throw SecurityException. |
enforcePermission(String permission, int pid, int uid, Stringmessage) If the given permission is not allowed for a particular process and user ID running in the system, throw a SecurityException. |
enforceUriPermission(Uri uri, String readPermission, StringwritePermission, int pid, int uid, int modeFlags, String message) Enforce both a Uri and normal permission. |
enforceUriPermission(Uri uri, int pid, int uid, int modeFlags,String message) If a particular process and user ID has not been granted permission to access a specific URI, throw SecurityException. |
fileList() Returns an array of strings naming the private files associated with this Context's application package. |
getApplicationContext() Return the context of the single, global Application object of the current process. |
getApplicationInfo() Return the full application info for this context's package. |
getAssets() Returns an AssetManager instance for the application's package. |
getCacheDir() Returns the absolute path to the application specific cache directory on the filesystem. |
getClassLoader() Return a class loader you can use to retrieve classes in this package. |
getCodeCacheDir() Returns the absolute path to the application specific cache directory on the filesystem designed for storing cached code. |
getColor(int id) Returns a color associated with a particular resource ID and styled for the current theme. |
getColorStateList(int id) Returns a color state list associated with a particular resource ID and styled for the current theme. |
getContentResolver() Return a ContentResolver instance for your application's package. |
getDataDir() Returns the absolute path to the directory on the filesystem where all private files belonging to this app are stored. |
getDatabasePath(String name) Returns the absolute path on the filesystem where a database created withopenOrCreateDatabase(String, int, SQLiteDatabase.CursorFactory) is stored. |
getDir(String name, int mode) Retrieve, creating if needed, a new directory in which the application can place its own custom data files. |
getDrawable(int id) Returns a drawable object associated with a particular resource ID and styled for the current theme. |
getExternalCacheDir() Returns absolute path to application-specific directory on the primary shared/external storage device where the application can place cache files it owns. |
getExternalCacheDirs() Returns absolute paths to application-specific directories on all shared/external storage devices where the application can place cache files it owns. |
getExternalFilesDir(String type) Returns the absolute path to the directory on the primary shared/external storage device where the application can place persistent files it owns. |
getExternalFilesDirs(String type) Returns absolute paths to application-specific directories on all shared/external storage devices where the application can place persistent files it owns. |
getExternalMediaDirs() Returns absolute paths to application-specific directories on all shared/external storage devices where the application can place media files. |
getFileStreamPath(String name) Returns the absolute path on the filesystem where a file created withopenFileOutput(String, int) is stored. |
getFilesDir() Returns the absolute path to the directory on the filesystem where files created with openFileOutput(String, int) are stored. |
getMainExecutor() Return an Executor that will run enqueued tasks on the main thread associated with this context. |
getMainLooper() Return the Looper for the main thread of the current process. |
getNoBackupFilesDir() Returns the absolute path to the directory on the filesystem similar to getFilesDir(). |
getObbDir() Return the primary shared/external storage directory where this application's OBB files (if there are any) can be found. |
getObbDirs() Returns absolute paths to application-specific directories on all shared/external storage devices where the application's OBB files (if there are any) can be found. |
getPackageCodePath() Return the full path to this context's primary Android package. |
getPackageManager() Return PackageManager instance to find global package information. |
getPackageName() Return the name of this application's package. |
getPackageResourcePath() Return the full path to this context's primary Android package. |
getResources() Returns a Resources instance for the application's package. |
getSharedPreferences(String name, int mode) Retrieve and hold the contents of the preferences file 'name', returning a SharedPreferences through which you can retrieve and modify its values. |
getString(int resId, Object... formatArgs) Returns a localized formatted string from the application's package's default string table, substituting the format arguments as defined in Formatter and String.format(String, Object...). |
getString(int resId) Returns a localized string from the application's package's default string table. |
getSystemService(Class<t> serviceClass)</t> <t></t> <t>Return the handle to a system-level service by class.</t> |
getSystemService(String name) Return the handle to a system-level service by name. |
getSystemServiceName(Class serviceClass) Gets the name of the system-level service that is represented by the specified class. |
getText(int resId) Return a localized, styled CharSequence from the application's package's default string table. |
getTheme() Return the Theme object associated with this Context. |
getWallpaper() This method was deprecated in API level 5. Use WallpaperManager.get() instead. |
getWallpaperDesiredMinimumHeight() This method was deprecated in API level 5. Use WallpaperManager.getDesiredMinimumHeight() instead. |
getWallpaperDesiredMinimumWidth() This method was deprecated in API level 5. Use WallpaperManager.getDesiredMinimumWidth() instead. |
grantUriPermission(String toPackage, Uri uri, int modeFlags) Grant permission to access a specific Uri to another package, regardless of whether that package has general permission to access the Uri's content provider. |
isDeviceProtectedStorage() Indicates if the storage APIs of this Context are backed by device-protected storage. |
isRestricted() Indicates whether this Context is restricted. |
moveDatabaseFrom(Context sourceContext, String name) Move an existing database file from the given source storage context to this context. |
moveSharedPreferencesFrom(Context sourceContext, String name) Move an existing shared preferences file from the given source storage context to this context. |
obtainStyledAttributes(AttributeSet set, int[] attrs) Retrieve styled attribute information in this Context's theme. |
obtainStyledAttributes(AttributeSet set, int[] attrs, int defStyleAttr, int defStyleRes) Retrieve styled attribute information in this Context's theme. |
obtainStyledAttributes(int resid, int[] attrs) Retrieve styled attribute information in this Context's theme. |
obtainStyledAttributes(int[] attrs) Retrieve styled attribute information in this Context's theme. |
openFileInput(String name) Open a private file associated with this Context's application package for reading. |
openFileOutput(String name, int mode) Open a private file associated with this Context's application package for writing. |
openOrCreateDatabase(String name, int mode, SQLiteDatabase.CursorFactory factory, DatabaseErrorHandler errorHandler) Open a new private SQLiteDatabase associated with this Context's application package. |
openOrCreateDatabase(String name, int mode, SQLiteDatabase.CursorFactory factory) Open a new private SQLiteDatabase associated with this Context's application package. |
peekWallpaper() This method was deprecated in API level 5. Use WallpaperManager.peek() instead. |
registerComponentCallbacks(ComponentCallbacks callback) Add a new ComponentCallbacks to the base application of the Context, which will be called at the same times as the ComponentCallbacks methods of activities and other components are called. |
registerReceiver(BroadcastReceiver receiver, IntentFilter filter) Register a BroadcastReceiver to be run in the main activity thread. |
registerReceiver(BroadcastReceiver receiver, IntentFilter filter,int flags) Register to receive intent broadcasts, with the receiver optionally being exposed to Instant Apps. |
registerReceiver(BroadcastReceiver receiver, IntentFilter filter,String broadcastPermission, Handler scheduler, int flags) Register to receive intent broadcasts, to run in the context of scheduler. |
registerReceiver(BroadcastReceiver receiver, IntentFilter filter,String broadcastPermission, Handler scheduler) Register to receive intent broadcasts, to run in the context of scheduler. |
removeStickyBroadcast(Intent intent) This method was deprecated in API level 21. Sticky broadcasts should not be used. They provide no security (anyone can access them), no protection (anyone can modify them), and many other problems. The recommended pattern is to use a non-sticky broadcast to report that something has changed, with another mechanism for apps to retrieve the current value whenever desired. |
removeStickyBroadcastAsUser(Intent intent, UserHandle user) This method was deprecated in API level 21. Sticky broadcasts should not be used. They provide no security (anyone can access them), no protection (anyone can modify them), and many other problems. The recommended pattern is to use a non-sticky broadcast to report that something has changed, with another mechanism for apps to retrieve the current value whenever desired. |
revokeUriPermission(Uri uri, int modeFlags) Remove all permissions to access a particular content provider Uri that were previously added with grantUriPermission(String, Uri, int) or any other mechanism. |
revokeUriPermission(String toPackage, Uri uri, int modeFlags) Remove permissions to access a particular content provider Uri that were previously added with grantUriPermission(String, Uri, int) for a specific target package. |
sendBroadcast(Intent intent, String receiverPermission) Broadcast the given intent to all interested BroadcastReceivers, allowing an optional required permission to be enforced. |
sendBroadcast(Intent intent) Broadcast the given intent to all interested BroadcastReceivers. |
sendBroadcastAsUser(Intent intent, UserHandle user) Version of sendBroadcast(Intent) that allows you to specify the user the broadcast will be sent to. |
sendBroadcastAsUser(Intent intent, UserHandle user, StringreceiverPermission) Version of sendBroadcast(Intent, String) that allows you to specify the user the broadcast will be sent to. |
sendOrderedBroadcast(Intent intent, String receiverPermission,BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData, Bundle initialExtras) Version of sendBroadcast(Intent) that allows you to receive data back from the broadcast. |
sendOrderedBroadcast(Intent intent, String receiverPermission) Broadcast the given intent to all interested BroadcastReceivers, delivering them one at a time to allow more preferred receivers to consume the broadcast before it is delivered to less preferred receivers. |
sendOrderedBroadcastAsUser(Intent intent, UserHandle user, StringreceiverPermission, BroadcastReceiver resultReceiver, Handlerscheduler, int initialCode, String initialData, BundleinitialExtras) Version of sendOrderedBroadcast(Intent, String, BroadcastReceiver, Handler, int, String, Bundle) that allows you to specify the user the broadcast will be sent to. |
sendStickyBroadcast(Intent intent) This method was deprecated in API level 21. Sticky broadcasts should not be used. They provide no security (anyone can access them), no protection (anyone can modify them), and many other problems. The recommended pattern is to use a non-sticky broadcast to report that something has changed, with another mechanism for apps to retrieve the current value whenever desired. |
sendStickyBroadcastAsUser(Intent intent, UserHandle user) This method was deprecated in API level 21. Sticky broadcasts should not be used. They provide no security (anyone can access them), no protection (anyone can modify them), and many other problems. The recommended pattern is to use a non-sticky broadcast to report that something has changed, with another mechanism for apps to retrieve the current value whenever desired. |
sendStickyOrderedBroadcast(Intent intent, BroadcastReceiverresultReceiver, Handler scheduler, int initialCode, StringinitialData, Bundle initialExtras) This method was deprecated in API level 21. Sticky broadcasts should not be used. They provide no security (anyone can access them), no protection (anyone can modify them), and many other problems. The recommended pattern is to use a non-sticky broadcast to report that something has changed, with another mechanism for apps to retrieve the current value whenever desired. |
sendStickyOrderedBroadcastAsUser(Intent intent, UserHandle user,BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData, Bundle initialExtras) This method was deprecated in API level 21. Sticky broadcasts should not be used. They provide no security (anyone can access them), no protection (anyone can modify them), and many other problems. The recommended pattern is to use a non-sticky broadcast to report that something has changed, with another mechanism for apps to retrieve the current value whenever desired. |
setTheme(int resid) Set the base theme for this context. |
setWallpaper(Bitmap bitmap) This method was deprecated in API level 5. Use WallpaperManager.set() instead.This method requires the caller to hold the permissionManifest.permission.SET_WALLPAPER. |
setWallpaper(InputStream data) This method was deprecated in API level 5. Use WallpaperManager.set() instead.This method requires the caller to hold the permissionManifest.permission.SET_WALLPAPER. |
startActivities(Intent[] intents, Bundle options) Launch multiple new activities. |
startActivities(Intent[] intents) Same as startActivities(Intent[], Bundle) with no options specified. |
startActivity(Intent intent) Same as startActivity(Intent, Bundle) with no options specified. |
startActivity(Intent intent, Bundle options) Launch a new activity. |
startForegroundService(Intent service) Similar to startService(Intent), but with an implicit promise that the Service will call startForeground(int, android.app.Notification) once it begins running. |
startInstrumentation(ComponentName className, String profileFile,Bundle arguments) Start executing an Instrumentation class. |
startIntentSender(IntentSender intent, Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags) Same as startIntentSender(IntentSender, Intent, int, int, int, Bundle) with no options specified. |
startIntentSender(IntentSender intent, Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags, Bundle options) Like startActivity(Intent, Bundle), but taking a IntentSender to start. |
startService(Intent service) Request that a given application service be started. |
stopService(Intent service) Request that a given application service be stopped. |
unbindService(ServiceConnection conn) Disconnect from an application service. |
unregisterComponentCallbacks(ComponentCallbacks callback) Remove a ComponentCallbacks object that was previously registered with registerComponentCallbacks(ComponentCallbacks). |
unregisterReceiver(BroadcastReceiver receiver) Unregister a previously registered BroadcastReceiver. |
메소드를 살펴보니 대략, 정말, System, 패키지에 대한 내용부터 파일, 데이터베이스(SQLite를 의미하는 듯), sharedPreference, Service, Broadcat, Activity, Foreground, Intent 등와 같은 내용들이 들어 있었다.
대충, 어떤 느낌인지는 알겠지만, sharedPreference빼고는 그것들을 사용한 적이 없어서 잘 모르겠다.
그래. 대충 요런 놈이구나.
엥? 근데 getContext(), getApplicationContext(), getBaseContext()가 보이지 않는다. 왜 일까?
당연하다. 이게 Context자체니까. 그 메소드들을 사용하면 Context 객체를 얻는 거다.
getContext(), getApplicationContext(), getBaseContext()
그럼 이 세놈들은 어디에 속해있을까?
생각을 해보니, 개발을 할 때, 평소에 이 셋 중에 하나만 자동완성에 나와서 그냥 생각없이 사용했던 거 같다.
(개발을 하면서 잉? 왜 이번엔 getApplicationContext()지? 뭐, 같은 context라고 써져있으니 비슷한 놈이 겠거니 하고 썼었다.)
직접 확인해본 결과,
Activity - getApplicationContext(), getBaseContext()
Fragment, Adapter, View - getContext()
이렇게 나왔다. (아직 초보라서 다른 클래스는 모르겠다.)
왜 이 넷은 이렇게 다를까?
일단, 내가 알고 있는 한, Activity는 Fragment, View, Adapter를 포함할 수 있는(상위) 개념이다.
(그렇다고, 상속의 의미인 ancestor이란 의미는 아니고, Activity가 있어야 그 안에 구성(작업)할 수 있다는 것이다.)
이 네 가지 클래스에 대해서 공식문서를 살펴보자.
Activity
getContext(), getApplicationContext(), getBaseContext()는 찾을 수 없었다.
그래서 Android Studio에서 분석해보기로 했다. 메소드를 생성한 후에 Ctrl를 누른 후 메소드를 클릭하는 식으로 역추적했다.
이런식으로 되어있었다.
ContextWrapper에 자리잡고 있었던 것. 그럼? ContextWrapper를 공식문서에서 찾아보자.
getApplicationContext()와 getBaseContext()가 있었다. 그 둘의 내용을 찾아보자면,
Return the context of the single, global Application object of the current process.
자세하게는...
public Context getApplicationContext ()
Return the context of the single, global Application object of the current process. This generally should only be used if you need a Context whose lifecycle is separate from the current context, that is tied to the lifetime of the process rather than the current component.
Consider for example how this interacts with registerReceiver(BroadcastReceiver, IntentFilter):
- If used from an Activity context, the receiver is being registered within that activity. This means that you are expected to unregister before the activity is done being destroyed; in fact if you do not do so, the framework will clean up your leaked registration as it removes the activity and log an error. Thus, if you use the Activity context to register a receiver that is static (global to the process, not associated with an Activity instance) then that registration will be removed on you at whatever point the activity you used is destroyed.
- If used from the Context returned here, the receiver is being registered with the global state associated with your application. Thus it will never be unregistered for you. This is necessary if the receiver is associated with static data, not a particular component. However using the ApplicationContext elsewhere can easily lead to serious leaks if you forget to unregister, unbind, etc.
Returns
Context
getApplicationContext()는 이렇게 장황하게 설명되어있는 반면, getBaseContext()는
the base context as set by the constructor or setBaseContext
이렇게 밖에 써져있지 않았다.
이제 Stack Overflow에게 물어봐야지.
View.getContext(): Returns the context the view is currently running in. Usually the currently active Activity.
Activity.getApplicationContext(): Returns the context for the entire application (the process all the Activities are running inside of). Use this instead of the current Activity context if you need a context tied to the lifecycle of the entire application, not just the current Activity.
ContextWrapper.getBaseContext(): If you need access to a Context from within another context, you use a ContextWrapper. The Context referred to from inside that ContextWrapper is accessed via getBaseContext().
그러니까,
getContext()는 현재 실행된 View(보통(?) 활성화된 Activity의 View)의 Context를 반환한다.
getApplicationContext()는 앱에 대한 모든 것을 가진 context를 반환(모든 엑티비티). 하나의 Activity내에서 가 아니라, 앱의 Lifecycle에 context가 묶여 있는 경우, getApplicationContext()로 해야한다.
getBaseContext()는 다른 context안에서 또 다른 context에 접근을 하기 위해 ContextWrapper를 사용한다. 이를테면, ContextWrapper의 안쪽에서 참조될 Context는 getBaseContext()를 통해 접근된다. (말이 어렵네)
Acitivy는 getApplicationContext()를 가지고 있지 않았는데, 무슨 소리지???
하여간, ContextWrapper가 getApplicationContext()와 getBaseContext()를 가지고 있고, 쓰임새가 위와 같이 서로 다르다는 것.
뭐... 그렇단다.
Fragment, Adapter, View를 역추적해서 찾아봤는데, 다음과 같이 생겼다.
따로 굳이 찾아볼 필요도 없을 것 같다. 그냥 현재의 Activity의 Context를 반환한다는 것이니까.
그리고,
결론을 지을만한(?) 자료를 찾았다.
이거에 맞춰서 조심스레 작업해야겠다.
결론적으로, 대한민국을 안드로이드 시스템, 앱을 하나의 종합 대학교라고 친다면, 액티비티는 단과 대학이고,
ApplicationContext는 종합 대학교에 대한 정보.
Context는 단과 대학에 대한 정보.
BaseContext는 다른 대학에 갈 때 또 다른 대학에 대한 정보(?) 뭐 이런 느낌인 거 같다.
끝.
'Computer > Android' 카테고리의 다른 글
[Android Studio]retrofit+Node.js, Expected BEGIN_OBJECT but was BEGIN_ARRAY에러 (0) | 2018.07.27 |
---|---|
[Android Studio] Spinner, default 주기 (0) | 2018.07.27 |
[Android Studio] EditText - Java로 수정 가능/불가능하게 만들기(editable) (0) | 2018.07.27 |
[Android Studio] Admob 광고 달기 - 배너 광고, 전면 광고 (0) | 2018.07.27 |
[Android Studio] 두 Fragment 간의 화면 전환 그리고 데이터 넘기기 (0) | 2018.07.27 |