I need to listen to all incoming and outgoing sms and save them in a text file. To do this, I use a broadcast listener to listen to all incoming messages. It works great. But for outgoing SMS, how to register a content observer without activity? I do not want to do any activity in my application. Now the broadcast receiver is tapped even after a reboot, will the content observer be tapped even after a reboot? How to combine these two functions?
Here is part of my manifest.xml
<receiver class="map" android:name=".map" android:enabled="true"> <intent-filter> <action android:value="android.provider.Telephony.SMS_RECEIVED" android:name="android.provider.Telephony.SMS_RECEIVED" /> </intent-filter> </receiver>
Here's the class extending the broadcast receiver
public class map extends BroadcastReceiver { private static final String ACTION = "android.provider.Telephony.SMS_RECEIVED"; public void onReceive(Context context, Intent intent) {
Any help is appreciated. Thanks.
source share