public class POBUtils
extends java.lang.Object
| Constructor and Description |
|---|
POBUtils() |
| Modifier and Type | Method and Description |
|---|---|
static int |
convertDpToPixel(int value)
Method is used to covert DP into pixel
|
static int |
convertPixelToDp(int value)
Method is used to convert Pixel into DP
|
static android.app.Activity |
getActivity(android.content.Context context)
Returns Weak reference of the activity from the webview context
It also checks whether the context is from ContextThemeWrapper(Dialog) or from activity
and returns specific activity context
|
static int |
getDeviceOrientation(android.content.Context context) |
static POBLocation |
getLocation(PMLocationDetector locationDetector)
Method identifies isLocationDetectionEnabled
if enabled then fetch last known location of the device
if disabled then get location provided by the publisher
|
static int |
getScreenHeight()
Method to get screen height in DP
|
static int |
getScreenWidth()
Method to get screen width in DP
|
static int[] |
getViewXYPosition(android.view.View view)
Method is used get x, y position of View
|
static boolean |
hasPermission(android.content.Context context,
java.lang.String permission)
Method is used to check app has user permission
|
static boolean |
isNull(java.lang.Object[] obj)
Method to check Object array is Null or one of the object inside the object array is null
|
static boolean |
isNullOrEmpty(java.lang.String str)
Method to check String isNull or isEmpty
|
static boolean |
isTablet(android.content.Context context) |
static java.lang.String |
loadMraid(android.content.Context context,
java.lang.String file)
Utilty method to load mraid JS from assets
|
static java.lang.String |
md5(java.lang.String string)
Method is used generate MD5 String
|
static boolean |
openExternalBrowser(android.content.Context context,
java.lang.String url)
Opens url in external app of browser
|
static java.lang.String |
sha1(java.lang.String string)
Method is used to generate SHA1 string
|
public static java.lang.String sha1(java.lang.String string)
string - on which SHA1 to be performpublic static java.lang.String md5(java.lang.String string)
string - on which MD5 algorithm to be performpublic static boolean hasPermission(android.content.Context context,
java.lang.String permission)
context - android app contextpermission - string of app permissionpublic static boolean openExternalBrowser(android.content.Context context,
java.lang.String url)
context - android app contexturl - which is going to be opened in external browser/applicationpublic static boolean isNullOrEmpty(java.lang.String str)
str - which is going to checkedpublic static boolean isNull(java.lang.Object[] obj)
obj - accepts array of objectpublic static POBLocation getLocation(PMLocationDetector locationDetector)
locationDetector - instance of PMLocationDetectorpublic static android.app.Activity getActivity(android.content.Context context)
context - accepts android contextpublic static int getScreenWidth()
public static int getScreenHeight()
public static int[] getViewXYPosition(android.view.View view)
view - on which operation to be performedpublic static int convertDpToPixel(int value)
value - of DPpublic static int convertPixelToDp(int value)
value - in Pixelpublic static int getDeviceOrientation(android.content.Context context)
public static java.lang.String loadMraid(android.content.Context context,
java.lang.String file)
context - instance of Contextfile - name of filepublic static boolean isTablet(android.content.Context context)