Class DynamicLinkUtils
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic booleanaddContact(Context context, String[] names, String[] nicknames, String pronunciation, String[] phones, String[] phoneTypes, String[] emails, String[] emailTypes, String[] addresses, String[] addressTypes, String birthday, String title, String organization, String[] websites, String note) Launch add contact intent according to the supplied parameters.static booleanaddEvent(Context context, String title, long startTime, long endTime, boolean allDay, String organizer, String location, String description) Launch add calendar event intent according to the supplied parameters.static booleanView or bookmark URL according to the supplied parameters.static booleanLaunch call intent for the supplied number.static booleancopyToClipboard(Context context, String label, String text) Copy a plain text to the clipboard.static booleanemail(Context context, String[] emails, String[] ccEmails, String[] bccEmails, String subject, String text) Send email according to the supplied parameters.static booleanSend email according to the supplied parameters.static booleanSend email according to the supplied parameters.static booleanAsk questions or submit bug report to the developer via Google feedback.static booleanfeedback(Context context, String appName, String email, int reportType, ApplicationErrorReport.CrashInfo crashInfo) Ask questions or submit bug report to the developer via Google feedback.static booleangeoLocation(Context context, String latitude, String longitude) Try to view location URL according to the supplied parameters.static booleanTry to view location URL according to the supplied parameters.static booleanisEmailExists(Context context) Checks whether the email client exists on the device.static booleanisFeedbackExists(Context context) Checks whether the feedback functionality exists on the device.static booleanisGMSExists(Context context) Checks whether the GMS (Google Mobile Services) package exists on the device.static booleanisGoogleFeedbackExists(Context context) Checks whether the Google feedback package exists on the device.static booleanView other apps of a Publisher on Google Play or Android Market.static booleanmoreAppsSamsung(Context context, String publisher) View other apps of a Samsung Galaxy Store.static booleanView app on Google Play or Android Market.static booleanView app on Google Play or Android Market.static booleanAsk questions or submit bug report to the developer via email.static booleanAsk questions or submit bug report to the developer via email.static booleanShare application via system default share intent so that user can select from the available apps if more than one apps are available.static booleanShare application via system default share intent so that user can select from the available apps if more than one apps are available.static booleanShare application via system default share intent so that user can select from the available apps if more than one apps are available.static booleanShare application via system default share intent so that user can select from the available apps if more than one apps are available.static booleanShare application via system default share intent so that user can select from the available apps if more than one apps are available.static booleanShare application via system default share intent so that user can select from the available apps if more than one apps are available.static booleanShare application via system default share intent so that user can select from the available apps if more than one apps are available.static booleanLaunch SMS or MMS intent according to the supplied parameters.static booleanView app on Google Play (or Android Market) or Samsung Galaxy Store if available.static booleanView app on Google Play (or Android Market) or Samsung Galaxy Store if available.static booleanviewAppExternal(Context context, String packageName) View app on Google Play (or Android Market) or Samsung Galaxy Store if available.static booleanviewInGooglePlay(Context context, String packageName) View app on Google Play or Android Market.static booleanviewInHuaweiAppGallery(Context context, String packageName) View app on HUAWEI AppGallery.static booleanviewInSamsungGalaxyStore(Context context, String packageName) View app on Samsung Galaxy Store.static booleanView any URL in the available app or browser.
- 
Constructor Details- 
DynamicLinkUtilspublic DynamicLinkUtils()
 
- 
- 
Method Details- 
copyToClipboardpublic static boolean copyToClipboard(@NonNull Context context, @NonNull String label, @NonNull String text) Copy a plain text to the clipboard.- Parameters:
- context- The context to get the clipboard manager.
- label- The user visible label for the clip data.
- text- The actual text in the clip.
- Returns:
- trueif copied to clipboard successfully.
- See Also:
 
