public final class AppUtil
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static void |
showAppInfo(android.content.Context context)
Starts the settings app in order to show the information about the current app.
|
static void |
showAppInfo(android.content.Context context,
java.lang.String packageName)
Starts the settings app in order to show the information about a specific app.
|
static void |
startCall(android.content.Context context,
int phoneNumber)
Starts the dialer in order to call a specific phone number.
|
static void |
startCall(android.content.Context context,
long phoneNumber)
Starts the dialer in order to call a specific phone number.
|
static void |
startCall(android.content.Context context,
java.lang.String phoneNumber)
Starts the dialer in order to call a specific phone number.
|
static void |
startCameraApp(android.app.Activity activity,
int requestCode,
java.io.File file)
Starts the camera app in order to capture a picture.
|
static void |
startCameraApp(android.app.Activity activity,
int requestCode,
android.net.Uri uri)
Starts the camera app in order to capture a picture.
|
static void |
startDialer(android.content.Context context,
int phoneNumber)
Starts the dialer in order to call a specific phone number.
|
static void |
startDialer(android.content.Context context,
long phoneNumber)
Starts the dialer in order to call a specific phone number.
|
static void |
startDialer(android.content.Context context,
java.lang.String phoneNumber)
Starts the dialer in order to call a specific phone number.
|
static void |
startGalleryApp(android.app.Activity activity,
int requestCode)
Starts the gallery app in order to choose a picture.
|
static void |
startGalleryApp(android.content.Context context,
java.io.File file)
Starts the gallery app in order to show a specific image.
|
static void |
startGalleryApp(android.content.Context context,
android.net.Uri uri)
Starts the gallery app in order to show a specific image.
|
static void |
startMailClient(android.content.Context context,
java.lang.String emailAddress)
Starts the mail client in order to send an e-mail to a specific e-mail address.
|
static void |
startMailClient(android.content.Context context,
java.lang.String[] emailAddresses)
Starts the mail client in order to send an e-mail to specific e-mail addresses.
|
static void |
startMailClient(android.content.Context context,
java.lang.String[] emailAddresses,
java.lang.String subject,
java.lang.String text)
Starts the mail client in order to send an e-mail to specific e-mail addresses.
|
static void |
startMailClient(android.content.Context context,
java.lang.String emailAddress,
java.lang.String subject,
java.lang.String text)
Starts the mail client in order to send an e-mail to a specific e-mail address.
|
static void |
startWebBrowser(android.content.Context context,
java.lang.String uri)
Starts the web browser in order to show a specific URI.
|
static void |
startWebBrowser(android.content.Context context,
android.net.Uri uri)
Starts the web browser in order to show a specific URI.
|
public static void startCameraApp(android.app.Activity activity,
int requestCode,
java.io.File file)
ActivityNotFoundException will be thrown.activity - The activity, the captured picture should be passed to by calling its
onActivityResult method, as an instance of the class Activity.
The activity may not be nullrequestCode - The request code, which should be used to pass the captured picture to the given
activity, as an Integer valuefile - The file, the captured picture should be saved to, as an instance of the class File. The file may not be null. The file must exist and must not be a directory.public static void startCameraApp(android.app.Activity activity,
int requestCode,
android.net.Uri uri)
ActivityNotFoundException will be thrown.activity - The activity, the captured picture should be passed to by calling its
onActivityResult method, as an instance of the class Activity.
The activity may not be nullrequestCode - The request code, which should be used to pass the captured picture to the given
activity, as an Integer valueuri - The URI of the file, the captured image should be saved to, as an instance of the
class Uri. The URI may not be nullpublic static void startGalleryApp(android.app.Activity activity,
int requestCode)
ActivityNotFoundException will be thrown.activity - The activity, the chosen image should be passed to by calling its
onActivityResult method, as an instance of the class Activity.
The activity may not be nullrequestCode - The request code, which should be used to pass the captured picture to the given
activity, as an Integer valuepublic static void startGalleryApp(android.content.Context context,
java.io.File file)
ActivityNotFoundException will be thrown.context - The context, the gallery app should be started from, as an instance of the class
Context. The context may not be nullfile - The file, which stores the image, which should be shown, as an instance of the class
File. The file may not be null. The file must exist and must not be a
directory.public static void startGalleryApp(android.content.Context context,
android.net.Uri uri)
ActivityNotFoundException will be thrown.context - The context, the gallery app should be started from, as an instance of the class
Context. The context may not be nulluri - The URI of the image, which should be shown, as an instance of the class Uri.
The URI may not be null and must be validpublic static void startWebBrowser(android.content.Context context,
java.lang.String uri)
ActivityNotFoundException will be thrown.context - The context, the web browser should be started from, as an instance of the class
Context. The context may not be nulluri - The URI, which should be shown, as a String. The URI may neither be null, nor
emptypublic static void startWebBrowser(android.content.Context context,
android.net.Uri uri)
ActivityNotFoundException will be thrown.context - The context, the web browser should be started from, as an instance of the class
Context. The context may not be nulluri - The URI, which should be shown, as an instance of the class Uri. The URI may
not be nullpublic static void startMailClient(android.content.Context context,
java.lang.String emailAddress)
ActivityNotFoundException will be thrown.context - The context, the mail client should be started from, as an instance of the class
Context. The context may not be nullemailAddress - The e-mail address, the e-mail should be sent to, as a String. The e-mail
address may neither be null, nor emptypublic static void startMailClient(android.content.Context context,
java.lang.String emailAddress,
java.lang.String subject,
java.lang.String text)
ActivityNotFoundException will be thrown.context - The context, the mail client should be started from, as an instance of the class
Context. The context may not be nullemailAddress - The e-mail address, the e-mail should be sent to, as a String. The e-mail
address may neither be null, nor emptysubject - The subject of the e-mail, which should be sent, as a String or null, if the
e-mail should not have a subjecttext - The text of the e-mail, which should be sent, as a String or null, if the
e-mail should not have a textpublic static void startMailClient(android.content.Context context,
java.lang.String[] emailAddresses)
ActivityNotFoundException will be thrown.context - The context, the mail client should be started from, as an instance of the class
Context. The context may not be nullemailAddresses - An array, which contains the e-mail addresses, the e-mail should be sent to, as a
String array. The array may neither be null, nor emptypublic static void startMailClient(android.content.Context context,
java.lang.String[] emailAddresses,
java.lang.String subject,
java.lang.String text)
ActivityNotFoundException will be thrown.context - The context, the mail client should be started from, as an instance of the class
Context. The context may not be nullemailAddresses - An array, which contains the e-mail addresses, the e-mail should be sent to, as a
String array. The array may neither be null, nor emptysubject - The subject of the e-mail, which should be sent, as a String or null, if the
e-mail should not have a subjecttext - The text of the e-mail, which should be sent, as a String or null, if the
e-mail should not have a textpublic static void startDialer(android.content.Context context,
int phoneNumber)
ActivityNotFoundException will be thrown.context - The context, the dialer should be started from, as an instance of the class Context. The context may not be nullphoneNumber - The phone number, which should be dialed, as an Integer valuepublic static void startDialer(android.content.Context context,
long phoneNumber)
ActivityNotFoundException will be thrown.context - The context, the dialer should be started from, as an instance of the class Context. The context may not be nullphoneNumber - The phone number, which should be dialed, as a Long valuepublic static void startDialer(android.content.Context context,
java.lang.String phoneNumber)
ActivityNotFoundException will be thrown.context - The context, the dialer should be started from, as an instance of the class Context. The context may not be nullphoneNumber - The phone number, which should be dialed, as a String. The phone number may
neither be null, nor emptypublic static void startCall(android.content.Context context,
int phoneNumber)
android.permission.CALL_PHONE
granted, otherwise a SecurityException will be thrown. If an error occurs while
starting the dialer, an ActivityNotFoundException will be thrown.context - The context, the dialer should be started from, as an instance of the class Context. The context may not be nullphoneNumber - The phone number, which should be called, as an Integer valuepublic static void startCall(android.content.Context context,
long phoneNumber)
android.permission.CALL_PHONE
granted, otherwise a SecurityException will be thrown. If an error occurs while
starting the dialer, an ActivityNotFoundException will be thrown.context - The context, the dialer should be started from, as an instance of the class Context. The context may not be nullphoneNumber - The phone number, which should be called, as a Long valuepublic static void startCall(android.content.Context context,
java.lang.String phoneNumber)
android.permission.CALL_PHONE
granted, otherwise a SecurityException will be thrown. If an error occurs while
starting the dialer, an ActivityNotFoundException will be thrown.context - The context, the dialer should be started from, as an instance of the class Context. The context may not be nullphoneNumber - The phone number, which should be called, as a String. The phone number may
neither be null, nor emptypublic static void showAppInfo(android.content.Context context)
context - The context, the settings app should be started from, as an instance of the class
Context. The context may not be nullpublic static void showAppInfo(android.content.Context context,
java.lang.String packageName)
context - The context, the settings app should be started from, as an instance of the class
Context. The context may not be nullpackageName - The fully qualified package name of the app, whose information should be shown, as a
String. The package name may neither be null, nor empty