protected static String getApplicationName ( Context ctx ) { try { ApplicationInfo applicationInfo = ctx . getApplicationInfo ( ) ; int stringId = applicationInfo . labelRes ; if ( stringId == 0 ) { if ( applicationInfo . nonLocalizedLabel != null ) { return applicationInfo . nonLocalizedLabel . toString ( ) ; } } else { return ctx . getString ( stringId ) ; } } catch ( Exception e ) { Log . e ( TAG , "Error getting application name." , e ) ; } return null ; }
Get the human - facing Application name .