Skip to content

Commit cd5cda1

Browse files
committed
1. Made methods static for easy access.
1 parent 808537a commit cd5cda1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/src/main/java/com/amit/utilities/DeviceUtils.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public static String getIMEINumber(@NonNull Context context)
126126
* @return battery percentage in int or 0
127127
**/
128128
@CheckResult
129-
private static int getBatteryPercentage(@NonNull Context context)
129+
public static int getBatteryPercentage(@NonNull Context context)
130130
{
131131
try
132132
{
@@ -159,7 +159,7 @@ private static int getBatteryPercentage(@NonNull Context context)
159159
* @param context - application context
160160
* @return device id in string
161161
**/
162-
public String getDeviceID(@NonNull Context context)
162+
public static String getDeviceID(@NonNull Context context)
163163
{
164164
// this will get the device id of the device
165165
return Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID);
@@ -171,7 +171,7 @@ public String getDeviceID(@NonNull Context context)
171171
* this method will get the name of the device
172172
* @return name of the device with manufacturer
173173
**/
174-
public String getDeviceName()
174+
public static String getDeviceName()
175175
{
176176
String manufacturer = Build.MANUFACTURER;
177177
String model = Build.MODEL;

0 commit comments

Comments
 (0)