- 
viewUrlView any URL in the available app or browser. Some URLs will automatically open in their respective apps if installed on the device. Special treatment is applied for the Facebook URLs to open them directly in the app.Use queriestag forIntent.ACTION_VIEWwith schemehttps or httpinAndroidManifestto support API 30.- Parameters:
- context- The context to be used.
- url- The web or app link to open.
- Returns:
- trueon successful operation.
- See Also:
 
- 
viewInGooglePlayView app on Google Play or Android Market.Use queriestag forIntent.ACTION_VIEWwith schemehttps or httpinAndroidManifestto support API 30.- Parameters:
- context- The context to be used.
- packageName- The app package name to build the search query.
- Returns:
- trueon successful operation.
- See Also:
 
- 
viewInSamsungGalaxyStorepublic static boolean viewInSamsungGalaxyStore(@Nullable Context context, @NonNull String packageName) View app on Samsung Galaxy Store.Use queriestag forIntent.ACTION_VIEWwith schemehttps or httpinAndroidManifestto support API 30.- Parameters:
- context- The context to be used.
- packageName- The app package name to build the search query.
- Returns:
- trueon successful operation.
- See Also:
 
- 
viewInHuaweiAppGallerypublic static boolean viewInHuaweiAppGallery(@Nullable Context context, @NonNull String packageName) View app on HUAWEI AppGallery.Use queriestag forIntent.ACTION_VIEWwith schemehttps or httpinAndroidManifestto support API 30.- Parameters:
- context- The context to be used.
- packageName- The app package name to build the search query.
- Returns:
- trueon successful operation.
- See Also:
 
- 
viewApppublic static boolean viewApp(@Nullable Context context, @NonNull String packageName, String flavor) View app on Google Play (or Android Market) or Samsung Galaxy Store if available.Can be used to view app details within the supported stores. Use queriestag forIntent.ACTION_VIEWwith schemehttps or httpinAndroidManifestto support API 30.- Parameters:
- context- The context to be used.
- packageName- The app package name to build the search query.
- flavor- The product flavor to be used.
- Returns:
- trueon successful operation.
- See Also:
 
- 
viewAppView app on Google Play (or Android Market) or Samsung Galaxy Store if available.Can be used to view app details within the supported stores. Use queriestag forIntent.ACTION_VIEWwith schemehttps or httpinAndroidManifestto support API 30.- Parameters:
- context- The context to be used.
- packageName- The app package name to build the search query.
- Returns:
- trueon successful operation.
- See Also:
 
- 
viewAppExternalView app on Google Play (or Android Market) or Samsung Galaxy Store if available. External stores will be preferred first.Can be used to view app details within the supported stores. Use queriestag forIntent.ACTION_VIEWwith schemehttps or httpinAndroidManifestto support API 30.- Parameters:
- context- The context to be used.
- packageName- The app package name to build the search query.
- Returns:
- trueon successful operation.
- See Also:
 
- 
rateAppView app on Google Play or Android Market.Can be used for the quick feedback or rating from the user. Use queriestag forIntent.ACTION_VIEWwith schemehttps or httpinAndroidManifestto support API 30.- Parameters:
- context- The context to be used.
- flavor- The product flavor to be used.
- Returns:
- trueon successful operation.
- See Also:
 
- 
rateAppView app on Google Play or Android Market.Can be used for the quick feedback or rating from the user. Use queriestag forIntent.ACTION_VIEWwith schemehttps or httpinAndroidManifestto support API 30.- Parameters:
- context- The context to be used.
- Returns:
- trueon successful operation.
- See Also:
 
- 
moreAppsView other apps of a Publisher on Google Play or Android Market.Use queriestag forIntent.ACTION_VIEWwith schemehttps or httpinAndroidManifestto support API 30.- Parameters:
- context- The context to be used.
- publisher- The publisher name to build the search query.
- Returns:
- trueon successful operation.
- See Also:
 
- 
moreAppsSamsungView other apps of a Samsung Galaxy Store.Use queriestag forIntent.ACTION_VIEWwith schemehttps or httpinAndroidManifestto support API 30.- Parameters:
- context- The context to be used.
- publisher- The publisher name to build the search query.
- Returns:
- trueon successful operation.
- See Also:
 
