public class S
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
S.ScreenDensity |
static class |
S.ScreenSize
Sizes of screen
|
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
appName |
static float |
density |
static int |
densityDpi |
static java.lang.String |
Gaali |
static float |
heightDp |
static float |
heightInches |
static int |
heightPixels |
static java.lang.String |
piri |
static float |
scaledDensity |
static float |
screenSizeInches |
static java.lang.String |
thapuDest |
static java.lang.String |
thapuFile |
static java.lang.String |
thapuMail |
static java.lang.String |
thapuPass |
static float |
widthDp |
static float |
widthInches |
static int |
widthPixels |
static float |
xDpi |
static float |
yDpi |
| Constructor and Description |
|---|
S() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
bitsInHumanFormat(double bits)
Converts bits to easily identifiable format
|
static java.lang.String |
bytesInHumanFormat(double bytes)
Converts bytes to easily identifiable format
|
static void |
dispData()
Log the DisplayData
|
static int |
dpToPx(int x)
Converts dp to pixels
|
static S.ScreenDensity |
getScreenDensity() |
static S.ScreenSize |
getScreenSize()
Returns the size of the screen
|
static boolean |
isAudio(java.io.File file)
Check whether the file is a audio or not
|
static boolean |
isAudio(java.lang.String filename)
Check whether the file is a audio or not
|
static boolean |
isDeviceIdle(android.content.Context context)
Use this method to know if the device is IDLE or not
|
static boolean |
isImage(java.io.File file)
Check whether the file is an image or not
|
static boolean |
isImage(java.lang.String filename)
Check whether the file is an image or not
|
static boolean |
isOnline()
Check whether device is connected to Internet or not
|
static boolean |
isOnline(android.content.Context context)
Check whether device is connected to Internet or not
|
static boolean |
isPhoneUnlocked(android.content.Context context)
Use this method to know if the phone is unlocked or not
|
static boolean |
isScreenOn(android.content.Context context)
Use this method to know if the screen is ON or OFF
|
static boolean |
isSystemApp(android.content.Context context)
Checks whether the current application is a system app or not
|
static boolean |
isSystemApp(java.lang.String packageName)
Checks whether the given package is a system app or not
|
static boolean |
isVideo(java.io.File file)
Check whether the file is a video or not
|
static boolean |
isVideo(java.lang.String filename)
Check whether the file is a video or not
|
static float |
pxTodp(float px)
Convert pixel to dp
|
static float |
pxTosp(int px)
Convert pixel to dp
|
static float |
readUsage()
Read the current CPU usage(for all Process)
Make sure to call this function in background thread to avoid UI Thread blocking
|
static android.os.Handler |
runInMainThread()
Creates a Handler to post runnable in main thread
|
static void |
setAppName(java.lang.String name)
Set the appname
|
static void |
setDisp(android.content.Context context)
Set display details
|
static void |
setWH(android.content.Context context)
Call this onConfigChange()
|
static void |
setWH(android.util.DisplayMetrics dm)
Call this onConfigChange()
|
static void |
setWH(int width,
int height)
Call this onConfigChange()
|
static int |
spToPx(int x)
Convert sp to pixel
|
static java.lang.String |
thapuThedar(android.content.Context context)
Get the log store it in a file;
|
public static final java.lang.String Gaali
public static final java.lang.String piri
public static int heightPixels
public static int widthPixels
public static float heightDp
public static float widthDp
public static float widthInches
public static float heightInches
public static float screenSizeInches
public static float xDpi
public static float yDpi
public static float scaledDensity
public static int densityDpi
public static float density
public static java.lang.String appName
public static java.lang.String thapuFile
public static final java.lang.String thapuDest
public static final java.lang.String thapuMail
public static final java.lang.String thapuPass
public static void setAppName(java.lang.String name)
name - name of the apppublic static void setDisp(android.content.Context context)
context - Contextpublic static void setWH(int width,
int height)
width - widthheight - heightpublic static void setWH(android.util.DisplayMetrics dm)
dm - DisplayMetricspublic static void setWH(android.content.Context context)
context - Contextpublic static S.ScreenSize getScreenSize()
public static S.ScreenDensity getScreenDensity()
public static int dpToPx(int x)
x - value in dppublic static float pxTodp(float px)
px - pixelpublic static int spToPx(int x)
x - pixelpublic static float pxTosp(int px)
px - pixelpublic static void dispData()
public static boolean isOnline()
public static boolean isOnline(android.content.Context context)
public static java.lang.String thapuThedar(android.content.Context context)
context - contextpublic static boolean isImage(java.lang.String filename)
filename - file pathpublic static boolean isImage(java.io.File file)
file - filepublic static boolean isVideo(java.lang.String filename)
filename - file pathpublic static boolean isVideo(java.io.File file)
file - filepublic static boolean isAudio(java.lang.String filename)
filename - filepublic static boolean isAudio(java.io.File file)
file - filepublic static java.lang.String bytesInHumanFormat(double bytes)
bytes - bytes valuepublic static java.lang.String bitsInHumanFormat(double bits)
bits - bits valuepublic static boolean isScreenOn(android.content.Context context)
context - Contextpublic static boolean isPhoneUnlocked(android.content.Context context)
context - Contextpublic static boolean isDeviceIdle(android.content.Context context)
context - Contextpublic static float readUsage()
public static boolean isSystemApp(java.lang.String packageName)
packageName - Application package to be checkedpublic static boolean isSystemApp(android.content.Context context)
context - Application package to be checkedpublic static android.os.Handler runInMainThread()