AI2 Component  (Version nb184)
com.google.appinventor.components.runtime.util.SmsBroadcastReceiver Class Reference
Inheritance diagram for com.google.appinventor.components.runtime.util.SmsBroadcastReceiver:

Public Member Functions

void onReceive (Context context, Intent intent)
 

Static Public Attributes

static final String TAG = "SmsBroadcastReceiver"
 
static final int NOTIFICATION_ID = 8647
 

Detailed Description

This broadcast receiver accepts incoming SMS messages from either Messaging, the built in Android SMS program or from Google Voice (which must be installed on the user's phone. The receiver will be invoked by the system even when the app is not running.

The receiver does not need to be instantiated in the app. The receiver is declared statically in the <application> tag but outside the <activity> tag in the Manifest:

 <receiver
     android:name="org.hfoss.SmsBroadcastReceiver"
     android:enabled="true"
     android:exported="true" >
     <intent-filter>
         <action android:name="android.provider.Telephony.SMS_RECEIVED" />
         <action
             android:name="com.google.android.apps.googlevoice.SMS_RECEIVED"
             android:permission="com.google.android.apps.googlevoice.permission.RECEIVE_SMS" />
     </intent-filter>
 </receiver>
Author
rmorelli

Definition at line 55 of file SmsBroadcastReceiver.java.

Member Function Documentation

◆ onReceive()

void com.google.appinventor.components.runtime.util.SmsBroadcastReceiver.onReceive ( Context  context,
Intent  intent 
)

Called by the system when an incoming SMS is received either from Google Voice or through the built-in Telephony app.

Definition at line 66 of file SmsBroadcastReceiver.java.

Member Data Documentation

◆ NOTIFICATION_ID

final int com.google.appinventor.components.runtime.util.SmsBroadcastReceiver.NOTIFICATION_ID = 8647
static

Definition at line 58 of file SmsBroadcastReceiver.java.

◆ TAG

final String com.google.appinventor.components.runtime.util.SmsBroadcastReceiver.TAG = "SmsBroadcastReceiver"
static

Definition at line 57 of file SmsBroadcastReceiver.java.


The documentation for this class was generated from the following file: