Description
Simple, single class wrapper to get device information from an android device.
This library provides an easy way to access all the device information without having to deal with all the boilerplate stuff going on inside.
Library also provides option to ask permissions for Marshmellow devices!
DeviceInfo-Sample alternatives and similar packages
Based on the "Kotlin" category.
Alternatively, view DeviceInfo-Sample alternatives based on common mentions on social networks and blogs.
-
android-youtube-player
YouTube Player library for Android and Chromecast, stable and customizable. -
CalendarView
A highly customizable calendar view and compose library for Android. -
Balloon
:balloon: Modernized and sophisticated tooltips, fully customizable with an arrow and animations for Android. -
Kotterknife
Android view injection writen in Kotlin based on ButterKnife -
Shortbread
Android library that creates app shortcuts from annotations -
kotlin-android-template
Android + Kotlin + Github Actions + ktlint + Detekt + Gradle Kotlin DSL + buildSrc = โค๏ธ -
NotyKT ๐๏ธ
๐ NotyKT is a complete ๐Kotlin-stack (Backend + Android) ๐ฑ application built to demonstrate the use of Modern development tools with best practices implementation๐ฆธ. -
Material Chip View
Material Chip view. Can be used as tags for categories, contacts or creating text clouds -
DrawableToolbox
๐ ๏ธ The missing drawable toolbox for Android. Create drawables programmatically and get rid of the boring and always repeated drawable.xml files. -
Navigation Toolbar for Android
:octocat: Navigation toolbar is a slide-modeled UI navigation controller made by @Ramotion -
CodeView
Display code with syntax highlighting :sparkles: in native way. -
Carousel Recyclerview
Carousel Recyclerview let's you create carousel layout with the power of recyclerview by creating custom layout manager. -
Pluto Debug Framework
Pluto is a on-device debugging framework for Android applications, which helps in inspection of HTTP requests/responses, capture Crashes and ANRs and manipulating application data on-the-go. -
MaterialTimelineView
With MaterialTimelineView you can easily create a material looking timeline. -
CrunchyCalendar โ awesome calendar widget for android apps
A beautiful material calendar with endless scroll, range selection and a lot more! -
Android Kotlin Samples
Some basic samples of Kotlin for Android -
sliding-panel
Android sliding panel that is part of the view hierarchy, not above it. -
MaterialDrawerKt
A Kotlin DSL wrapper around the mikepenz/MaterialDrawer library. -
Pdf Viewer For Android
A Lightweight PDF Viewer Android library which only occupies around 125kb while most of the Pdf viewer occupies up to 16MB space. -
Transition X
{ } Declarative Kotlin DSL for choreographing Android transitions -
Capturable
๐Jetpack Compose utility library for capturing Composable content and transforming it into Bitmap Image๐ผ๏ธ -
Only
:bouquet: An easy way to persist and run code block only as many times as necessary on Android. -
Swagger Gradle Codegen
๐ซ A Gradle Plugin to generate your networking code from Swagger -
SSComposeCookBook
A Collection of major Jetpack compose UI components which are commonly used.๐๐๐ -
SSCustomBottomNavigation
Animated TabBar with native control and Jetpack Navigation support..โจ๐๐ -
EasyPermissions-ktx
๐ Kotlin version of the popular google/easypermissions wrapper library to simplify basic system permissions logic on Android M or higher. -
Awesome Jetpack compose
A collaborative list of awesome jetpack compose resources. -
Permission Flow for Android
Know about real-time state of a Android app Permissions with Kotlin Flow APIs. -
CameraViewEx
Easy Android camera integration, advanced features. -
Aimybox voice assistant
Embeddable custom voice assistant for Android applications -
Nextflix-Composable
Includes jetpack compose, navigation, paging, hilt, retrofit, coil, coroutines, flow.. -
Intro Showcase View
Highlight different features of the app using Jetpack Compose -
Events Calendar
Events Calendar is a user-friendly library that helps you achieve a cool Calendar UI with events mapping. You can customise every pixel of the calendar as per your wish and still achieve in implementing all the functionalities of the native android calendar in addition with adding dots to the calendar which represents the presence of an event on the respective dates. It can be done easily, you are just a few steps away from implementing your own badass looking Calendar for your very own project! -
ZoomHelper
ZoomHelper will make any view to be zoomable just like Instagram pinch-to-zoom -
SSCustomEditTextOutLineBorder
Same as the Outlined text fields presented on the Material Design page but with some dynamic changes. ๐ ๐ -
Vanilla Place Picker
Simple(vanilla) yet 'Do it all' place picker for your place picking needs in Android -
Maildroid
Maildroid is a small robust android library for sending emails using SMTP server -
Turtle ๐ข
Run shell commands from a Kotlin script or application with ease -
Crowdin Android SDK
Crowdin Android SDK delivers all new translations from Crowdin project to the application immediately -
TimelineView
A customizable and easy-to-use Timeline View library for Android. Works as a RecyclerView decorator (ItemDecoration) -
Compose Compiler Reports to HTML Generator
A utility (Gradle Plugin + CLI) to convert Jetpack Compose compiler metrics and reports to beautified HTML page. -
Mutekt
Simplify mutating "immutable" state models (a Kotlin multiplatform library) -
EasyCrypt
Android cryptography library with SecureRandom patches.
Appwrite - The Open Source Firebase alternative introduces iOS support
Do you think we are missing an alternative of DeviceInfo-Sample or a related project?
README
DeviceInfo-Sample
Simple, single class wrapper to get device information from an android device.
This library provides an easy way to access all the device information without having to deal with all the boilerplate stuff going on inside.
As part of the process of my learning kotlin, I migrated the library to support Kotlin as well. If you would like to view the Kotlin version of the library - please checkout branch migrate_to_kotlin
Library also provides option to ask permissions for Marshmellow devices!
Sample App
Donwload the sample app on the Google Play Store and check out all the features
How to integrate the library in your app? Gradle Dependecy
dependencies {
implementation 'com.an.deviceinfo:deviceinfo:0.1.5'
}
Maven Dependecy
<dependency>
<groupId>com.an.deviceinfo</groupId>
<artifactId>deviceinfo</artifactId>
<version>0.1.5</version>
<type>pom</type>
</dependency>
Downloads You can download the aar file from the release folder in this project. In order to import a .aar library: 1) Go to File>New>New Module 2) Select "Import .JAR/.AAR Package" and click next. 3) Enter the path to .aar file and click finish. 4) Go to File>Project Settings (Ctrl+Shift+Alt+S). 5) Under "Modules," in left menu, select "app." 6) Go to "Dependencies tab. 7) Click the green "+" in the upper right corner. 8) Select "Module Dependency" 9) Select the new module from the list.
Usage For easy use, I have split up all the device information by the following:
- Location
- Ads
- App
- Battery
- Device
- Memory
- Network
- User Installed Apps
- User Contacts
Location
LocationInfo locationInfo = new LocationInfo(this);
DeviceLocation location = locationInfo.getLocation();
Value | Function Name | Returns |
---|---|---|
Latitude | getLatitude() |
Double |
Longitude | getLongitude() |
Double |
Address Line 1 | getAddressLine1() |
String |
City | getCity() |
String |
State | getState() |
String |
CountryCode | getCountryCode() |
String |
Postal Code | getPostalCode() |
String |
Ads No Google play services needed!
AdInfo adInfo = new AdInfo(this);
adInfo.getAndroidAdId(new new AdInfo.AdIdCallback() {
@Override
public void onResponse(Ad ad) {
String advertisingId = ad.getAdvertisingId();
Boolean canTrackAds = ad.isAdDoNotTrack();
}
});
Value | Function Name | Returns |
---|---|---|
AdvertisingId | getAdvertisingId() |
String |
Can Track ads | isAdDoNotTrack() |
boolean |
App
App app = new App(this);
Value | Function Name | Returns |
---|---|---|
App Name | getAppName() |
String |
Package Name | getPackageName() |
String |
Activity Name | getActivityName() |
String |
App Version Name | getAppVersionName() |
String |
App Version Code | getAppVersionCode() |
Integer |
Battery
Battery battery = new Battery(this);
Value | Function Name | Returns |
---|---|---|
Battery Percent | getBatteryPercent() |
int |
Is Phone Charging | isPhoneCharging() |
boolean |
Battery Health | getBatteryHealth() |
String |
Battery Technology | getBatteryTechnology() |
String |
Battery Temperature | getBatteryTemperature() |
float |
Battery Voltage | getBatteryVoltage() |
int |
Charging Source | getChargingSource() |
String |
Is Battery Present | isBatteryPresent() |
boolean |
Device
Device device = new Device(this);
Value | Function Name | Returns |
---|---|---|
Release Build Version | getReleaseBuildVersion() |
String |
Build Version Code Name | getBuildVersionCodeName() |
String |
Manufacturer | getManufacturer() |
String |
Model | getModel() |
String |
Product | getProduct() |
String |
Fingerprint | getFingerprint() |
String |
Hardware | getHardware() |
String |
Radio Version | getRadioVersion() |
String |
Device | getDevice() |
String |
Board | getBoard() |
String |
Display Version | getDisplayVersion() |
String |
Build Brand | getBuildBrand() |
String |
Build Host | getBuildHost() |
String |
Build Time | getBuildTime() |
long |
Build User | getBuildUser() |
String |
Serial | getSerial() |
String |
Os Version | getOsVersion() |
String |
Language | getLanguage() |
String |
SDK Version | getSdkVersion() |
int |
Screen Density | getScreenDensity() |
String |
Screen Height | getScreenHeight() |
int |
Screen Density | getScreenWidth() |
int |
Memory
Memory memory = new Memory(this);
Value | Function Name | Returns |
---|---|---|
Has External SD Card | isHasExternalSDCard() |
boolean |
Total RAM | getTotalRAM() |
long |
Available Internal Memory Size | getAvailableInternalMemorySize() |
long |
Total Internal Memory Size | getTotalInternalMemorySize() |
long |
Available External Memory Size | getAvailableExternalMemorySize() |
long |
Total External Memory Size | getTotalExternalMemorySize() |
String |
Network
Network network = new Network(this);
Value | Function Name | Returns |
---|---|---|
IMEI | getIMEI() |
String |
IMSI | getIMSI() |
String |
Phone Type | getPhoneType() |
String |
Phone Number | getPhoneNumber() |
String |
Operator | getOperator() |
String |
SIM Serial | getsIMSerial() |
String |
Network Class | getNetworkClass() |
String |
Network Type | getNetworkType() |
String |
Is SIM Locked | isSimNetworkLocked() |
boolean |
Is Nfc Present | isNfcPresent() |
boolean |
Is Nfc Enabled | isNfcEnabled() |
boolean |
Is Wifi Enabled | isWifiEnabled() |
boolean |
Is Network Available | isNetworkAvailable() |
boolean |
User Installed Apps
UserAppInfo userAppInfo = new UserAppInfo(this);
List<UserApps> userApps = userAppInfo.getInstalledApps(boolean includeSystemApps);
Value | Function Name | Returns |
---|---|---|
App Name | getAppName() |
String |
Package Name | getPackageName() |
String |
Version Name | getVersionName() |
String |
Version Code | getVersionCode() |
int |
User Contacts
UserContactInfo userContactInfo = new UserContactInfo(mActivity);
List<UserContacts> userContacts = userContactInfo.getContacts();
Value | Function Name | Returns |
---|---|---|
Contact Name | getDisplayName() |
String |
Mobile Number | getMobileNumber() |
String |
Phone Type | phoneType() |
String |
How to get Permissions for android 6+ Easy! I have provided a small, easy wrapper for getting permissions for marshmellow devices.
First, override onRequestPermissionsResult and call PermissionManager.handleResult(requestCode, permissions, grantResults);
PermissionManager permissionManager = new PermissionManager(this);
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
permissionManager.handleResult(requestCode, permissions, grantResults);
}
Now you can ask permission:
permissionManager.showPermissionDialog(permission)
.withDenyDialogEnabled(true)
.withDenyDialogMsg(mActivity.getString(R.string.permission_location))
.withCallback(new PermissionManager.PermissionCallback() {
@Override
public void onPermissionGranted(String[] permissions, int[] grantResults) {
//you can handle what to do when permission is granted
}
@Override
public void onPermissionDismissed(String permission) {
/**
* user has denied the permission. We can display a custom dialog
* to user asking for permission
* */
}
@Override
public void onPositiveButtonClicked(DialogInterface dialog, int which) {
/**
* You can choose to open the
* app settings screen
* * */
PermissionUtils permissionUtils = new PermissionUtils(this);
permissionUtils.openAppSettings();
}
@Override
public void onNegativeButtonClicked(DialogInterface dialog, int which) {
/**
* The user has denied the permission!
* You need to handle this in your code
* * */
}
})
.build();
Various options available in PermissionManager
Value | Function Name | Returns |
---|---|---|
To enable custom dialog when user has denied the permission | withDenyDialogEnabled() |
boolean |
To enable Rationale, explaining the need for the permission, the first time they have denied the permission | withRationaleEnabled() |
boolean |
Message to be displayed in the custom dialog | withDenyDialogMsg() |
String |
Title to be displayed in the custom dialog | withDenyDialogTitle() |
String |
Postive Button text to be displayed in the custom alert dialog | withDenyDialogPosBtnText() |
String |
Negative Button text to be displayed in the custom alert dialog | withDenyDialogNegBtnText() |
String |
Should display the negative button flag | withDenyDialogNegBtn() |
boolean |
Flag to cancel the dialog | isDialogCancellable() |
boolean |
Created and maintained by: Anitaa Murthy [email protected]