c
기본 SMS 앱 만들기 (1) 본문
시작하기에 앞서 아래 사이트를 참조하면 좋다.
http://android-developers.blogspot.kr/2013/10/getting-your-sms-apps-ready-for-kitkat.html (영문)
http://android-developers-kr.blogspot.kr/2013/10/blog-post_15.html (국문 번역)
위 사이트를 참조하면 기본 SMS 앱으로 설정되려면, 아래와 같이 두 개의 BroadcastReciever(SMS_DELIVER 와 WAP_PUSH_DELIVER action 을 받을 수 있는)와 sms, smsto, mms, mmsto scheme 을 받아줄 수 있는 Activity, 그리고, RESPOND_VIA_MESSAGE action 을 받을 수 있는 Service 가 구현되어 있어야 한다.
<manifest> ... <application> <!-- BroadcastReceiver that listens for incoming SMS messages --> <receiver android:name=".SmsReceiver" android:permission="android.permission.BROADCAST_SMS"> <intent-filter> <action android:name="android.provider.Telephony.SMS_DELIVER" /> </intent-filter> </receiver> <!-- BroadcastReceiver that listens for incoming MMS messages --> <receiver android:name=".MmsReceiver" android:permission="android.permission.BROADCAST_WAP_PUSH"> <intent-filter> <action android:name="android.provider.Telephony.WAP_PUSH_DELIVER" /> <data android:mimeType="application/vnd.wap.mms-message" /> </intent-filter> </receiver> <!-- Activity that allows the user to send new SMS/MMS messages --> <activity android:name=".ComposeSmsActivity" > <intent-filter> <action android:name="android.intent.action.SEND" /> <action android:name="android.intent.action.SENDTO" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="sms" /> <data android:scheme="smsto" /> <data android:scheme="mms" /> <data android:scheme="mmsto" /> </intent-filter> </activity> <!-- Service that delivers messages from the phone "quick response" --> <service android:name=".HeadlessSmsSendService" android:permission="android.permission.SEND_RESPOND_VIA_MESSAGE" android:exported="true" > <intent-filter> <action android:name="android.intent.action.RESPOND_VIA_MESSAGE" /> <category android:name="android.intent.category.DEFAULT" /> <data android:scheme="sms" /> <data android:scheme="smsto" /> <data android:scheme="mms" /> <data android:scheme="mmsto" /> </intent-filter> </service> </application> </manifest>