nisrulz / easydeviceinfo
- вторник, 10 мая 2016 г. в 03:11:18
Java
Android library to get device information in a super easy way.
Android library to get device information in a super easy way.
Checkout the app using the same
compile 'com.github.nisrulz:easydeviceinfo:1.1.7'
EasyDeviceInfo easyDeviceInfo=new EasyDeviceInfo(context);
String value=easyDeviceInfo.functionName();
Value | functionName | returns |
---|---|---|
Formatted Time (24Hr) | getFormatedTime() |
String |
Time (ms) | getTime() |
long |
Language | getLanguage() |
String |
Android ID | getAndroidID() |
String |
IMSI | getIMSI() |
String |
Pseudo ID | getPsuedoUniqueID() |
String |
Device Serial Number | getSerial() |
String |
SIM Serial Number | getSIMSerial() |
String |
Manufacturer | getManufacturer() |
String |
Model | getModel() |
String |
OS Codename | getOSCodename() |
String |
OS Version | getOSVersion() |
String |
Country | getCountry() |
String |
(*) User-Agent |
getUA() |
String |
Display Resolution | getResolution() |
String |
Phone Number | getPhoneNo() |
String |
ISP/Carrier | getCarrier() |
String |
Radio Hardware Version | getRadioVer() |
String |
Product | getProduct() |
String |
Device | getDevice() |
String |
Board | getBoard() |
String |
Hardware | getHardware() |
String |
Bootloader | getBootloader() |
String |
IP Address | getIPAddress(true) |
String |
Fingerprint | getFingerprint() |
String |
Screen Density | getDensity() |
String |
Installer Store | getStore() |
String |
Is running on emulator | isRunningOnEmulator() |
boolean |
Build Brand | getBuildBrand() |
String |
Build Host | getBuildHost() |
String |
Build Tags | getBuildTags() |
String |
Build Time | getBuildTime() |
long |
Build User | getBuildUser() |
String |
Build Version Release | getBuildVersionRelease() |
String |
Screen Display ID | getScreenDisplayID() |
String |
Build Version Codename | getBuildVersionCodename() |
String |
Build Version Incremental | getBuildVersionIncremental() |
String |
Build Version SDK | getBuildVersionSDK() |
int |
Build ID | getBuildID() |
String |
Supported ABIS | getStringSupportedABIS() |
String |
Supported 32 bit ABIS | getStringSupported32bitABIS() |
String |
Supported 64 bit ABIS | getStringSupported64bitABIS() |
String |
(*)
: IMPORTANT: Call this method from UI thread only
AndroidManifest.xml
To get IMEI
String imei = getIMEI()
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
To check the type of network or checking is internet available
String network_type = getNetworkType();
boolean is_network_available = isNetworkAvailable();
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
To get GSF ID
String gsf_id = getGSFID();
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
To get WiFi MAC Address
String wifi_mac = getWifiMAC();
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
To get Bluetooth MAC Address
String bluetooth_mac = getBluetoothMAC();
<uses-permission android:name="android.permission.BLUETOOTH"/>
To get Latitude-Longitude (Geo)
//Get Lat-Long
double[] l = easyDeviceInfo.getLatLong();
String lat = String.valueOf(l[0]);
String lon = String.valueOf(l[1]);
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
To get Email IDs
//Get Google Email ID
StringBuilder emailIDs = new StringBuilder();
for (String eid : easyDeviceInfo.getAccounts(this)) {
emailIDs.append(eid).append("\n");
};
String emailId=emailIDs.toString();
<uses-permission android:name="android.permission.GET_ACCOUNTS"/>
StringBuilder supportABI = new StringBuilder();
for (String abis : easyDeviceInfo.getSupportedABIS()) {
supportABI.append(abis).append("\n");
}
String supportedABI=supportABI.toString();
StringBuilder support32ABI = new StringBuilder();
for (String abis : easyDeviceInfo.getSupported32bitABIS()) {
support32ABI.append(abis).append("\n");
}
String supported32ABI=support32ABI.toString();
StringBuilder support64ABI = new StringBuilder();
for (String abis : easyDeviceInfo.getSupported64bitABIS()) {
support64ABI.append(abis).append("\n");
}
String supported64ABI=support64ABI.toString();
//Get Android Advertiser ID
easyDeviceInfo.getAndroidAdId(MainActivity.this, new EasyDeviceInfo.AdIdentifierCallback() {
@Override
public void onSuccess(String adIdentifier, boolean adDonotTrack) {
// Do something with the advertiser's ID
}
});
Copyright 2016 Nishant Srivastava
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.