AI2 Component  (Version nb184)
com.google.appinventor.components.runtime.PhoneCall Class Reference
Inheritance diagram for com.google.appinventor.components.runtime.PhoneCall:
com.google.appinventor.components.runtime.AndroidNonvisibleComponent com.google.appinventor.components.runtime.Component com.google.appinventor.components.runtime.OnDestroyListener com.google.appinventor.components.runtime.ActivityResultListener com.google.appinventor.components.runtime.Component

Public Member Functions

 PhoneCall (ComponentContainer container)
 
void Initialize ()
 
String PhoneNumber ()
 
void PhoneNumber (String phoneNumber)
 
void MakePhoneCall ()
 
void MakePhoneCallDirect ()
 
void PhoneCallStarted (int status, String phoneNumber)
 
void PhoneCallEnded (int status, String phoneNumber)
 
void IncomingCallAnswered (String phoneNumber)
 
void resultReturned (int requestCode, int resultCode, Intent data)
 
void onDestroy ()
 
- Public Member Functions inherited from com.google.appinventor.components.runtime.AndroidNonvisibleComponent
HandlesEventDispatching getDispatchDelegate ()
 

Additional Inherited Members

- Static Public Attributes inherited from com.google.appinventor.components.runtime.Component
static final String ASSET_DIRECTORY = "component"
 
static final int ALIGNMENT_NORMAL = 0
 
static final int ALIGNMENT_CENTER = 1
 
static final int ALIGNMENT_OPPOSITE = 2
 
static final int ACCELEROMETER_SENSITIVITY_WEAK = 1
 
static final int ACCELEROMETER_SENSITIVITY_MODERATE = 2
 
static final int ACCELEROMETER_SENSITIVITY_STRONG = 3
 
static final int BUTTON_SHAPE_DEFAULT = 0
 
static final int BUTTON_SHAPE_ROUNDED = 1
 
static final int BUTTON_SHAPE_RECT = 2
 
static final int BUTTON_SHAPE_OVAL = 3
 
static final int COLOR_NONE = 0x00FFFFFF
 
static final int COLOR_BLACK = 0xFF000000
 
static final int COLOR_BLUE = 0xFF0000FF
 
static final int COLOR_CYAN = 0xFF00FFFF
 
static final int COLOR_DKGRAY = 0xFF444444
 
static final int COLOR_GRAY = 0xFF888888
 
static final int COLOR_GREEN = 0xFF00FF00
 
static final int COLOR_LTGRAY = 0xFFCCCCCC
 
static final int COLOR_MAGENTA = 0xFFFF00FF
 
static final int COLOR_ORANGE = 0xFFFFC800
 
static final int COLOR_PINK = 0xFFFFAFAF
 
static final int COLOR_RED = 0xFFFF0000
 
static final int COLOR_WHITE = 0xFFFFFFFF
 
static final int COLOR_YELLOW = 0xFFFFFF00
 
static final int COLOR_DEFAULT = 0x00000000
 
static final String DEFAULT_VALUE_COLOR_NONE = "&H00FFFFFF"
 
static final String DEFAULT_VALUE_COLOR_BLACK = "&HFF000000"
 
static final String DEFAULT_VALUE_COLOR_BLUE = "&HFF0000FF"
 
static final String DEFAULT_VALUE_COLOR_CYAN = "&HFF00FFFF"
 
static final String DEFAULT_VALUE_COLOR_DKGRAY = "&HFF444444"
 
static final String DEFAULT_VALUE_COLOR_GRAY = "&HFF888888"
 
static final String DEFAULT_VALUE_COLOR_GREEN = "&HFF00FF00"
 
static final String DEFAULT_VALUE_COLOR_LTGRAY = "&HFFCCCCCC"
 
static final String DEFAULT_VALUE_COLOR_MAGENTA = "&HFFFF00FF"
 
static final String DEFAULT_VALUE_COLOR_ORANGE = "&HFFFFC800"
 
