TrackerControl
Static Public Member Functions | List of all members
net.kollnig.missioncontrol.Common Class Reference

Static Public Member Functions

static String fetch (String url)
 
static Intent adSettings ()
 
static Intent browse (String url)
 
static boolean hasAdSettings (Context c)
 
static Intent emailIntent (@Nullable String email, String subject, String body)
 
static boolean isCallable (Context c, Intent intent)
 
static String getAppName (PackageManager pm, int uid)
 
static Intent getLaunchIntent (Activity activity, String appId)
 
static Snackbar getSnackbar (Activity activity, int msg)
 
static int dayOfYear ()
 

Member Function Documentation

◆ adSettings()

static Intent net.kollnig.missioncontrol.Common.adSettings ( )
static

Returns an intent to the system ad settings

Returns
Intent to open system ad settings

◆ browse()

static Intent net.kollnig.missioncontrol.Common.browse ( String  url)
static

Returns an intent to open a URL in a browser

Parameters
urlA URL to be opened
Returns
An intent to open the provided URL

◆ dayOfYear()

static int net.kollnig.missioncontrol.Common.dayOfYear ( )
static

Computes the current day of year

Returns
The current day of year

◆ emailIntent()

static Intent net.kollnig.missioncontrol.Common.emailIntent ( @Nullable String  email,
String  subject,
String  body 
)
static

Returns intent to write an email with an email app

Parameters
emailThe recipient email address
subjectThe subject line
bodyThe email body
Returns
The intent

◆ fetch()

static String net.kollnig.missioncontrol.Common.fetch ( String  url)
static

Downloads content from a provided URL

Parameters
urlURL for download
Returns
Downloaded content

◆ getAppName()

static String net.kollnig.missioncontrol.Common.getAppName ( PackageManager  pm,
int  uid 
)
static

Retrieves the name of the app based on the given uid

Parameters
uid- of the app
Returns
the name of the package of the app with the given uid, or "Unknown" if no name could be found for the uid.

◆ getLaunchIntent()

static Intent net.kollnig.missioncontrol.Common.getLaunchIntent ( Activity  activity,
String  appId 
)
static

Returns launch intent for a provided app

Parameters
activityThe current activity
appIdPackage name of the app to be launched
Returns
An intent

◆ getSnackbar()

static Snackbar net.kollnig.missioncontrol.Common.getSnackbar ( Activity  activity,
int  msg 
)
static

Computes a message in a snackbar to be shown to user.

Parameters
activityThe current activity
msgThe message to be shown
Returns
The computed snackbar. Displayed with .show()

◆ hasAdSettings()

static boolean net.kollnig.missioncontrol.Common.hasAdSettings ( Context  c)
static

Check if system ad settings exist

Parameters
cContext
Returns
Information if system ad settings exist

◆ isCallable()

static boolean net.kollnig.missioncontrol.Common.isCallable ( Context  c,
Intent  intent 
)
static

Checks if intent exists

Parameters
cContent
intentIntent
Returns
Information if intent exists

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