- 
emailpublic static boolean email(@Nullable Context context, @Nullable String[] emails, @Nullable String[] ccEmails, @Nullable String[] bccEmails, @Nullable String subject, @Nullable String text) Send email according to the supplied parameters.- Parameters:
- context- The context to be used.
- emails- The email ids to be used.
- ccEmails- The cc email ids to be used.
- bccEmails- The bcc email ids to be used.
- subject- The optional email subject.
- text- The optional email text.
- Returns:
- trueon successful operation.
- See Also:
 
- 
emailpublic static boolean email(@Nullable Context context, @Nullable String[] emails, @Nullable String subject, @Nullable String text) Send email according to the supplied parameters.- Parameters:
- context- The context to be used.
- emails- The email ids to be used.
- subject- The optional email subject.
- text- The optional email text.
- Returns:
- trueon successful operation.
- See Also:
 
- 
emailpublic static boolean email(@Nullable Context context, @Nullable String email, @Nullable String subject, @Nullable String text) Send email according to the supplied parameters.- Parameters:
- context- The context to be used.
- email- The email ids to be used.
- subject- The optional email subject.
- text- The optional email text.
- Returns:
- trueon successful operation.
- See Also:
 
- 
reportpublic static boolean report(@Nullable Context context, @Nullable String appName, @Nullable String email, Boolean license) Ask questions or submit bug report to the developer via email.Subject of the email will be generated automatically by detecting the manufacturer, device, Android version and the app version along with the supplied app name. - Parameters:
- context- The context to be used.
- appName- The app name for the email subject.- nullto get it from the supplied context.
- email- The email id of the developer.
- license-- trueif the license is available on the devices.
- Returns:
- trueon successful operation.
- See Also:
 
- 
reportpublic static boolean report(@Nullable Context context, @Nullable String appName, @NonNull String email) Ask questions or submit bug report to the developer via email.Subject of the email will be generated automatically by detecting the manufacturer, device, Android version and the app version along with the supplied app name. - Parameters:
- context- The context to be used.
- appName- The app name for the email subject.- nullto get it from the supplied context.
- email- The email id of the developer.
- Returns:
- trueon successful operation.
- See Also:
 
- 
isEmailExistsChecks whether the email client exists on the device.Use queriestag forIntent.ACTION_SENDTOwith schemeMailTo.MAILTO_SCHEMEinAndroidManifestto support API 30.- Parameters:
- context- The context to get the package manager.
- Returns:
- trueif the email client exists on the device.
 
- 
isGMSExistsChecks whether the GMS (Google Mobile Services) package exists on the device.- Parameters:
- context- The context to get the package manager.
- Returns:
- trueif the GMS (Google Mobile Services) package exists on the device.
 
- 
isGoogleFeedbackExistsChecks whether the Google feedback package exists on the device.- Parameters:
- context- The context to get the package manager.
- Returns:
- trueif the Google feedback package exists on the device.
 
- 
isFeedbackExistsChecks whether the feedback functionality exists on the device.- Parameters:
- context- The context to get the package manager.
- Returns:
- trueif the feedback functionality exists on the device.
- See Also:
 
- 
feedbackpublic static boolean feedback(@Nullable Context context, @Nullable String appName, @NonNull String email, int reportType, @Nullable ApplicationErrorReport.CrashInfo crashInfo) Ask questions or submit bug report to the developer via Google feedback.It will redirect to report(Context, String, String)method if feedback package is not available on the device.- Parameters:
- context- The context to be used.
- appName- The app name for the email subject.- nullto get it from the supplied context.
- email- The email id of the developer.
- reportType- The crash report type.- Can be one of - ApplicationErrorReport.TYPE_NONE,- ApplicationErrorReport.TYPE_CRASH,- ApplicationErrorReport.TYPE_ANR,- ApplicationErrorReport.TYPE_BATTERY, or- ApplicationErrorReport.TYPE_RUNNING_SERVICE.
- crashInfo- The crash info for the report.
- Returns:
- trueon successful operation.
- See Also:
 
