기본 콘텐츠로 건너뛰기

[android] 4대 컴포넌트 (Activity, Service, Broadcast Receiver, Content Provider)

android 4대 컴포넌트(Components)


1. Activity
 - UI화면을 구성
 - 하나의 어플리케이션에서 여러 Activity사용 가능

2. Service
 - background에서 실행되는 것
 예) 음악재생

3. Broadcase Receiver
 - 어플리케이션에서 특정 브로드캐스트를 수신했을 때 처리 가능
 예) wifi연결, 데이터 연결, sms 메시지 도착 등등

4. Content Provider
 - 어플리케이션 사이의 DATA를 공유

댓글

이 블로그의 인기 게시물

[android] viewPager setOffscreenPageLimit 미리 로딩하기

viewpager를 사용할 때 이전 혹은 다음페이지를 몇개까지 미리 로딩할지 정하는 함수이다. 전체 5page가 있는데 현재 1page를 보고 있다고 가정했을 때  2, 3, 4, 5페이지를 모두 미리 로딩하고 싶다면 setOffscreenPageLimit(4)를 사용하면 된다. 따로 setOffscreenPageLimit 를 지정하지 않았을 경우, default값은 1이다. 다음과 같이 적용가능 하다. Colored By Color Scripter ™ 1 2 3 ViewPager mViewPager = (ViewPager) findViewById(R.id.pager);         mViewPager.setAdapter(storePagerAdapter);          mViewPager.setOffscreenPageLimit(4) ;

[android] textview 옆에 image 추가하기.

xml페이지에 다음과 같이 구현 android:drawableLeft  : 텍스트 왼쪽에 이미지 추가. android:drawableRight : 텍스트 오른쪽에 이미지 추가. Left, Right 외에도 top, bottom, start, end가 있다. android:drawablePadding : 이미지의 공간 (텍스트와 이미지 사이의 간격을 띄울 때 주로 사용.) <TextView           android:layout_width="wrap_content"           android:layout_height="wrap_content"           android:text="오른쪽에 마크"           android:drawableRight="@drawable/mark"           android:drawablePadding="10dp" />

[android] url scheme 사용하기 (웹에서 앱 호출 및 앱에서 앱 호출)

[호출될 앱] 다른 앱이나 웹에서 호출될 앱의 AndroidManifest.xml 파일을 열어 원하는 activity에 아래와 같이 빨간 부분을 추가 한다. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 <activity             android:name= ".testUrlScheme"             android:label= "@string/app_name" >             <intent-filter>                 <action android:name= "android.intent.action.MAIN"  />                 <category android:name= "android.intent.category.LAUNCHER"  />             </intent-filter>             ...