static final String DEFAULT_VALUE_COLOR_PINK = "&HFFFFAFAF"
 
static final String DEFAULT_VALUE_COLOR_RED = "&HFFFF0000"
 
static final String DEFAULT_VALUE_COLOR_WHITE = "&HFFFFFFFF"
 
static final String DEFAULT_VALUE_COLOR_YELLOW = "&HFFFFFF00"
 
static final String DEFAULT_VALUE_COLOR_DEFAULT = "&H00000000"
 
static final float FONT_DEFAULT_SIZE = 14
 
static final int LAYOUT_ORIENTATION_HORIZONTAL = ComponentConstants.LAYOUT_ORIENTATION_HORIZONTAL
 
static final int LAYOUT_ORIENTATION_VERTICAL = ComponentConstants.LAYOUT_ORIENTATION_VERTICAL
 
static final int SCALING_SCALE_PROPORTIONALLY = 0
 
static final int SCALING_SCALE_TO_FIT = 1
 
static final int TYPEFACE_DEFAULT = 0
 
static final int TYPEFACE_SANSSERIF = 1
 
static final int TYPEFACE_SERIF = 2
 
static final int TYPEFACE_MONOSPACE = 3
 
static final int LENGTH_PREFERRED = -1
 
static final int LENGTH_FILL_PARENT = -2
 
static final int LENGTH_UNKNOWN = -3
 
static final int LENGTH_PERCENT_TAG = -1000
 
static final int TOAST_LENGTH_SHORT = 0
 
static final int TOAST_LENGTH_LONG = 1
 
static final int DIRECTION_NORTH = 1
 
static final int DIRECTION_NORTHEAST = 2
 
static final int DIRECTION_EAST = 3
 
static final int DIRECTION_SOUTHEAST = 4
 
static final int DIRECTION_SOUTH = -1
 
static final int DIRECTION_SOUTHWEST = -2
 
static final int DIRECTION_WEST = -3
 
static final int DIRECTION_NORTHWEST = -4
 
static final int DIRECTION_NONE = 0
 
static final int DIRECTION_MIN = -4
 
static final int DIRECTION_MAX = 4
 
static float SLIDER_MIN_VALUE = 10
 
static float SLIDER_MAX_VALUE = 50
 
static float SLIDER_THUMB_VALUE = (SLIDER_MIN_VALUE + SLIDER_MAX_VALUE) / 2.0f
 
static final String DEFAULT_VALUE_TEXT_TO_SPEECH_COUNTRY = ""
 
static final String DEFAULT_VALUE_TEXT_TO_SPEECH_LANGUAGE = ""
 
- Protected Member Functions inherited from com.google.appinventor.components.runtime.AndroidNonvisibleComponent
 AndroidNonvisibleComponent (Form form)
 
- Protected Attributes inherited from com.google.appinventor.components.runtime.AndroidNonvisibleComponent
final Form form
 

Detailed Description

PhoneCall component icon

A non-visible component that makes a phone call to the number specified in the PhoneNumber() property, which can be set either in the Designer or Blocks Editor. The component has a MakePhoneCall() method, enabling the program to launch a phone call. You may also use MakePhoneCallDirect() to directly initiate a phone call without user interaction. However, apps using this block may require further review by Google if submitted to the Play Store so it is advised to use MakePhoneCall() instead.

Often, this component is used with the ContactPicker component, which lets the user select a contact from the ones stored on the phone and sets the PhoneNumber() property to ContactPicker#PhoneNumber() property.

To directly specify the phone number (e.g., 650-555-1212), set the PhoneNumber() property to a Text with the specified digits (e.g., "6505551212"). Dashes, dots, and parentheses may be included (e.g., "(650)-555-1212") but will be ignored; spaces may not be included.

@internaldoc

TODO(markf): Note that the initial carrier for Android phones only supports 3 participants in a conference call, so that's all that the current implementation of this component supports. In the future we can generalize this to more participants.

