Object ClickUrlHandler

  • All Implemented Interfaces:

    
    public class ClickUrlHandler
    
                        

    Class to handle any URL related operations.

    Author:

    swagato.mondal

    • Constructor Detail

    • Method Detail

      • canIntentResolveUrl

         final Boolean canIntentResolveUrl(Context context, String url)

        Method to check whether the given URL can be handled by any application.

        Parameters:
        context - Context to be used to check.
        url - Represents the URL for which the check is done.
        Returns:

        true if at least one app can handle the URL, otherwise false

      • tryOpenInExternalApplication

         final String tryOpenInExternalApplication(Context context, String url, String fallbackUrl, RedirectionValidator redirectionValidator, String api)

        Method to be used to open external application.

        Parameters:
        context - Context to be used to open external application.
        url - The URL to be opened.
        fallbackUrl - If no app can handle url, then try this.
        Returns:

        the url the framework could handle. If none then null is returned.

      • isHttpUrl

         final Boolean isHttpUrl(Uri uri)

        Method to check whether the scheme of the given Uri is http or https

        Parameters:
        uri - Represents the Uri whose scheme needs to be checked
        Returns:

        true if the scheme of the given Uri is http or https, otherwise false

      • canOpenInEmbeddedBrowser

         final Boolean canOpenInEmbeddedBrowser(String url)

        Method to check whether the given URL can be opened in-app

        Parameters:
        url - Represents the URL that the method checks upon
        Returns:

        true if can be opened in app, otherwise false

      • getResolveInfo

         final List<ResolveInfo> getResolveInfo(Context context, String url)

        Method to get information of applications/activities that can handle a given url.

        Parameters:
        context - Context to be used for querying Activities that can handle given url.
        url - url that is to be handled by applications on device.