- 
feedbackpublic static boolean feedback(@Nullable Context context, @Nullable String appName, @NonNull String email) Ask questions or submit bug report to the developer via Google feedback.It will redirect to report(Context, String, String)method if feedback package is not available on the device.- Parameters:
- context- The context to be used.
- appName- The app name for the email subject.- nullto get it from the supplied context.
- email- The email id of the developer.
- Returns:
- trueon successful operation.
- See Also:
 
- 
bookmarkpublic static boolean bookmark(@Nullable Context context, @Nullable String url, @Nullable String title) View or bookmark URL according to the supplied parameters.- Parameters:
- context- The context to be used.
- url- The URL to be used.
- title- The optional title to launch the bookmark intent.
- Returns:
- trueon successful operation.
- See Also:
 
- 
callLaunch call intent for the supplied number.- Parameters:
- context- The context to be used.
- number- The number to be called.
- Returns:
- trueon successful operation.
- See Also:
 
- 
smsOrMmspublic static boolean smsOrMms(@Nullable Context context, @Nullable String[] numbers, @Nullable String subject, @Nullable String text) Launch SMS or MMS intent according to the supplied parameters.- Parameters:
- context- The context to be used.
- numbers- The numbers to be used.
- subject- The optional subject if MMS.
- text- The body text to be used.
- Returns:
- trueon successful operation.
- See Also:
 
- 
geoLocationpublic static boolean geoLocation(@Nullable Context context, @Nullable String latitude, @Nullable String longitude, @Nullable String altitude, @Nullable String query) Try to view location URL according to the supplied parameters.- Parameters:
- context- The context to be used.
- latitude- The latitude to be used.
- longitude- The longitude to be used.
- altitude- The optional altitude to be used.
- query- The optional custom query to be used.
- Returns:
- trueon successful operation.
- See Also:
 
- 
geoLocationpublic static boolean geoLocation(@Nullable Context context, @Nullable String latitude, @Nullable String longitude) Try to view location URL according to the supplied parameters.- Parameters:
- context- The context to be used.
- latitude- The latitude to be used.
- longitude- The longitude to be used.
- Returns:
- trueon successful operation.
- See Also:
 
- 
addContactpublic static boolean addContact(@Nullable Context context, @Nullable String[] names, @Nullable String[] nicknames, @Nullable String pronunciation, @Nullable String[] phones, @Nullable String[] phoneTypes, @Nullable String[] emails, @Nullable String[] emailTypes, @Nullable String[] addresses, @Nullable String[] addressTypes, @Nullable String birthday, @Nullable String title, @Nullable String organization, @Nullable String[] websites, @Nullable String note) Launch add contact intent according to the supplied parameters.- Parameters:
- context- The context to be used.
- names- The names to be used.
- nicknames- The nicknames to be used.
- pronunciation- The pronunciation to be used.
- phones- The phones to be used.
- phoneTypes- The phone types to be used.
- emails- The emails to be used.
- emailTypes- The email types to be used.
- addresses- The addresses to be used.
- addressTypes- The address types to be used.
- birthday- The birthday to be used.
- organization- The organization to be used.
- title- The title to be used.
- websites- The websites to be used.
- note- The note to be used.
- Returns:
- trueon successful operation.
- See Also:
 
- 
addEventpublic static boolean addEvent(@Nullable Context context, @Nullable String title, long startTime, long endTime, boolean allDay, @Nullable String organizer, @Nullable String location, @Nullable String description) Launch add calendar event intent according to the supplied parameters.- Parameters:
- context- The context to be used.
- title- The title (summary) to be used.
- startTime- The start time to be used.
- endTime- The end time to be used.
- allDay-- trueif the event is all day.
- organizer- The organizer tobe used.
- location- The location to be used.
- description- The description to be used.
- Returns:
- trueon successful operation.
- See Also:
 
 
-