Author
markf.nosp@m.@goo.nosp@m.gle.c.nosp@m.om (Mark Friedman)
rekyg.nosp@m.x@gm.nosp@m.ail.c.nosp@m.om (Xian Gao)

Definition at line 80 of file PhoneCall.java.

Constructor & Destructor Documentation

◆ PhoneCall()

com.google.appinventor.components.runtime.PhoneCall.PhoneCall ( ComponentContainer  container)

Creates a Phone Call component.

Parameters
containercontainer, component will be placed in

Definition at line 98 of file PhoneCall.java.

Member Function Documentation

◆ IncomingCallAnswered()

void com.google.appinventor.components.runtime.PhoneCall.IncomingCallAnswered ( String  phoneNumber)

Event indicating that an incoming phone call is answered. phoneNumber{:.variable.block} is the incoming call phone number.

Parameters
phoneNumberincoming call phone number

Definition at line 249 of file PhoneCall.java.

◆ Initialize()

void com.google.appinventor.components.runtime.PhoneCall.Initialize ( )

Definition at line 108 of file PhoneCall.java.

◆ MakePhoneCall()

void com.google.appinventor.components.runtime.PhoneCall.MakePhoneCall ( )

Launches the default dialer app set to start a phone call using the number in the PhoneNumber() property.

Definition at line 146 of file PhoneCall.java.

◆ MakePhoneCallDirect()

void com.google.appinventor.components.runtime.PhoneCall.MakePhoneCallDirect ( )

Directly initiates a phone call using the number in the PhoneNumber() property, bypassing user interaction to start the call. Most apps should use MakePhoneCall() instead, which requires no permissions.

Definition at line 161 of file PhoneCall.java.

◆ onDestroy()

void com.google.appinventor.components.runtime.PhoneCall.onDestroy ( )

◆ PhoneCallEnded()

void com.google.appinventor.components.runtime.PhoneCall.PhoneCallEnded ( int  status,
String  phoneNumber 
)

Event indicating that a phone call has ended. The status{:.variable.block} can be any of:

  • 1: Incoming call was missed or rejected
  • 2: Incoming call was answered and hung up
  • 3: Outgoing call was hung up.
Parameters
status1:incoming call is missed or rejected; 2:incoming call is answered before hanging up; 3:Outgoing call is hung up.
phoneNumberended call phone number

Definition at line 229 of file PhoneCall.java.

◆ PhoneCallStarted()

void com.google.appinventor.components.runtime.PhoneCall.PhoneCallStarted ( int  status,
String  phoneNumber 
)

Event indicating that a phone call has started. The status{:.variable.block} can be any of:

  • 1: Incoming call is ringing
  • 2: Outgoing call is dialled
Parameters
status1:incoming call is ringing; 2:outgoing call is dialled.
phoneNumberincoming/outgoing call phone number

Definition at line 201 of file PhoneCall.java.

◆ PhoneNumber() [1/2]

String com.google.appinventor.components.runtime.PhoneCall.PhoneNumber ( )

PhoneNumber property getter method.

Definition at line 125 of file PhoneCall.java.

◆ PhoneNumber() [2/2]

void com.google.appinventor.components.runtime.PhoneCall.PhoneNumber ( String  phoneNumber)

Specifies the phone number to call.

Parameters
phoneNumbera phone number to call

Definition at line 136 of file PhoneCall.java.

◆ resultReturned()

void com.google.appinventor.components.runtime.PhoneCall.resultReturned ( int  requestCode,
int  resultCode,
Intent  data 
)

The callback method used to report Activity results back to the caller.

Parameters
requestCodethe originally passed in request code. Used to identify the call.
resultCodethe returned result code: android.app.Activity#RESULT_OK or android.app.Activity#RESULT_CANCELED
datathe returned data, encapsulated as an Intent.

Implements com.google.appinventor.components.runtime.ActivityResultListener.

Definition at line 255 of file PhoneCall.java.


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