├── app ├── .gitignore ├── src │ └── main │ │ ├── res │ │ ├── drawable-hdpi │ │ │ ├── cpu.png │ │ │ ├── geo.png │ │ │ ├── gpu.png │ │ │ ├── about.png │ │ │ ├── build.png │ │ │ ├── info.png │ │ │ ├── java.png │ │ │ ├── mail.png │ │ │ ├── share.png │ │ │ ├── star.png │ │ │ ├── battery.png │ │ │ ├── config.png │ │ │ ├── display.png │ │ │ ├── facebook.png │ │ │ ├── feedback.png │ │ │ ├── github.png │ │ │ ├── memory.png │ │ │ ├── network.png │ │ │ ├── others.png │ │ │ ├── requests.png │ │ │ ├── sensors.png │ │ │ ├── twitter.png │ │ │ ├── ic_launcher.png │ │ │ └── ic_keyboard_backspace.png │ │ ├── drawable-ldpi │ │ │ ├── cpu.png │ │ │ ├── geo.png │ │ │ ├── gpu.png │ │ │ ├── about.png │ │ │ ├── build.png │ │ │ ├── info.png │ │ │ ├── java.png │ │ │ ├── mail.png │ │ │ ├── share.png │ │ │ ├── star.png │ │ │ ├── battery.png │ │ │ ├── config.png │ │ │ ├── display.png │ │ │ ├── facebook.png │ │ │ ├── feedback.png │ │ │ ├── github.png │ │ │ ├── memory.png │ │ │ ├── network.png │ │ │ ├── others.png │ │ │ ├── requests.png │ │ │ ├── sensors.png │ │ │ ├── twitter.png │ │ │ └── ic_launcher.png │ │ ├── drawable-mdpi │ │ │ ├── cpu.png │ │ │ ├── geo.png │ │ │ ├── gpu.png │ │ │ ├── about.png │ │ │ ├── build.png │ │ │ ├── info.png │ │ │ ├── java.png │ │ │ ├── mail.png │ │ │ ├── share.png │ │ │ ├── star.png │ │ │ ├── battery.png │ │ │ ├── config.png │ │ │ ├── display.png │ │ │ ├── facebook.png │ │ │ ├── feedback.png │ │ │ ├── github.png │ │ │ ├── memory.png │ │ │ ├── network.png │ │ │ ├── others.png │ │ │ ├── requests.png │ │ │ ├── sensors.png │ │ │ ├── twitter.png │ │ │ ├── ic_launcher.png │ │ │ └── ic_keyboard_backspace.png │ │ ├── drawable-tvdpi │ │ │ ├── cpu.png │ │ │ ├── geo.png │ │ │ ├── gpu.png │ │ │ ├── info.png │ │ │ ├── java.png │ │ │ ├── mail.png │ │ │ ├── star.png │ │ │ ├── about.png │ │ │ ├── battery.png │ │ │ ├── build.png │ │ │ ├── config.png │ │ │ ├── display.png │ │ │ ├── github.png │ │ │ ├── memory.png │ │ │ ├── network.png │ │ │ ├── others.png │ │ │ ├── sensors.png │ │ │ ├── share.png │ │ │ ├── twitter.png │ │ │ ├── facebook.png │ │ │ ├── feedback.png │ │ │ ├── requests.png │ │ │ └── ic_launcher.png │ │ ├── drawable-xhdpi │ │ │ ├── cpu.png │ │ │ ├── geo.png │ │ │ ├── gpu.png │ │ │ ├── info.png │ │ │ ├── java.png │ │ │ ├── mail.png │ │ │ ├── star.png │ │ │ ├── about.png │ │ │ ├── battery.png │ │ │ ├── build.png │ │ │ ├── config.png │ │ │ ├── display.png │ │ │ ├── github.png │ │ │ ├── memory.png │ │ │ ├── network.png │ │ │ ├── others.png │ │ │ ├── sensors.png │ │ │ ├── share.png │ │ │ ├── twitter.png │ │ │ ├── facebook.png │ │ │ ├── feedback.png │ │ │ ├── requests.png │ │ │ ├── ic_launcher.png │ │ │ └── ic_keyboard_backspace.png │ │ ├── drawable-xxhdpi │ │ │ ├── cpu.png │ │ │ ├── geo.png │ │ │ ├── gpu.png │ │ │ ├── about.png │ │ │ ├── build.png │ │ │ ├── config.png │ │ │ ├── github.png │ │ │ ├── info.png │ │ │ ├── java.png │ │ │ ├── mail.png │ │ │ ├── memory.png │ │ │ ├── others.png │ │ │ ├── share.png │ │ │ ├── star.png │ │ │ ├── battery.png │ │ │ ├── display.png │ │ │ ├── facebook.png │ │ │ ├── feedback.png │ │ │ ├── network.png │ │ │ ├── requests.png │ │ │ ├── sensors.png │ │ │ ├── twitter.png │ │ │ ├── ic_launcher.png │ │ │ └── ic_keyboard_backspace.png │ │ ├── drawable-xxxhdpi │ │ │ ├── about.png │ │ │ ├── build.png │ │ │ ├── cpu.png │ │ │ ├── geo.png │ │ │ ├── gpu.png │ │ │ ├── info.png │ │ │ ├── java.png │ │ │ ├── mail.png │ │ │ ├── share.png │ │ │ ├── star.png │ │ │ ├── battery.png │ │ │ ├── config.png │ │ │ ├── display.png │ │ │ ├── github.png │ │ │ ├── memory.png │ │ │ ├── network.png │ │ │ ├── others.png │ │ │ ├── sensors.png │ │ │ ├── twitter.png │ │ │ ├── facebook.png │ │ │ ├── feedback.png │ │ │ ├── requests.png │ │ │ ├── ic_launcher.png │ │ │ └── ic_keyboard_backspace.png │ │ ├── drawable │ │ │ ├── ic_launcher.png │ │ │ └── button_selector_light.xml │ │ ├── values │ │ │ ├── styles.xml │ │ │ ├── dimens.xml │ │ │ ├── colors.xml │ │ │ └── strings.xml │ │ ├── values-v19 │ │ │ └── styles.xml │ │ └── layout │ │ │ ├── toolbar.xml │ │ │ ├── activity_main.xml │ │ │ ├── item_title.xml │ │ │ ├── fragment_list.xml │ │ │ ├── left_drawer.xml │ │ │ ├── custom_toolbar.xml │ │ │ ├── menu_item.xml │ │ │ ├── sensor.xml │ │ │ ├── item_horizontal.xml │ │ │ ├── sub_list_item.xml │ │ │ ├── cardview_vertical.xml │ │ │ ├── drawer_layout.xml │ │ │ ├── cardview_horizontal.xml │ │ │ └── cardview_list_item_with_title.xml │ │ ├── java │ │ └── net │ │ │ └── kibotu │ │ │ └── android │ │ │ └── deviceinfo │ │ │ ├── ui │ │ │ ├── list │ │ │ │ ├── binder │ │ │ │ │ ├── VerticalListItemBinderCardView.java │ │ │ │ │ ├── CardViewHorizontalListItemBinderWithTitle.java │ │ │ │ │ ├── CardViewHorizontalListItemBinder.java │ │ │ │ │ ├── HorizontalListItemBinder.java │ │ │ │ │ └── CardViewSubListItemBinder.java │ │ │ │ └── ListFragment.java │ │ │ ├── menu │ │ │ │ └── ActionbarBaseViewHolder.java │ │ │ ├── sensor │ │ │ │ ├── ProximitySensorFragment.java │ │ │ │ └── SensorValuesFragment.java │ │ │ ├── other │ │ │ │ └── MiscellaneousFragment.java │ │ │ ├── java │ │ │ │ └── JavaFragment.java │ │ │ ├── battery │ │ │ │ └── BatteryFragment.java │ │ │ └── app │ │ │ │ └── AppFragment.java │ │ │ ├── utils │ │ │ └── Extensions.java │ │ │ ├── model │ │ │ └── ListItem.java │ │ │ └── MainActivity.java │ │ └── AndroidManifest.xml ├── fabric.properties └── proguard-rules.pro ├── lib ├── .gitignore ├── src │ └── main │ │ ├── AndroidManifest.xml │ │ ├── res │ │ ├── values │ │ │ ├── strings.xml │ │ │ └── values.xml │ │ ├── res │ │ │ ├── values │ │ │ │ └── values.xml │ │ │ ├── values-hdpi │ │ │ │ └── strings.xml │ │ │ ├── values-mdpi │ │ │ │ └── strings.xml │ │ │ ├── values-xlarge │ │ │ │ ├── values.xml │ │ │ │ └── strings.xml │ │ │ ├── values-large │ │ │ │ └── strings.xml │ │ │ ├── values-normal │ │ │ │ └── strings.xml │ │ │ ├── values-port │ │ │ │ └── strings.xml │ │ │ ├── values-small │ │ │ │ └── strings.xml │ │ │ ├── values-sw600dp │ │ │ │ └── values.xml │ │ │ └── values-land │ │ │ │ └── strings.xml │ │ ├── values-hdpi │ │ │ └── strings.xml │ │ ├── values-mdpi │ │ │ └── strings.xml │ │ ├── values-xhdpi │ │ │ └── strings.xml │ │ ├── values-large │ │ │ └── strings.xml │ │ ├── values-small │ │ │ └── strings.xml │ │ ├── values-sw600dp │ │ │ └── values.xml │ │ ├── values-xlarge │ │ │ ├── values.xml │ │ │ └── strings.xml │ │ ├── values-xxhdpi │ │ │ └── strings.xml │ │ ├── values-xxxhdpi │ │ │ └── strings.xml │ │ ├── values-land │ │ │ └── strings.xml │ │ ├── values-normal │ │ │ └── strings.xml │ │ └── values-port │ │ │ └── strings.xml │ │ └── java │ │ └── net │ │ └── kibotu │ │ └── android │ │ └── deviceinfo │ │ └── library │ │ ├── misc │ │ ├── Callback.java │ │ ├── UpdateTimer.java │ │ └── ReflectionHelper.java │ │ ├── memory │ │ └── RamUsage.java │ │ ├── cpu │ │ ├── CpuFileFilter.java │ │ ├── CpuUsage.java │ │ ├── Core.java │ │ └── Cpu.java │ │ ├── battery │ │ ├── BatteryObservable.java │ │ ├── BatteryUpdateListener.java │ │ └── BatteryReceiver.java │ │ ├── gpu │ │ ├── OpenGLInfo.java │ │ ├── InfoLoader.java │ │ ├── GPURenderer.java │ │ ├── OpenGLExtensions.java │ │ ├── EglChooser.java │ │ ├── Egl.java │ │ └── OpenGLGles10Info.java │ │ ├── display │ │ ├── Dimension.java │ │ └── Display.java │ │ ├── version │ │ ├── Version.java │ │ └── VersionCode.java │ │ ├── storage │ │ └── StorageSpace.java │ │ ├── network │ │ ├── ProxySettings.java │ │ ├── SIM.java │ │ ├── InetAddressUtils.java │ │ ├── Network.java │ │ └── Connectivity.java │ │ ├── bluetooth │ │ └── Bluetooth.java │ │ └── buildinfo │ │ └── DeviceUuidFactory.java ├── proguard-rules.pro └── build.gradle ├── settings.gradle ├── .github └── FUNDING.yml ├── screenshot.png ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitmodules ├── .travis.yml ├── gradle.properties ├── README.md ├── .gitignore └── gradlew.bat /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /lib/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':lib' 2 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | custom: https://paypal.me/janrabe/5 2 | -------------------------------------------------------------------------------- /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/screenshot.png -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /lib/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "Android-Dependencies"] 2 | path = Android-Dependencies 3 | url = https://github.com/exozet/Android-Dependencies.git 4 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/cpu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-hdpi/cpu.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/geo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-hdpi/geo.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/gpu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-hdpi/gpu.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/cpu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-ldpi/cpu.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/geo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-ldpi/geo.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/gpu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-ldpi/gpu.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/cpu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-mdpi/cpu.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/geo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-mdpi/geo.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/gpu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-mdpi/gpu.png -------------------------------------------------------------------------------- /lib/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Device Information Library for Android 3 | 4 | -------------------------------------------------------------------------------- /lib/src/main/res/values/values.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | false 4 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-hdpi/about.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/build.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-hdpi/build.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-hdpi/info.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/java.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-hdpi/java.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/mail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-hdpi/mail.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/share.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-hdpi/share.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-hdpi/star.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-ldpi/about.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/build.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-ldpi/build.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-ldpi/info.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/java.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-ldpi/java.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/mail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-ldpi/mail.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/share.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-ldpi/share.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-ldpi/star.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-mdpi/about.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/build.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-mdpi/build.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-mdpi/info.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/java.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-mdpi/java.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/mail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-mdpi/mail.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/share.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-mdpi/share.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-mdpi/star.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-tvdpi/cpu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-tvdpi/cpu.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-tvdpi/geo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-tvdpi/geo.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-tvdpi/gpu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-tvdpi/gpu.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-tvdpi/info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-tvdpi/info.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-tvdpi/java.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-tvdpi/java.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-tvdpi/mail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-tvdpi/mail.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-tvdpi/star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-tvdpi/star.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/cpu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xhdpi/cpu.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/geo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xhdpi/geo.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/gpu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xhdpi/gpu.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xhdpi/info.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/java.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xhdpi/java.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/mail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xhdpi/mail.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xhdpi/star.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/cpu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xxhdpi/cpu.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/geo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xxhdpi/geo.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/gpu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xxhdpi/gpu.png -------------------------------------------------------------------------------- /lib/src/main/res/res/values/values.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | false 4 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/battery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-hdpi/battery.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-hdpi/config.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/display.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-hdpi/display.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/facebook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-hdpi/facebook.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/feedback.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-hdpi/feedback.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-hdpi/github.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/memory.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-hdpi/memory.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/network.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-hdpi/network.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/others.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-hdpi/others.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/requests.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-hdpi/requests.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/sensors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-hdpi/sensors.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/twitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-hdpi/twitter.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/battery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-ldpi/battery.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-ldpi/config.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/display.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-ldpi/display.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/facebook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-ldpi/facebook.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/feedback.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-ldpi/feedback.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-ldpi/github.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/memory.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-ldpi/memory.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/network.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-ldpi/network.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/others.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-ldpi/others.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/requests.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-ldpi/requests.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/sensors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-ldpi/sensors.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/twitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-ldpi/twitter.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/battery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-mdpi/battery.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-mdpi/config.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/display.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-mdpi/display.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/facebook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-mdpi/facebook.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/feedback.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-mdpi/feedback.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-mdpi/github.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/memory.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-mdpi/memory.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/network.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-mdpi/network.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/others.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-mdpi/others.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/requests.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-mdpi/requests.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/sensors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-mdpi/sensors.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/twitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-mdpi/twitter.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-tvdpi/about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-tvdpi/about.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-tvdpi/battery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-tvdpi/battery.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-tvdpi/build.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-tvdpi/build.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-tvdpi/config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-tvdpi/config.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-tvdpi/display.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-tvdpi/display.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-tvdpi/github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-tvdpi/github.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-tvdpi/memory.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-tvdpi/memory.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-tvdpi/network.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-tvdpi/network.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-tvdpi/others.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-tvdpi/others.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-tvdpi/sensors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-tvdpi/sensors.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-tvdpi/share.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-tvdpi/share.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-tvdpi/twitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-tvdpi/twitter.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xhdpi/about.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/battery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xhdpi/battery.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/build.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xhdpi/build.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xhdpi/config.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/display.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xhdpi/display.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xhdpi/github.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/memory.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xhdpi/memory.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/network.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xhdpi/network.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/others.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xhdpi/others.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/sensors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xhdpi/sensors.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/share.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xhdpi/share.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/twitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xhdpi/twitter.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xxhdpi/about.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/build.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xxhdpi/build.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xxhdpi/config.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xxhdpi/github.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xxhdpi/info.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/java.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xxhdpi/java.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/mail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xxhdpi/mail.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/memory.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xxhdpi/memory.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/others.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xxhdpi/others.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/share.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xxhdpi/share.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xxhdpi/star.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xxxhdpi/about.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/build.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xxxhdpi/build.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/cpu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xxxhdpi/cpu.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/geo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xxxhdpi/geo.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/gpu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xxxhdpi/gpu.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xxxhdpi/info.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/java.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xxxhdpi/java.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/mail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xxxhdpi/mail.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/share.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xxxhdpi/share.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xxxhdpi/star.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /lib/src/main/res/values-hdpi/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | HDPI 4 | -------------------------------------------------------------------------------- /lib/src/main/res/values-mdpi/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | MDPI 4 | -------------------------------------------------------------------------------- /lib/src/main/res/values-xhdpi/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | XHDPI 4 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-tvdpi/facebook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-tvdpi/facebook.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-tvdpi/feedback.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-tvdpi/feedback.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-tvdpi/requests.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-tvdpi/requests.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/facebook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xhdpi/facebook.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/feedback.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xhdpi/feedback.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/requests.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xhdpi/requests.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/battery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xxhdpi/battery.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/display.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xxhdpi/display.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/facebook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xxhdpi/facebook.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/feedback.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xxhdpi/feedback.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/network.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xxhdpi/network.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/requests.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xxhdpi/requests.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/sensors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xxhdpi/sensors.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/twitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xxhdpi/twitter.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/battery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xxxhdpi/battery.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xxxhdpi/config.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/display.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xxxhdpi/display.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xxxhdpi/github.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/memory.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xxxhdpi/memory.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/network.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xxxhdpi/network.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/others.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xxxhdpi/others.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/sensors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xxxhdpi/sensors.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/twitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xxxhdpi/twitter.png -------------------------------------------------------------------------------- /lib/src/main/res/res/values-hdpi/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | HDPI 4 | -------------------------------------------------------------------------------- /lib/src/main/res/res/values-mdpi/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | MDPI 4 | -------------------------------------------------------------------------------- /lib/src/main/res/res/values-xlarge/values.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | true 4 | 5 | -------------------------------------------------------------------------------- /lib/src/main/res/values-large/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Large 4 | -------------------------------------------------------------------------------- /lib/src/main/res/values-small/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Small 4 | -------------------------------------------------------------------------------- /lib/src/main/res/values-sw600dp/values.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | true 4 | 5 | -------------------------------------------------------------------------------- /lib/src/main/res/values-xlarge/values.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | true 4 | 5 | -------------------------------------------------------------------------------- /lib/src/main/res/values-xxhdpi/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | XXHDPI 4 | -------------------------------------------------------------------------------- /lib/src/main/res/values-xxxhdpi/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | XXXHDPI 4 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-ldpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-tvdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-tvdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/facebook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xxxhdpi/facebook.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/feedback.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xxxhdpi/feedback.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/requests.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xxxhdpi/requests.png -------------------------------------------------------------------------------- /lib/src/main/res/res/values-large/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Large 4 | -------------------------------------------------------------------------------- /lib/src/main/res/res/values-normal/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Normal 4 | -------------------------------------------------------------------------------- /lib/src/main/res/res/values-port/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Portrait 4 | -------------------------------------------------------------------------------- /lib/src/main/res/res/values-small/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Small 4 | -------------------------------------------------------------------------------- /lib/src/main/res/res/values-sw600dp/values.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | true 4 | 5 | -------------------------------------------------------------------------------- /lib/src/main/res/values-land/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Landscape 4 | -------------------------------------------------------------------------------- /lib/src/main/res/values-normal/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Normal 4 | -------------------------------------------------------------------------------- /lib/src/main/res/values-port/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Portrait 4 | -------------------------------------------------------------------------------- /lib/src/main/res/values-xlarge/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | X-Large 4 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /lib/src/main/res/res/values-land/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Landscape 4 | -------------------------------------------------------------------------------- /lib/src/main/res/res/values-xlarge/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | X-Large 4 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_keyboard_backspace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-hdpi/ic_keyboard_backspace.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_keyboard_backspace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-mdpi/ic_keyboard_backspace.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_keyboard_backspace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xhdpi/ic_keyboard_backspace.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_keyboard_backspace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xxhdpi/ic_keyboard_backspace.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_keyboard_backspace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kibotu/net.kibotu.android.deviceinfo/HEAD/app/src/main/res/drawable-xxxhdpi/ic_keyboard_backspace.png -------------------------------------------------------------------------------- /app/fabric.properties: -------------------------------------------------------------------------------- 1 | #Contains API Secret used to validate your application. Commit to internal source control; avoid making secret public. 2 | #Mon Feb 22 18:07:20 CET 2016 3 | apiSecret=75f23d125b642b353266e166d3274b8a025005438022fcf824bf619cef7b366d 4 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /app/src/main/res/values-v19/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | -------------------------------------------------------------------------------- /lib/src/main/java/net/kibotu/android/deviceinfo/library/misc/Callback.java: -------------------------------------------------------------------------------- 1 | package net.kibotu.android.deviceinfo.library.misc; 2 | 3 | /** 4 | * Created by Nyaruhodo on 22.02.2016. 5 | */ 6 | public interface Callback { 7 | 8 | void onComplete(T t); 9 | } 10 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 15dp 4 | 10dp 5 | 8dp 6 | 10dp 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/button_selector_light.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/layout/toolbar.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /lib/src/main/java/net/kibotu/android/deviceinfo/library/memory/RamUsage.java: -------------------------------------------------------------------------------- 1 | package net.kibotu.android.deviceinfo.library.memory; 2 | 3 | import net.kibotu.android.deviceinfo.library.misc.Proc; 4 | import net.kibotu.android.deviceinfo.library.misc.UpdateTimer; 5 | 6 | /** 7 | * Created by Nyaruhodo on 12.03.2016. 8 | */ 9 | public class RamUsage extends UpdateTimer { 10 | 11 | @Override 12 | protected Ram getData() { 13 | return Proc.getRam(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /lib/src/main/java/net/kibotu/android/deviceinfo/library/cpu/CpuFileFilter.java: -------------------------------------------------------------------------------- 1 | package net.kibotu.android.deviceinfo.library.cpu; 2 | 3 | import java.io.File; 4 | import java.io.FileFilter; 5 | import java.util.regex.Pattern; 6 | 7 | class CpuFileFilter implements FileFilter { 8 | @Override 9 | public boolean accept(File pathname) { 10 | //Check if filename is "cpu", followed by a single digit number 11 | return Pattern.matches("cpu[0-9]+", pathname.getName()); 12 | } 13 | } -------------------------------------------------------------------------------- /lib/src/main/java/net/kibotu/android/deviceinfo/library/battery/BatteryObservable.java: -------------------------------------------------------------------------------- 1 | package net.kibotu.android.deviceinfo.library.battery; 2 | 3 | import java.util.Observable; 4 | 5 | public class BatteryObservable extends Observable { 6 | 7 | @Override 8 | public void notifyObservers() { 9 | setChanged(); 10 | super.notifyObservers(); 11 | } 12 | 13 | @Override 14 | public void notifyObservers(Object data) { 15 | setChanged(); 16 | super.notifyObservers(data); 17 | } 18 | } -------------------------------------------------------------------------------- /lib/src/main/java/net/kibotu/android/deviceinfo/library/battery/BatteryUpdateListener.java: -------------------------------------------------------------------------------- 1 | package net.kibotu.android.deviceinfo.library.battery; 2 | 3 | import java.util.Observable; 4 | import java.util.Observer; 5 | 6 | public abstract class BatteryUpdateListener implements Observer { 7 | 8 | @Override 9 | public void update(Observable observable, Object data) { 10 | if (data instanceof Battery) 11 | update((Battery) data); 12 | } 13 | 14 | protected abstract void update(Battery battery); 15 | } -------------------------------------------------------------------------------- /app/src/main/res/layout/item_title.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_list.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 15 | 16 | -------------------------------------------------------------------------------- /lib/src/main/java/net/kibotu/android/deviceinfo/library/gpu/OpenGLInfo.java: -------------------------------------------------------------------------------- 1 | package net.kibotu.android.deviceinfo.library.gpu; 2 | 3 | import java.util.ArrayList; 4 | 5 | public abstract class OpenGLInfo { 6 | 7 | final int eGLContextClientVersion; 8 | public ArrayList eglconfigs; 9 | 10 | protected OpenGLInfo(final int eGLContextClientVersion) { 11 | this.eGLContextClientVersion = eGLContextClientVersion; 12 | eglconfigs = new ArrayList<>(); 13 | } 14 | 15 | /** 16 | * Basically run this in a successfully running GLSurfaceView.Renderer.onSurfaceCreated. 17 | * Guaranties valid OpenGL context. 18 | */ 19 | protected abstract void loadOnCreate(); 20 | } -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in E:/android-sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | -keep class net.kibotu.android.deviceinfo.** { *; } -------------------------------------------------------------------------------- /app/src/main/java/net/kibotu/android/deviceinfo/ui/list/binder/VerticalListItemBinderCardView.java: -------------------------------------------------------------------------------- 1 | package net.kibotu.android.deviceinfo.ui.list.binder; 2 | 3 | import androidx.annotation.NonNull; 4 | 5 | import net.kibotu.android.deviceinfo.R; 6 | import net.kibotu.android.deviceinfo.model.ListItem; 7 | import net.kibotu.android.recyclerviewpresenter.PresenterAdapter; 8 | 9 | /** 10 | * Created by Nyaruhodo on 21.02.2016. 11 | */ 12 | public class VerticalListItemBinderCardView extends CardViewHorizontalListItemBinder { 13 | 14 | public VerticalListItemBinderCardView(@NonNull PresenterAdapter dataBindAdapter) { 15 | super(dataBindAdapter); 16 | } 17 | 18 | @Override 19 | public int getLayout() { 20 | return R.layout.cardview_vertical; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in E:/android-sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | 20 | -keep class net.kibotu.android.deviceinfo.library.** { *; } -------------------------------------------------------------------------------- /app/src/main/java/net/kibotu/android/deviceinfo/ui/list/binder/CardViewHorizontalListItemBinderWithTitle.java: -------------------------------------------------------------------------------- 1 | package net.kibotu.android.deviceinfo.ui.list.binder; 2 | 3 | import androidx.annotation.NonNull; 4 | 5 | import net.kibotu.android.deviceinfo.R; 6 | import net.kibotu.android.deviceinfo.model.ListItem; 7 | import net.kibotu.android.recyclerviewpresenter.PresenterAdapter; 8 | 9 | /** 10 | * Created by Nyaruhodo on 22.02.2016. 11 | */ 12 | public class CardViewHorizontalListItemBinderWithTitle extends HorizontalListItemBinder { 13 | 14 | public CardViewHorizontalListItemBinderWithTitle(@NonNull PresenterAdapter dataBindAdapter) { 15 | super(dataBindAdapter); 16 | } 17 | 18 | @Override 19 | public int getLayout() { 20 | return R.layout.cardview_list_item_with_title; 21 | } 22 | } -------------------------------------------------------------------------------- /app/src/main/res/layout/left_drawer.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 16 | 17 | 21 | 22 | -------------------------------------------------------------------------------- /app/src/main/java/net/kibotu/android/deviceinfo/ui/menu/ActionbarBaseViewHolder.java: -------------------------------------------------------------------------------- 1 | package net.kibotu.android.deviceinfo.ui.menu; 2 | 3 | import androidx.annotation.NonNull; 4 | import android.view.View; 5 | import android.widget.ImageView; 6 | import android.widget.TextView; 7 | 8 | import net.kibotu.android.deviceinfo.R; 9 | import net.kibotu.android.recyclerviewpresenter.BaseViewHolder; 10 | 11 | public class ActionbarBaseViewHolder extends BaseViewHolder { 12 | 13 | @NonNull 14 | View iconHitBox; 15 | 16 | @NonNull 17 | ImageView homeIcon; 18 | 19 | @NonNull 20 | TextView title; 21 | 22 | public ActionbarBaseViewHolder(@NonNull final View itemView) { 23 | super(itemView); 24 | iconHitBox = itemView.findViewById(R.id.icon_layout); 25 | homeIcon = (ImageView) itemView.findViewById(R.id.home_icon); 26 | title = (TextView) itemView.findViewById(R.id.actionbar_title); 27 | } 28 | } -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: android 2 | jdk: oraclejdk8 3 | 4 | git: 5 | depth: 10000 6 | 7 | env: 8 | global: 9 | 10 | - SLAVE_AAPT_TIMEOUT=30 11 | - TERM=dumb 12 | - GRADLE_OPTS="-XX:MaxPermSize=1024m -XX:+CMSClassUnloadingEnabled -XX:+HeapDumpOnOutOfMemoryError -Xmx2048m -Dfile.encoding=UTF-8" 13 | 14 | matrix: 15 | fast_finish: true 16 | 17 | android: 18 | components: 19 | 20 | - platform-tools 21 | - tools 22 | - build-tools-28.0.3 23 | - android-28 24 | - extra-google-google_play_services 25 | - extra-google-m2repository 26 | - extra-android-m2repository 27 | - addon-google_apis-google-28 28 | 29 | licenses: 30 | - android-sdk-license-.+ 31 | 32 | before_install: 33 | - git submodule update --init --recursive 34 | - chmod u+x gradlew 35 | - android list sdk --no-ui --all --extended 36 | - android list targets 37 | 38 | install: true 39 | 40 | script: 41 | - ./gradlew -v 42 | - ./gradlew clean build --stacktrace 43 | 44 | after_failure: true 45 | 46 | notifications: 47 | email: false 48 | -------------------------------------------------------------------------------- /lib/src/main/java/net/kibotu/android/deviceinfo/library/display/Dimension.java: -------------------------------------------------------------------------------- 1 | package net.kibotu.android.deviceinfo.library.display; 2 | 3 | public class Dimension { 4 | 5 | public final int width, height; 6 | 7 | public Dimension(final int width, final int height) { 8 | this.width = width; 9 | this.height = height; 10 | } 11 | 12 | @Override 13 | public boolean equals(Object o) { 14 | if (this == o) return true; 15 | if (o == null || getClass() != o.getClass()) return false; 16 | 17 | Dimension dimension = (Dimension) o; 18 | 19 | if (width != dimension.width) return false; 20 | return height == dimension.height; 21 | 22 | } 23 | 24 | @Override 25 | public int hashCode() { 26 | int result = width; 27 | result = 31 * result + height; 28 | return result; 29 | } 30 | 31 | @Override 32 | public String toString() { 33 | return "Dimension{" + 34 | "width=" + width + 35 | ", height=" + height + 36 | '}'; 37 | } 38 | } -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #fff 4 | #000 5 | #00000000 6 | 7 | #343434 8 | #676767 9 | #EFEFEF 10 | 11 | @color/light_gray 12 | @color/gray 13 | @color/light_gray 14 | #AA676767 15 | #AA676767 16 | @color/transparent 17 | 18 | @color/light_gray 19 | #303030 20 | @color/light_gray 21 | @color/light_gray 22 | #00FF00 23 | #0000FF 24 | #FF0000 25 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Device Information for Android 3 | Hello world! 4 | Drawer Open 5 | Drawer Close 6 | 7 | Build 8 | Configuration 9 | CPU 10 | GPU 11 | Memory 12 | Battery 13 | Display 14 | Network 15 | Sensor 16 | Java 17 | Geolocation 18 | App 19 | Miscellaneous 20 | Device Information 21 | Build 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/java/net/kibotu/android/deviceinfo/ui/sensor/ProximitySensorFragment.java: -------------------------------------------------------------------------------- 1 | package net.kibotu.android.deviceinfo.ui.sensor; 2 | 3 | import android.hardware.Sensor; 4 | import android.hardware.SensorEvent; 5 | import android.hardware.SensorEventListener; 6 | 7 | import java.util.Arrays; 8 | 9 | /** 10 | * Created by Nyaruhodo on 03.04.2016. 11 | */ 12 | public class ProximitySensorFragment extends SensorValuesFragment { 13 | 14 | @Override 15 | public String getTitle() { 16 | return "Proximity Sensor"; 17 | } 18 | 19 | @Override 20 | protected int sensorType() { 21 | return Sensor.TYPE_PROXIMITY; 22 | } 23 | 24 | @Override 25 | protected SensorEventListener createSensorEventListener() { 26 | return new SensorEventListener() { 27 | @Override 28 | public void onSensorChanged(SensorEvent event) { 29 | float distance = event.values[0]; 30 | xLabel.setText(Arrays.toString(event.values)); 31 | } 32 | 33 | @Override 34 | public void onAccuracyChanged(Sensor sensor, int accuracy) { 35 | 36 | } 37 | }; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lib/src/main/java/net/kibotu/android/deviceinfo/library/version/Version.java: -------------------------------------------------------------------------------- 1 | package net.kibotu.android.deviceinfo.library.version; 2 | 3 | import android.os.Build; 4 | 5 | import java.lang.reflect.Field; 6 | 7 | /** 8 | * Created by Nyaruhodo on 06.03.2016. 9 | */ 10 | public class Version { 11 | 12 | public static boolean isAtLeastVersion(@VersionCode final int version) { 13 | return Build.VERSION.SDK_INT >= version; 14 | } 15 | 16 | public static String getOsAsString(final int sdk) { 17 | Field[] fields = Build.VERSION_CODES.class.getFields(); 18 | for (Field field : fields) { 19 | String fieldName = field.getName(); 20 | int fieldValue = -1; 21 | 22 | try { 23 | fieldValue = field.getInt(new Object()); 24 | } catch (IllegalArgumentException e) { 25 | e.printStackTrace(); 26 | } catch (IllegalAccessException e) { 27 | e.printStackTrace(); 28 | } catch (NullPointerException e) { 29 | e.printStackTrace(); 30 | } 31 | 32 | if (sdk == fieldValue) 33 | return fieldName; 34 | } 35 | return ""; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /app/src/main/java/net/kibotu/android/deviceinfo/ui/other/MiscellaneousFragment.java: -------------------------------------------------------------------------------- 1 | package net.kibotu.android.deviceinfo.ui.other; 2 | 3 | import android.os.Bundle; 4 | import androidx.annotation.Nullable; 5 | import android.view.View; 6 | 7 | import net.kibotu.android.deviceinfo.R; 8 | import net.kibotu.android.deviceinfo.ui.list.ListFragment; 9 | 10 | import static net.kibotu.android.deviceinfo.library.Device.installedApps; 11 | import static net.kibotu.android.deviceinfo.library.misc.ShellExtensions.isPhoneRooted; 12 | 13 | /** 14 | * Created by Nyaruhodo on 21.02.2016. 15 | */ 16 | public class MiscellaneousFragment extends ListFragment { 17 | 18 | @Override 19 | public String getTitle() { 20 | return getString(R.string.menu_item_other); 21 | } 22 | 23 | @Override 24 | protected int getHomeIcon() { 25 | return R.drawable.others; 26 | } 27 | 28 | @Override 29 | public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { 30 | super.onViewCreated(view, savedInstanceState); 31 | 32 | addHorizontallyCard("Rooted", isPhoneRooted(), "Determines if this device has been rooted."); 33 | addHorizontallyCard("Installed Apps", installedApps().size(), "Amount of currently installed applications."); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /app/src/main/java/net/kibotu/android/deviceinfo/utils/Extensions.java: -------------------------------------------------------------------------------- 1 | package net.kibotu.android.deviceinfo.utils; 2 | 3 | import android.graphics.Point; 4 | import androidx.annotation.NonNull; 5 | import android.view.View; 6 | 7 | import static net.kibotu.android.deviceinfo.library.display.Display.getStatusBarHeight; 8 | 9 | /** 10 | * Created by Nyaruhodo on 22.02.2016. 11 | */ 12 | public class Extensions { 13 | 14 | @NonNull 15 | public static Point getLocationOnScreenWithCenterPivot(@NonNull final View v) { 16 | 17 | final int[] position = new int[2]; 18 | v.getLocationOnScreen(position); 19 | 20 | // moving pivot to center 21 | position[0] += v.getMeasuredWidth() / 2; 22 | position[1] += v.getMeasuredHeight() / 2; 23 | 24 | // taking status bar top offset into account 25 | position[1] -= getStatusBarHeight(); 26 | 27 | return new Point(position[0], position[1]); 28 | } 29 | 30 | @NonNull 31 | public static Point getLocationOnScreenWithTopLeftPivot(@NonNull final View v) { 32 | final int[] position = new int[2]; 33 | v.getLocationOnScreen(position); 34 | 35 | // taking status bar top offset into account 36 | position[1] -= getStatusBarHeight(); 37 | 38 | return new Point(position[0], position[1]); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/src/main/res/layout/custom_toolbar.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 12 | 13 | 18 | 19 | 20 | 21 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/res/layout/menu_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 15 | 16 | 20 | 21 | 29 | 30 | 31 | 32 | 38 | 39 | -------------------------------------------------------------------------------- /app/src/main/res/layout/sensor.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 13 | 14 | 20 | 21 | 27 | 28 | 34 | 35 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /app/src/main/java/net/kibotu/android/deviceinfo/ui/java/JavaFragment.java: -------------------------------------------------------------------------------- 1 | package net.kibotu.android.deviceinfo.ui.java; 2 | 3 | import android.os.Bundle; 4 | import androidx.annotation.Nullable; 5 | import android.view.View; 6 | 7 | import net.kibotu.android.deviceinfo.R; 8 | import net.kibotu.android.deviceinfo.ui.list.ListFragment; 9 | 10 | import java.io.PrintWriter; 11 | import java.io.StringWriter; 12 | import java.util.Properties; 13 | 14 | /** 15 | * Created by Nyaruhodo on 21.02.2016. 16 | */ 17 | public class JavaFragment extends ListFragment { 18 | 19 | @Override 20 | public String getTitle() { 21 | return getString(R.string.menu_item_java); 22 | } 23 | 24 | @Override 25 | protected int getHomeIcon() { 26 | return R.drawable.java; 27 | } 28 | 29 | @Override 30 | public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { 31 | super.onViewCreated(view, savedInstanceState); 32 | 33 | final StringWriter strOut = new StringWriter(); 34 | final PrintWriter out = new PrintWriter(strOut); 35 | 36 | final Properties props = System.getProperties(); 37 | props.list(out); 38 | 39 | final String[] lines = strOut.toString().trim().split("\\r?\\n"); 40 | 41 | for (final String line : lines) { 42 | final String[] split = line.split("="); 43 | final String key = split.length > 1 ? split[0] : ""; 44 | final String value = split.length > 1 ? split[1] : ""; 45 | addVerticallyCard(key, value, ""); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /lib/src/main/java/net/kibotu/android/deviceinfo/library/gpu/InfoLoader.java: -------------------------------------------------------------------------------- 1 | package net.kibotu.android.deviceinfo.library.gpu; 2 | 3 | import android.opengl.GLSurfaceView; 4 | import android.view.ViewGroup; 5 | 6 | import net.kibotu.android.deviceinfo.library.Device; 7 | import net.kibotu.android.deviceinfo.library.misc.Callback; 8 | 9 | import static net.kibotu.android.deviceinfo.library.Device.getContext; 10 | 11 | public class InfoLoader { 12 | 13 | private volatile GPURenderer renderer; 14 | private T info; 15 | 16 | public InfoLoader(final T info) { 17 | this.info = info; 18 | } 19 | 20 | public void loadInfo(final Callback callback) { 21 | 22 | // new view 23 | final GLSurfaceView glView = new GLSurfaceView(getContext()); 24 | 25 | // egl info 26 | glView.setEGLConfigChooser(new EglChooser(info)); 27 | 28 | // need to be on top to be rendered at least for one frame 29 | glView.setZOrderOnTop(true); 30 | 31 | // create new renderer; note: we only need the oncreate method for all the infos 32 | renderer = new GPURenderer(glView, info, callback); 33 | 34 | // set opengl version 35 | glView.setEGLContextClientVersion(info.eGLContextClientVersion); 36 | 37 | // set renderer 38 | glView.setRenderer(renderer); 39 | 40 | // add opengl view to current active view 41 | final ViewGroup layout = (ViewGroup) Device.getContentRootView(); // Note: needs to be layout of current active view 42 | layout.addView(glView); 43 | } 44 | } -------------------------------------------------------------------------------- /app/src/main/res/layout/item_horizontal.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 24 | 25 | 40 | -------------------------------------------------------------------------------- /app/src/main/res/layout/sub_list_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 15 | 16 | 20 | 21 | 31 | 32 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /lib/src/main/java/net/kibotu/android/deviceinfo/library/gpu/GPURenderer.java: -------------------------------------------------------------------------------- 1 | package net.kibotu.android.deviceinfo.library.gpu; 2 | 3 | import android.app.Activity; 4 | import android.opengl.GLSurfaceView; 5 | import android.view.ViewGroup; 6 | 7 | import net.kibotu.android.deviceinfo.library.Device; 8 | import net.kibotu.android.deviceinfo.library.misc.Callback; 9 | 10 | import javax.microedition.khronos.egl.EGLConfig; 11 | import javax.microedition.khronos.opengles.GL10; 12 | 13 | public class GPURenderer implements GLSurfaceView.Renderer { 14 | 15 | private GLSurfaceView glSurfaceView; 16 | private T result; 17 | private Callback callback; 18 | 19 | protected GPURenderer(final GLSurfaceView glSurfaceView, final T result, final Callback callback) { 20 | this.result = result; 21 | this.glSurfaceView = glSurfaceView; 22 | this.callback = callback; 23 | } 24 | 25 | @Override 26 | public void onSurfaceCreated(final GL10 gl, final EGLConfig eglConfig) { 27 | 28 | // loadOnCreate info 29 | result.loadOnCreate(); 30 | 31 | ((Activity) Device.getContext()).runOnUiThread(new Runnable() { 32 | @Override 33 | public void run() { 34 | callback.onComplete(result); 35 | } 36 | }); 37 | 38 | final ViewGroup layout = (ViewGroup) Device.getContentRootView(); 39 | layout.removeView(glSurfaceView); 40 | } 41 | 42 | @Override 43 | public void onSurfaceChanged(final GL10 gl10, final int width, final int height) { 44 | // do nothing 45 | } 46 | 47 | @Override 48 | public void onDrawFrame(final GL10 gl) { 49 | // do nothing 50 | } 51 | } -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # gralde config 2 | org.gradle.jvmargs=-Xms8g 3 | org.gradle.daemon=true 4 | org.gradle.parallel=true 5 | org.gradle.workers.max=32 6 | org.gradle.caching=true 7 | 8 | # kotlin config 9 | #android.enableAapt2=false 10 | kotlinOptions.allWarningsAsErrors=false 11 | android.enableR8=true 12 | android.enableR8.fullMode=true 13 | android.enableD8=true 14 | android.enableD8.desugaring=true 15 | # https://developer.android.com/topic/libraries/support-library/androidx-overview 16 | android.useAndroidX=true 17 | # Automatically convert third-party libraries to use AndroidX 18 | android.enableJetifier=true 19 | # Kotlin code style for this project: "official" or "obsolete": 20 | kotlin.code.style=official 21 | 22 | #robolectric 23 | android.enableUnitTestBinaryResources=true 24 | # https://speakerdeck.com/snehpandya18/mastering-gradle-3 25 | gradle=build -x lint -x lintVitalRelease 26 | # https://developer.android.com/studio/preview/features/?utm_source=android-studio#lazy_task_config 27 | android.debug.obsoleteApi=false 28 | #android.proguard.enableRulesExtraction=false 29 | 30 | kapt.incremental.apt=true 31 | android.enableSeparateAnnotationProcessing=true 32 | javaCompileOptions.annotationProcessorOptions.includeCompileClasspath = true 33 | 34 | # app 35 | APPLICATION_ID=net.kibotu.android.deviceinfo 36 | VERSION_NAME=1.0.0 37 | 38 | # debug keystore 39 | DEBUG_KEYSYORE_PATH=../certificates/debug.jks 40 | DEBUG_KEYSTORE_ALLIAS=debug 41 | DEBUG_STORE_PASSWORD= 42 | DEBUG_KEY_PASSWORD= 43 | 44 | # release keystore 45 | RELEASE_KEYSYORE_PATH=../certificates/release.jks 46 | RELEASE_KEYSTORE_ALIAS=release 47 | RELEASE_STORE_PASSWORD= 48 | RELEASE_KEY_PASSWORD= 49 | 50 | # VSC config 51 | VSC_PATH=https://github.com/kibotu/net.kibotu.android.deviceinfo 52 | 53 | # github, gitlab, bitbucket 54 | VSC_TYPE=github -------------------------------------------------------------------------------- /lib/src/main/java/net/kibotu/android/deviceinfo/library/storage/StorageSpace.java: -------------------------------------------------------------------------------- 1 | package net.kibotu.android.deviceinfo.library.storage; 2 | 3 | import android.annotation.TargetApi; 4 | import android.os.Build; 5 | import android.os.Environment; 6 | import android.os.StatFs; 7 | 8 | import static android.os.Build.VERSION_CODES.JELLY_BEAN_MR2; 9 | import static net.kibotu.android.deviceinfo.library.version.Version.isAtLeastVersion; 10 | 11 | public enum StorageSpace { 12 | 13 | ROOT(Environment.getRootDirectory().getAbsolutePath()), 14 | DATA(Environment.getDataDirectory().getAbsolutePath()), 15 | EXTERNAL(Environment.getExternalStorageDirectory().getAbsolutePath()); 16 | 17 | private final StatFs statFs; 18 | public final String absolutePath; 19 | 20 | StorageSpace(final String absolutePath) { 21 | this.absolutePath = absolutePath; 22 | statFs = new StatFs(absolutePath); 23 | } 24 | 25 | @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2) 26 | public long getTotal() { 27 | return isAtLeastVersion(JELLY_BEAN_MR2) 28 | ? statFs.getBlockCountLong() * statFs.getBlockSizeLong() 29 | : statFs.getBlockCount() * statFs.getBlockSize(); 30 | } 31 | 32 | @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2) 33 | public long getAvailable() { 34 | return isAtLeastVersion(JELLY_BEAN_MR2) 35 | ? statFs.getAvailableBlocksLong() * statFs.getBlockSizeLong() 36 | : statFs.getAvailableBlocks() * statFs.getBlockSize(); 37 | } 38 | 39 | @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2) 40 | public long getFree() { 41 | return isAtLeastVersion(JELLY_BEAN_MR2) 42 | ? statFs.getFreeBlocksLong() * statFs.getBlockSizeLong() 43 | : statFs.getFreeBlocks() * statFs.getBlockSize(); 44 | } 45 | } -------------------------------------------------------------------------------- /app/src/main/res/layout/cardview_vertical.xml: -------------------------------------------------------------------------------- 1 | 2 | 15 | 16 | 20 | 21 | 31 | 32 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 12 | 13 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /lib/src/main/java/net/kibotu/android/deviceinfo/library/network/ProxySettings.java: -------------------------------------------------------------------------------- 1 | package net.kibotu.android.deviceinfo.library.network; 2 | 3 | import android.content.Context; 4 | import android.net.ConnectivityManager; 5 | 6 | import net.kibotu.android.deviceinfo.library.services.SystemService; 7 | 8 | import java.lang.reflect.Method; 9 | 10 | public class ProxySettings { 11 | 12 | public String Host; 13 | public int Port; 14 | public String ExclusionList; 15 | 16 | public ProxySettings(final Context context) { 17 | loadProxySettings(context); 18 | } 19 | 20 | /** 21 | * Credits to: http://stackoverflow.com/questions/10811698/getting-wifi-proxy-settings-in-android 22 | */ 23 | private void loadProxySettings(final Context context) { 24 | Method method; 25 | try { 26 | method = ConnectivityManager.class.getMethod("getProxy"); 27 | } catch (final NoSuchMethodException e) { 28 | e.printStackTrace(); 29 | // Normal situation for pre-ICS devices 30 | return; 31 | } 32 | 33 | try { 34 | final ConnectivityManager connectivityManager = SystemService.getConnectivityManager(); 35 | final Object pp = method.invoke(connectivityManager); 36 | if (pp == null) 37 | return; 38 | 39 | getUserProxy(pp); 40 | } catch (final Exception e) { 41 | e.printStackTrace(); 42 | } 43 | } 44 | 45 | private void getUserProxy(final Object pp) throws Exception { 46 | String className = "android.net.ProxyProperties"; 47 | Class c = Class.forName(className); 48 | Method method; 49 | 50 | method = c.getMethod("getHost"); 51 | Host = (String) method.invoke(pp); 52 | 53 | method = c.getMethod("getPort"); 54 | Port = (Integer) method.invoke(pp); 55 | 56 | method = c.getMethod("getExclusionList"); 57 | ExclusionList = (String) method.invoke(pp); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /app/src/main/java/net/kibotu/android/deviceinfo/ui/list/binder/CardViewHorizontalListItemBinder.java: -------------------------------------------------------------------------------- 1 | package net.kibotu.android.deviceinfo.ui.list.binder; 2 | 3 | import android.view.ViewGroup; 4 | import android.widget.TextView; 5 | import androidx.annotation.LayoutRes; 6 | import androidx.annotation.NonNull; 7 | import androidx.annotation.Nullable; 8 | import androidx.recyclerview.widget.RecyclerView; 9 | import butterknife.BindView; 10 | import net.kibotu.android.deviceinfo.R; 11 | import net.kibotu.android.deviceinfo.model.ListItem; 12 | import net.kibotu.android.recyclerviewpresenter.Presenter; 13 | import net.kibotu.android.recyclerviewpresenter.RecyclerViewHolder; 14 | import net.kibotu.logger.Logger; 15 | import org.jetbrains.annotations.NotNull; 16 | 17 | import static android.text.Html.fromHtml; 18 | import static android.text.TextUtils.isEmpty; 19 | 20 | /** 21 | * Created by Nyaruhodo on 21.02.2016. 22 | */ 23 | public class CardViewHorizontalListItemBinder extends Presenter { 24 | 25 | @Override 26 | public int getLayout() { 27 | return R.layout.cardview_horizontal; 28 | } 29 | 30 | @Override 31 | public void bindViewHolder(@NotNull RecyclerView.ViewHolder viewHolder, @NotNull ListItem item, int i) { 32 | // if (!isEmpty(item.getLabel())) 33 | // viewHolder.label.setText(item.getLabel()); 34 | // 35 | // if (!isEmpty(item.getValue())) 36 | // viewHolder.value.setText(fromHtml(item.getValue())); 37 | // 38 | // Logger.v("label: " + viewHolder.label.getText() + " value: " + viewHolder.value.getText()); 39 | // 40 | // viewHolder.itemView.setOnClickListener(v -> Logger.toast(item.getDescription())); 41 | } 42 | 43 | public static class ViewHolder extends RecyclerViewHolder { 44 | 45 | @NonNull 46 | @BindView(R.id.label) 47 | TextView label; 48 | 49 | @NonNull 50 | @BindView(R.id.value) 51 | TextView value; 52 | 53 | public ViewHolder(@LayoutRes int layout, @Nullable ViewGroup parent) { 54 | super(parent, layout); 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /app/src/main/res/layout/drawer_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 11 | 12 | 16 | 17 | 21 | 22 | 27 | 28 | 33 | 34 | 35 | 36 | 44 | 45 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Donation](https://img.shields.io/badge/buy%20me%20a%20coffee-brightgreen.svg)](https://www.paypal.me/janrabe/5) [![About Jan Rabe](https://img.shields.io/badge/about-me-green.svg)](https://about.me/janrabe) 2 | # Android Device Info [![](https://jitpack.io/v/kibotu/net.kibotu.android.deviceinfo.svg)](https://jitpack.io/#kibotu/net.kibotu.android.deviceinfo) [![](https://jitpack.io/v/kibotu/net.kibotu.android.deviceinfo/month.svg)](https://jitpack.io/#kibotu/net.kibotu.android.deviceinfo) [![Build Status](https://travis-ci.org/kibotu/net.kibotu.android.deviceinfo.svg?branch=develop)](https://travis-ci.org/kibotu/net.kibotu.android.deviceinfo) [![API](https://img.shields.io/badge/API-15%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=15) [![Gradle Version](https://img.shields.io/badge/gradle-5.4.1-green.svg)](https://docs.gradle.org/current/release-notes) [![Licence](https://img.shields.io/badge/licence-Apache-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0) [![Javadoc](https://img.shields.io/badge/javadoc-SNAPSHOT-green.svg)](https://jitpack.io/com/github/kibotu/net.kibotu.android.deviceinfo/develop-SNAPSHOT/javadoc/index.html) 3 | 4 | ### Introduction 5 | 6 | Library and app for showing tons of device information for your android device. 7 | 8 | ### How to install 9 | 10 | repositories { 11 | maven { 12 | url "https://jitpack.io" 13 | } 14 | } 15 | 16 | dependencies { 17 | compile 'com.github.kibotu:net.kibotu.android.deviceinfo:-SNAPSHOT' 18 | } 19 | 20 | 21 | ### How to build the lib: 22 | 23 | gradle clean lib:build 24 | 25 | ### Features 26 | 27 | ##### Build 28 | 29 | Build.getSystemAvailableFeatures() 30 | 31 | ##### Configuration 32 | ##### Cpu 33 | ##### Gpu 34 | ##### Memory 35 | ##### Battery 36 | ##### Display 37 | ##### Network 38 | ##### Sensor 39 | ##### Java 40 | ##### Geolocation 41 | ##### App 42 | ##### Misc 43 | 44 | 45 | ### Todo 46 | 47 | * documentation how to access the data, currently it can be found at the demo app 48 | * memory: add environment info 49 | * display: finish display class info 50 | * display: fix configuration info 51 | * geolocation: add fusion, also gmaps 52 | * option menu: re-add endpoints for github, twitter, fbook, find parse alternative server endpoint to store shared device data 53 | * release new build to gplay 54 | 55 | -------------------------------------------------------------------------------- /lib/src/main/java/net/kibotu/android/deviceinfo/library/battery/BatteryReceiver.java: -------------------------------------------------------------------------------- 1 | package net.kibotu.android.deviceinfo.library.battery; 2 | 3 | import android.content.BroadcastReceiver; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | import android.content.IntentFilter; 7 | import android.os.BatteryManager; 8 | 9 | import static net.kibotu.android.deviceinfo.library.Device.getContext; 10 | 11 | /** 12 | * @see BatteryManager 13 | */ 14 | public class BatteryReceiver extends BroadcastReceiver { 15 | 16 | private final BatteryObservable batteryObservable; 17 | 18 | public BatteryReceiver() { 19 | batteryObservable = new BatteryObservable(); 20 | } 21 | 22 | public BatteryReceiver addObserver(BatteryUpdateListener listener) { 23 | batteryObservable.addObserver(listener); 24 | return this; 25 | } 26 | 27 | public BatteryReceiver deleteObserver(BatteryUpdateListener listener) { 28 | batteryObservable.deleteObserver(listener); 29 | return this; 30 | } 31 | 32 | public BatteryReceiver registerReceiver() { 33 | final IntentFilter filter = new IntentFilter(Intent.ACTION_BATTERY_CHANGED); 34 | getContext().registerReceiver(this, filter); 35 | return this; 36 | } 37 | 38 | public BatteryReceiver unregisterReceiver() { 39 | getContext().unregisterReceiver(this); 40 | return this; 41 | } 42 | 43 | @Override 44 | public void onReceive(Context context, Intent intent) { 45 | 46 | final Battery battery = new Battery() 47 | .setHealth(intent.getIntExtra(BatteryManager.EXTRA_HEALTH, 0)) 48 | .setPlugged(intent.getIntExtra(BatteryManager.EXTRA_PLUGGED, 0)) 49 | .setLevel(intent.getIntExtra(BatteryManager.EXTRA_LEVEL, 0)) 50 | .setScale(intent.getIntExtra(BatteryManager.EXTRA_SCALE, 0)) 51 | .setTemperature(intent.getIntExtra(BatteryManager.EXTRA_TEMPERATURE, 0)) 52 | .setVoltage(intent.getIntExtra(BatteryManager.EXTRA_VOLTAGE, 0)) 53 | .setPresent(intent.getBooleanExtra(BatteryManager.EXTRA_PRESENT, true)) 54 | .setTechnology(intent.getStringExtra(BatteryManager.EXTRA_TECHNOLOGY)) 55 | .setStatus(intent.getIntExtra(BatteryManager.EXTRA_STATUS, 0)); 56 | 57 | batteryObservable.notifyObservers(battery); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /lib/src/main/java/net/kibotu/android/deviceinfo/library/version/VersionCode.java: -------------------------------------------------------------------------------- 1 | package net.kibotu.android.deviceinfo.library.version; 2 | 3 | 4 | import androidx.annotation.IntDef; 5 | 6 | import java.lang.annotation.Retention; 7 | import java.lang.annotation.RetentionPolicy; 8 | 9 | import static android.os.Build.VERSION_CODES.BASE; 10 | import static android.os.Build.VERSION_CODES.BASE_1_1; 11 | import static android.os.Build.VERSION_CODES.CUPCAKE; 12 | import static android.os.Build.VERSION_CODES.DONUT; 13 | import static android.os.Build.VERSION_CODES.ECLAIR; 14 | import static android.os.Build.VERSION_CODES.ECLAIR_0_1; 15 | import static android.os.Build.VERSION_CODES.ECLAIR_MR1; 16 | import static android.os.Build.VERSION_CODES.FROYO; 17 | import static android.os.Build.VERSION_CODES.GINGERBREAD; 18 | import static android.os.Build.VERSION_CODES.GINGERBREAD_MR1; 19 | import static android.os.Build.VERSION_CODES.HONEYCOMB; 20 | import static android.os.Build.VERSION_CODES.HONEYCOMB_MR1; 21 | import static android.os.Build.VERSION_CODES.HONEYCOMB_MR2; 22 | import static android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH; 23 | import static android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1; 24 | import static android.os.Build.VERSION_CODES.JELLY_BEAN; 25 | import static android.os.Build.VERSION_CODES.JELLY_BEAN_MR1; 26 | import static android.os.Build.VERSION_CODES.JELLY_BEAN_MR2; 27 | import static android.os.Build.VERSION_CODES.KITKAT; 28 | import static android.os.Build.VERSION_CODES.KITKAT_WATCH; 29 | import static android.os.Build.VERSION_CODES.LOLLIPOP; 30 | import static android.os.Build.VERSION_CODES.LOLLIPOP_MR1; 31 | import static android.os.Build.VERSION_CODES.M; 32 | 33 | /** 34 | * Created by Nyaruhodo on 21.02.2016. 35 | * 36 | * @see What is API Level? 37 | */ 38 | 39 | @IntDef({BASE, 40 | BASE_1_1, 41 | CUPCAKE, 42 | DONUT, 43 | ECLAIR, 44 | ECLAIR_0_1, 45 | ECLAIR_MR1, 46 | FROYO, 47 | GINGERBREAD, 48 | GINGERBREAD_MR1, 49 | HONEYCOMB, 50 | HONEYCOMB_MR1, 51 | HONEYCOMB_MR2, 52 | ICE_CREAM_SANDWICH, 53 | ICE_CREAM_SANDWICH_MR1, 54 | JELLY_BEAN, 55 | JELLY_BEAN_MR1, 56 | JELLY_BEAN_MR2, 57 | KITKAT, 58 | KITKAT_WATCH, 59 | LOLLIPOP, 60 | LOLLIPOP_MR1, 61 | M}) 62 | @Retention(RetentionPolicy.SOURCE) 63 | public @interface VersionCode { 64 | } 65 | -------------------------------------------------------------------------------- /app/src/main/res/layout/cardview_horizontal.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 22 | 23 | 38 | 39 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /app/src/main/java/net/kibotu/android/deviceinfo/ui/sensor/SensorValuesFragment.java: -------------------------------------------------------------------------------- 1 | package net.kibotu.android.deviceinfo.ui.sensor; 2 | 3 | import android.hardware.SensorEventListener; 4 | import android.hardware.SensorManager; 5 | import android.os.Bundle; 6 | import androidx.annotation.NonNull; 7 | import androidx.annotation.Nullable; 8 | import android.view.View; 9 | import android.widget.TextView; 10 | 11 | import com.common.android.utils.interfaces.TitleProvider; 12 | import com.jjoe64.graphview.GraphView; 13 | 14 | import net.kibotu.android.deviceinfo.R; 15 | import net.kibotu.android.deviceinfo.ui.BaseFragment; 16 | 17 | import butterknife.BindView; 18 | 19 | import static android.hardware.SensorManager.SENSOR_DELAY_UI; 20 | import static net.kibotu.android.deviceinfo.library.services.SystemService.getSensorManager; 21 | 22 | /** 23 | * Created by Nyaruhodo on 03.04.2016. 24 | */ 25 | public abstract class SensorValuesFragment extends BaseFragment implements TitleProvider { 26 | 27 | @NonNull 28 | @BindView(R.id.x) 29 | TextView xLabel; 30 | @NonNull 31 | @BindView(R.id.y) 32 | TextView yLabel; 33 | @NonNull 34 | @BindView(R.id.z) 35 | TextView zLabel; 36 | 37 | @NonNull 38 | @BindView(R.id.graph) 39 | GraphView graphView; 40 | 41 | protected SensorManager sensorManager; 42 | protected SensorEventListener sensorEventListener; 43 | 44 | @Override 45 | public int getLayout() { 46 | return R.layout.sensor; 47 | } 48 | 49 | @Override 50 | public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { 51 | super.onViewCreated(view, savedInstanceState); 52 | sensorEventListener = createSensorEventListener(); 53 | } 54 | 55 | @Override 56 | public void onResume() { 57 | super.onResume(); 58 | registerSensor(); 59 | } 60 | 61 | @Override 62 | public void onPause() { 63 | unregisterSensor(); 64 | super.onPause(); 65 | } 66 | 67 | protected void registerSensor() { 68 | sensorManager = getSensorManager(); 69 | // SENSOR_DELAY_NORMAL, SENSOR_DELAY_UI, SENSOR_DELAY_GAME, or SENSOR_DELAY_FASTEST 70 | sensorManager.registerListener(sensorEventListener, sensorManager.getDefaultSensor(sensorType()), SENSOR_DELAY_UI); 71 | } 72 | 73 | protected void unregisterSensor() { 74 | sensorManager.unregisterListener(sensorEventListener); 75 | } 76 | 77 | protected abstract SensorEventListener createSensorEventListener(); 78 | 79 | protected abstract int sensorType(); 80 | } 81 | -------------------------------------------------------------------------------- /lib/build.gradle: -------------------------------------------------------------------------------- 1 | ext { 2 | VERSION_NAME = simpleReleaseVersionName() 3 | VERSION_CODE = commitCount() 4 | CANONICAL_VERSION_NAME = canonicalReleaseVersionName() 5 | BRANCH_NAME = branchName() 6 | COMMIT_HASH = commitHash() 7 | isLocal = project.rootProject.file('local.properties').exists() 8 | isTesting = false 9 | BUILD_TIME = new Date().getTime() 10 | } 11 | 12 | apply plugin: 'com.android.library' 13 | apply plugin: 'kotlin-android' 14 | apply plugin: 'com.github.dcendents.android-maven' 15 | apply plugin: 'com.getkeepsafe.dexcount' 16 | 17 | android { 18 | compileSdkVersion compileSdkVer 19 | buildToolsVersion buildToolsVer 20 | 21 | defaultConfig { 22 | minSdkVersion minSdkVer 23 | targetSdkVersion targetSdkVer 24 | versionCode VERSION_CODE 25 | versionName VERSION_NAME 26 | vectorDrawables.useSupportLibrary = true 27 | } 28 | 29 | buildTypes { 30 | debug { 31 | minifyEnabled false 32 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 33 | } 34 | release { 35 | minifyEnabled false 36 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 37 | } 38 | } 39 | 40 | // region dex options 41 | 42 | dexOptions { 43 | javaMaxHeapSize "4g" 44 | maxProcessCount 8 45 | } 46 | 47 | // endregion 48 | 49 | compileOptions { 50 | sourceCompatibility JavaVersion.VERSION_1_8 51 | targetCompatibility JavaVersion.VERSION_1_8 52 | } 53 | 54 | // region lint options https://developer.android.com/studio/write/lint#gradle 55 | 56 | lintOptions { 57 | disable 'InvalidPackage' 58 | abortOnError false // true by default 59 | checkAllWarnings false 60 | checkReleaseBuilds false 61 | ignoreWarnings true // false by default 62 | quiet true // false by default 63 | ignoreTestSources true 64 | checkDependencies true 65 | tasks.lint.enabled = false 66 | } 67 | 68 | // endregion 69 | 70 | // region exclude duplicated meta inf files 71 | 72 | packagingOptions { 73 | exclude 'META-INF/library-core_release.kotlin_module' 74 | exclude 'META-INF/lib_release.kotlin_module' 75 | } 76 | 77 | // endregion 78 | } 79 | 80 | dependencies { 81 | implementation libs.kotlinJdk8 82 | implementation libs.androidKtxCore 83 | // network connection handling 84 | implementation libs.connectionBuddy 85 | implementation libs.logger 86 | } 87 | 88 | apply from: "${project.rootDir}/Android-Dependencies/javadoc.gradle" -------------------------------------------------------------------------------- /app/src/main/java/net/kibotu/android/deviceinfo/ui/list/binder/HorizontalListItemBinder.java: -------------------------------------------------------------------------------- 1 | package net.kibotu.android.deviceinfo.ui.list.binder; 2 | 3 | import androidx.annotation.LayoutRes; 4 | import androidx.annotation.NonNull; 5 | import androidx.annotation.Nullable; 6 | import android.view.View; 7 | import android.view.ViewGroup; 8 | import android.widget.TextView; 9 | 10 | import com.common.android.utils.logging.Logger; 11 | 12 | import net.kibotu.android.deviceinfo.R; 13 | import net.kibotu.android.deviceinfo.model.ListItem; 14 | import net.kibotu.android.recyclerviewpresenter.BaseViewHolder; 15 | import net.kibotu.android.recyclerviewpresenter.Presenter; 16 | import net.kibotu.android.recyclerviewpresenter.PresenterAdapter; 17 | 18 | import butterknife.BindView; 19 | 20 | import static android.text.Html.fromHtml; 21 | import static android.text.TextUtils.isEmpty; 22 | 23 | /** 24 | * Created by Nyaruhodo on 06.03.2016. 25 | */ 26 | public class HorizontalListItemBinder extends Presenter { 27 | 28 | public HorizontalListItemBinder(@NonNull PresenterAdapter dataBindAdapter) { 29 | super(dataBindAdapter); 30 | } 31 | 32 | @Override 33 | public int getLayout() { 34 | return R.layout.item_horizontal; 35 | } 36 | 37 | @NonNull 38 | @Override 39 | protected ViewHolder createViewHolder(@LayoutRes int layout, @NonNull ViewGroup parent) { 40 | return new ViewHolder(layout, parent); 41 | } 42 | 43 | @Override 44 | public void bindViewHolder(@NonNull ViewHolder viewHolder, @NonNull ListItem item, int position) { 45 | 46 | if (!isEmpty(item.getLabel())) { 47 | viewHolder.label.setVisibility(View.VISIBLE); 48 | viewHolder.label.setText(fromHtml(item.getLabel())); 49 | } else { 50 | viewHolder.label.setVisibility(View.GONE); 51 | } 52 | 53 | if (!isEmpty(item.getValue())) { 54 | viewHolder.value.setVisibility(View.VISIBLE); 55 | viewHolder.value.setText(fromHtml(item.getValue())); 56 | } else { 57 | viewHolder.value.setVisibility(View.GONE); 58 | } 59 | 60 | viewHolder.itemView.setOnClickListener(v -> Logger.toast(item.getDescription())); 61 | 62 | Logger.v(tag(), "label: " + viewHolder.label.getText() + " value: " + viewHolder.value.getText()); 63 | } 64 | 65 | public static class ViewHolder extends BaseViewHolder { 66 | 67 | @NonNull 68 | @BindView(R.id.label) 69 | TextView label; 70 | 71 | @NonNull 72 | @BindView(R.id.value) 73 | TextView value; 74 | 75 | public ViewHolder(@LayoutRes int layout, @Nullable ViewGroup parent) { 76 | super(layout, parent); 77 | } 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /lib/src/main/java/net/kibotu/android/deviceinfo/library/network/SIM.java: -------------------------------------------------------------------------------- 1 | package net.kibotu.android.deviceinfo.library.network; 2 | 3 | import android.Manifest; 4 | import android.content.Context; 5 | import android.content.pm.PackageManager; 6 | import android.telephony.TelephonyManager; 7 | 8 | import androidx.annotation.RequiresPermission; 9 | import androidx.core.content.ContextCompat; 10 | 11 | import static net.kibotu.ContextHelper.getApplication; 12 | import static net.kibotu.android.deviceinfo.library.Device.getContext; 13 | 14 | public class SIM { 15 | 16 | public String simCountry; 17 | public String simOperatorCode; 18 | public String simOperatorName; 19 | public String simSerial; 20 | public String simState; 21 | 22 | /** 23 | * Requires {@link android.Manifest.permission#READ_PHONE_STATE} 24 | */ 25 | public SIM() { 26 | load(); 27 | } 28 | 29 | @RequiresPermission(Manifest.permission.READ_PHONE_STATE) 30 | public void load() { 31 | 32 | final TelephonyManager telephonyManager = (TelephonyManager) getContext().getSystemService(Context.TELEPHONY_SERVICE); 33 | 34 | switch (telephonyManager.getSimState()) { 35 | 36 | case (TelephonyManager.SIM_STATE_ABSENT): 37 | simState = "SIM_STATE_ABSENT"; 38 | break; 39 | case (TelephonyManager.SIM_STATE_NETWORK_LOCKED): 40 | simState = "SIM_STATE_NETWORK_LOCKED"; 41 | break; 42 | case (TelephonyManager.SIM_STATE_PIN_REQUIRED): 43 | simState = "SIM_STATE_PIN_REQUIRED"; 44 | break; 45 | case (TelephonyManager.SIM_STATE_PUK_REQUIRED): 46 | simState = "SIM_STATE_PUK_REQUIRED"; 47 | break; 48 | case (TelephonyManager.SIM_STATE_READY): 49 | simState = "SIM_STATE_READY"; 50 | // Get the SIM country ISO code 51 | simCountry = telephonyManager.getSimCountryIso(); 52 | // Get the operator code of the active SIM (MCC + MNC) 53 | simOperatorCode = telephonyManager.getSimOperator(); 54 | // Get the name of the SIM operator 55 | simOperatorName = telephonyManager.getSimOperatorName(); 56 | // Get the SIM’s serial number 57 | if (hasReadPhonePermission()) 58 | simSerial = telephonyManager.getSimSerialNumber(); 59 | break; 60 | case (TelephonyManager.SIM_STATE_UNKNOWN): 61 | simState = "SIM_STATE_UNKNOWN"; 62 | break; 63 | } 64 | } 65 | 66 | public static boolean hasReadPhonePermission() { 67 | return ContextCompat.checkSelfPermission(getApplication(), Manifest.permission.READ_PHONE_STATE) == PackageManager.PERMISSION_GRANTED; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /lib/src/main/java/net/kibotu/android/deviceinfo/library/gpu/OpenGLExtensions.java: -------------------------------------------------------------------------------- 1 | package net.kibotu.android.deviceinfo.library.gpu; 2 | 3 | import android.annotation.TargetApi; 4 | import android.opengl.GLES10; 5 | import android.opengl.GLES20; 6 | import android.opengl.GLES30; 7 | import android.os.Build; 8 | 9 | import java.nio.IntBuffer; 10 | 11 | import javax.microedition.khronos.egl.EGL10; 12 | import javax.microedition.khronos.egl.EGLConfig; 13 | import javax.microedition.khronos.egl.EGLDisplay; 14 | 15 | import static net.kibotu.android.deviceinfo.library.services.SystemService.getActivityManager; 16 | 17 | /** 18 | * Created by Nyaruhodo on 05.03.2016. 19 | */ 20 | public class OpenGLExtensions { 21 | 22 | private volatile static IntBuffer buffer = IntBuffer.allocate(1); 23 | private volatile static IntBuffer buffer2 = IntBuffer.allocate(2); 24 | private volatile static int[] arrayBuffer = new int[1]; 25 | 26 | public synchronized static int glGetIntegerv(int value) { 27 | buffer.clear(); 28 | GLES10.glGetIntegerv(value, buffer); 29 | return buffer.get(0); 30 | } 31 | 32 | public synchronized static int[] glGetIntegerv(int value, int size) { 33 | final IntBuffer buffer = IntBuffer.allocate(size); 34 | GLES10.glGetIntegerv(value, buffer); 35 | return buffer.array(); 36 | } 37 | 38 | public synchronized static int[] glGetShaderPrecisionFormat(int shaderType, int precisionType) { 39 | if (!supportsOpenGLES2()) return new int[]{0, 0, 0}; 40 | buffer2.clear(); 41 | GLES20.glGetShaderPrecisionFormat(shaderType, precisionType, buffer2, buffer); 42 | return new int[]{buffer2.get(0), buffer2.get(1), buffer.get(0)}; 43 | } 44 | 45 | public synchronized static int eglGetConfigAttrib(int eglType, final EGL10 egl, final EGLDisplay display, final EGLConfig eglConfig) { 46 | egl.eglGetConfigAttrib(display, eglConfig, eglType, arrayBuffer); 47 | return arrayBuffer[0]; 48 | } 49 | 50 | public static boolean isVTFSupported() { 51 | GLES10.glGetIntegerv(GLES20.GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, arrayBuffer, 0); 52 | return arrayBuffer[0] != 0; 53 | } 54 | 55 | public static String glGetString(int value) { 56 | return GLES10.glGetString(value); 57 | } 58 | 59 | @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2) 60 | public static String glGetStringi(int value, int index) { 61 | return GLES30.glGetStringi(value, index); 62 | } 63 | 64 | public static boolean supportsOpenGLES2() { 65 | return getOpenGLVersion() >= 0x20000; 66 | } 67 | 68 | public static boolean supportsOpenGLES3() { 69 | return getOpenGLVersion() >= 0x30000; 70 | } 71 | 72 | public static int getOpenGLVersion() { 73 | return getActivityManager() 74 | .getDeviceConfigurationInfo() 75 | .reqGlEsVersion; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /lib/src/main/java/net/kibotu/android/deviceinfo/library/network/InetAddressUtils.java: -------------------------------------------------------------------------------- 1 | package net.kibotu.android.deviceinfo.library.network;/* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | 29 | import java.util.regex.Pattern; 30 | 31 | 32 | /** 33 | * A collection of utilities relating to InetAddresses. 34 | * 35 | * @since 4.0 36 | */ 37 | final public class InetAddressUtils { 38 | 39 | private InetAddressUtils() throws IllegalAccessException { 40 | throw new IllegalAccessException(); 41 | } 42 | 43 | private static final Pattern IPV4_PATTERN = 44 | Pattern.compile( 45 | "^(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)(\\.(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)){3}$"); 46 | 47 | private static final Pattern IPV6_STD_PATTERN = 48 | Pattern.compile( 49 | "^(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$"); 50 | 51 | private static final Pattern IPV6_HEX_COMPRESSED_PATTERN = 52 | Pattern.compile( 53 | "^((?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4})*)?)::((?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4})*)?)$"); 54 | 55 | public static boolean isIPv4Address(final String input) { 56 | return IPV4_PATTERN.matcher(input).matches(); 57 | } 58 | 59 | public static boolean isIPv6StdAddress(final String input) { 60 | return IPV6_STD_PATTERN.matcher(input).matches(); 61 | } 62 | 63 | public static boolean isIPv6HexCompressedAddress(final String input) { 64 | return IPV6_HEX_COMPRESSED_PATTERN.matcher(input).matches(); 65 | } 66 | 67 | public static boolean isIPv6Address(final String input) { 68 | return isIPv6StdAddress(input) || isIPv6HexCompressedAddress(input); 69 | } 70 | 71 | } 72 | -------------------------------------------------------------------------------- /lib/src/main/java/net/kibotu/android/deviceinfo/library/misc/UpdateTimer.java: -------------------------------------------------------------------------------- 1 | package net.kibotu.android.deviceinfo.library.misc; 2 | 3 | import android.app.Activity; 4 | 5 | import net.kibotu.android.deviceinfo.library.Device; 6 | 7 | import java.util.Observable; 8 | import java.util.Observer; 9 | import java.util.Timer; 10 | import java.util.TimerTask; 11 | import java.util.concurrent.TimeUnit; 12 | 13 | /** 14 | * Created by Nyaruhodo on 12.03.2016. 15 | */ 16 | public abstract class UpdateTimer { 17 | 18 | public static abstract class UpdateListener implements Observer { 19 | 20 | @Override 21 | public void update(Observable observable, Object data) { 22 | try { 23 | update((T) data); 24 | } catch (ClassCastException e) { 25 | e.printStackTrace(); 26 | } 27 | } 28 | 29 | protected abstract void update(T t); 30 | } 31 | 32 | private Observable observable; 33 | 34 | private Timer timer; 35 | private long updateInterval; 36 | 37 | public UpdateTimer() { 38 | observable = new Observable() { 39 | 40 | @Override 41 | public void notifyObservers(Object data) { 42 | setChanged(); 43 | super.notifyObservers(data); 44 | } 45 | }; 46 | updateInterval = TimeUnit.SECONDS.toMillis(1); 47 | } 48 | 49 | public UpdateTimer addObserver(UpdateListener listener) { 50 | observable.addObserver(listener); 51 | return this; 52 | } 53 | 54 | public UpdateTimer deleteObserver(UpdateListener listener) { 55 | observable.deleteObserver(listener); 56 | return this; 57 | } 58 | 59 | public UpdateTimer setUpdateInterval(long timeInMillis) { 60 | updateInterval = timeInMillis; 61 | return this; 62 | } 63 | 64 | public UpdateTimer start() { 65 | if (timer != null) 66 | return this; 67 | 68 | timer = new Timer(); 69 | 70 | // scheduling cpu usage updates 71 | timer.scheduleAtFixedRate(new TimerTask() { 72 | @Override 73 | public void run() { 74 | 75 | final T data = getData(); 76 | 77 | // doing ui updates on main thread 78 | ((Activity) Device.getContext()).runOnUiThread(new Runnable() { 79 | @Override 80 | public void run() { 81 | observable.notifyObservers(data); 82 | } 83 | }); 84 | } 85 | }, 0, updateInterval); 86 | 87 | return this; 88 | } 89 | 90 | protected abstract T getData(); 91 | 92 | public UpdateTimer stop() { 93 | if (timer != null) { 94 | timer.cancel(); 95 | timer = null; 96 | } 97 | return this; 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /lib/src/main/java/net/kibotu/android/deviceinfo/library/gpu/EglChooser.java: -------------------------------------------------------------------------------- 1 | package net.kibotu.android.deviceinfo.library.gpu; 2 | 3 | import android.opengl.GLSurfaceView; 4 | 5 | import javax.microedition.khronos.egl.EGL10; 6 | import javax.microedition.khronos.egl.EGLConfig; 7 | import javax.microedition.khronos.egl.EGLDisplay; 8 | 9 | public class EglChooser implements GLSurfaceView.EGLConfigChooser { 10 | 11 | public T info; 12 | 13 | public EglChooser(final T info) { 14 | this.info = info; 15 | } 16 | 17 | @Override 18 | public EGLConfig chooseConfig(final EGL10 egl, final EGLDisplay display) { 19 | 20 | //Querying number of configurations 21 | final int[] num_conf = new int[1]; 22 | egl.eglGetConfigs(display, null, 0, num_conf); //if configuration array is null it still returns the number of configurations 23 | final int configurations = num_conf[0]; 24 | 25 | //Querying actual configurations 26 | final EGLConfig[] conf = new EGLConfig[configurations]; 27 | egl.eglGetConfigs(display, conf, configurations, num_conf); 28 | 29 | EGLConfig result = null; 30 | 31 | for (int i = 0; i < configurations; i++) { 32 | result = better(result, conf[i], egl, display); 33 | 34 | final Egl config = new Egl(egl, display, conf[i]); 35 | if (config.EGL_RED_SIZE + config.EGL_BLUE_SIZE + config.EGL_GREEN_SIZE + config.EGL_ALPHA_SIZE >= 16) 36 | info.eglconfigs.add(config); 37 | } 38 | 39 | return result; 40 | } 41 | 42 | /** 43 | * Returns the best of the two EGLConfig passed according to depth and colours 44 | * 45 | * @param a The first candidate 46 | * @param b The second candidate 47 | * @return The chosen candidate 48 | */ 49 | private EGLConfig better(EGLConfig a, EGLConfig b, EGL10 egl, EGLDisplay display) { 50 | if (a == null) return b; 51 | 52 | EGLConfig result; 53 | 54 | int[] value = new int[1]; 55 | 56 | egl.eglGetConfigAttrib(display, a, EGL10.EGL_DEPTH_SIZE, value); 57 | int depthA = value[0]; 58 | 59 | egl.eglGetConfigAttrib(display, b, EGL10.EGL_DEPTH_SIZE, value); 60 | int depthB = value[0]; 61 | 62 | if (depthA > depthB) 63 | result = a; 64 | else if (depthA < depthB) 65 | result = b; 66 | else //if depthA == depthB 67 | { 68 | egl.eglGetConfigAttrib(display, a, EGL10.EGL_RED_SIZE, value); 69 | int redA = value[0]; 70 | 71 | egl.eglGetConfigAttrib(display, b, EGL10.EGL_RED_SIZE, value); 72 | int redB = value[0]; 73 | 74 | if (redA > redB) 75 | result = a; 76 | else if (redA < redB) 77 | result = b; 78 | else //if redA == redB 79 | { 80 | //Don't care 81 | result = a; 82 | } 83 | } 84 | 85 | return result; 86 | } 87 | } -------------------------------------------------------------------------------- /app/src/main/java/net/kibotu/android/deviceinfo/ui/list/binder/CardViewSubListItemBinder.java: -------------------------------------------------------------------------------- 1 | package net.kibotu.android.deviceinfo.ui.list.binder; 2 | 3 | import androidx.annotation.LayoutRes; 4 | import androidx.annotation.NonNull; 5 | import android.support.v7.widget.LinearLayoutManager; 6 | import android.support.v7.widget.RecyclerView; 7 | import android.view.ViewGroup; 8 | import android.widget.TextView; 9 | 10 | import com.common.android.utils.logging.Logger; 11 | 12 | import net.kibotu.android.deviceinfo.R; 13 | import net.kibotu.android.deviceinfo.model.ListItem; 14 | import net.kibotu.android.recyclerviewpresenter.BaseViewHolder; 15 | import net.kibotu.android.recyclerviewpresenter.Presenter; 16 | import net.kibotu.android.recyclerviewpresenter.PresenterAdapter; 17 | 18 | import butterknife.BindView; 19 | 20 | import static com.common.android.utils.ContextHelper.getContext; 21 | 22 | /** 23 | * Created by Nyaruhodo on 05.03.2016. 24 | */ 25 | public class CardViewSubListItemBinder extends Presenter { 26 | 27 | public CardViewSubListItemBinder(@NonNull PresenterAdapter dataBindAdapter) { 28 | super(dataBindAdapter); 29 | } 30 | 31 | @Override 32 | public int getLayout() { 33 | return R.layout.sub_list_item; 34 | } 35 | 36 | @NonNull 37 | @Override 38 | protected ViewHolder createViewHolder(int layout, @NonNull ViewGroup viewGroup) { 39 | return new ViewHolder(layout, viewGroup); 40 | } 41 | 42 | @Override 43 | public void bindViewHolder(@NonNull ViewHolder viewHolder, @NonNull ListItem item, int position) { 44 | 45 | viewHolder.label.setText(item.getLabel()); 46 | 47 | viewHolder.adapter.clear(); 48 | 49 | if (item.hasChildren()) 50 | for (ListItem child : item.getChildren()) 51 | viewHolder.adapter.add(child, HorizontalListItemBinder.class); 52 | 53 | viewHolder.adapter.notifyDataSetChanged(); 54 | 55 | viewHolder.itemView.setOnClickListener(v -> { 56 | Logger.toast(item.getDescription()); 57 | 58 | if (presenterAdapter.getOnItemClickListener() != null) 59 | presenterAdapter.getOnItemClickListener().onItemClick(item, viewHolder.itemView, position); 60 | }); 61 | 62 | Logger.v(tag(), "label: " + viewHolder.label.getText()); 63 | } 64 | 65 | public static class ViewHolder extends BaseViewHolder { 66 | 67 | @NonNull 68 | @BindView(R.id.label) 69 | TextView label; 70 | 71 | @NonNull 72 | @BindView(R.id.list) 73 | RecyclerView list; 74 | 75 | final PresenterAdapter adapter; 76 | 77 | public ViewHolder(@LayoutRes int layout, ViewGroup parent) { 78 | super(layout, parent); 79 | 80 | adapter = new PresenterAdapter<>(); 81 | list.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false)); 82 | list.setAdapter(adapter); 83 | } 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /lib/src/main/java/net/kibotu/android/deviceinfo/library/bluetooth/Bluetooth.java: -------------------------------------------------------------------------------- 1 | package net.kibotu.android.deviceinfo.library.bluetooth; 2 | 3 | import android.bluetooth.BluetoothDevice; 4 | import android.content.BroadcastReceiver; 5 | import android.content.Context; 6 | import android.content.Intent; 7 | import android.content.IntentFilter; 8 | 9 | public class Bluetooth extends BroadcastReceiver { 10 | 11 | public volatile String UUID; 12 | public volatile String BOND_STATE; 13 | public volatile String CLASS; 14 | public volatile String DEVICE; 15 | public volatile String NAME; 16 | public volatile String PAIRING_KEY; 17 | public volatile String PAIRING_VARIANT; 18 | public volatile String PREVIOUS_BOND_STATE; 19 | public volatile int RSSI; 20 | public volatile String VARIANT_PASSKEY_CONFIRMATION; 21 | public volatile String VARIANT_PIN; 22 | 23 | public Bluetooth(final Context context) { 24 | registerReceiver(context); 25 | 26 | UUID = "-1"; 27 | BOND_STATE = "-1"; 28 | CLASS = "-1"; 29 | DEVICE = "-1"; 30 | NAME = "-1"; 31 | PAIRING_KEY = "-1"; 32 | PAIRING_VARIANT = "-1"; 33 | PREVIOUS_BOND_STATE = "-1"; 34 | RSSI = -1; 35 | VARIANT_PASSKEY_CONFIRMATION = "-1"; 36 | VARIANT_PIN = "-1"; 37 | } 38 | 39 | @Override 40 | public void onReceive(Context context, Intent intent) { 41 | final String action = intent.getAction(); 42 | 43 | if (BluetoothDevice.ACTION_FOUND.equals(action)) { 44 | RSSI = intent.getShortExtra(BluetoothDevice.ACTION_BOND_STATE_CHANGED, Short.MIN_VALUE); 45 | } 46 | // rssi = intent.getShortExtra(BluetoothDevice.EXTRA_NAME, Short.MIN_VALUE); 47 | // rssi = intent.getShortExtra(BluetoothDevice.EXTRA_RSSI, Short.MIN_VALUE); 48 | // rssi = intent.getShortExtra(BluetoothDevice.EXTRA_CLASS, Short.MIN_VALUE); 49 | // rssi = intent.getShortExtra(BluetoothDevice.EXTRA_BOND_STATE, Short.MIN_VALUE); 50 | // rssi = intent.getShortExtra(BluetoothDevice.EXTRA_PREVIOUS_BOND_STATE, Short.MIN_VALUE); 51 | 52 | 53 | // public static final java.lang.String EXTRA_DEVICE = "android.bluetooth.device.extra.DEVICE"; 54 | // public static final java.lang.String EXTRA_NAME = "android.bluetooth.device.extra.NAME"; 55 | // public static final java.lang.String EXTRA_RSSI = "android.bluetooth.device.extra.RSSI"; 56 | // public static final java.lang.String EXTRA_CLASS = "android.bluetooth.device.extra.CLASS"; 57 | // public static final java.lang.String EXTRA_BOND_STATE = "android.bluetooth.device.extra.BOND_STATE"; 58 | // public static final java.lang.String EXTRA_PREVIOUS_BOND_STATE = "android.bluetooth.device.extra.PREVIOUS_BOND_STATE"; 59 | 60 | } 61 | 62 | public void registerReceiver(final Context context) { 63 | final IntentFilter filter = new IntentFilter(BluetoothDevice.ACTION_FOUND); 64 | context.registerReceiver(this, filter); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ### Android template 2 | # Built application files 3 | *.apk 4 | *.ap_ 5 | 6 | # Files for the Dalvik VM 7 | *.dex 8 | 9 | # Java class files 10 | *.class 11 | 12 | # Generated files 13 | bin/ 14 | gen/ 15 | 16 | # Gradle files 17 | .gradle/ 18 | build/ 19 | 20 | # Local configuration file (sdk path, etc) 21 | local.properties 22 | 23 | # Proguard folder generated by Eclipse 24 | proguard/ 25 | 26 | # Log Files 27 | *.log 28 | 29 | # Android Studio Navigation editor temp files 30 | .navigation/ 31 | ### JetBrains template 32 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio 33 | 34 | *.iml 35 | 36 | ## Directory-based project format: 37 | .idea/ 38 | # if you remove the above rule, at least ignore the following: 39 | 40 | # User-specific stuff: 41 | # .idea/workspace.xml 42 | # .idea/tasks.xml 43 | # .idea/dictionaries 44 | 45 | # Sensitive or high-churn files: 46 | # .idea/dataSources.ids 47 | # .idea/dataSources.xml 48 | # .idea/sqlDataSources.xml 49 | # .idea/dynamic.xml 50 | # .idea/uiDesigner.xml 51 | 52 | # Gradle: 53 | # .idea/gradle.xml 54 | # .idea/libraries 55 | 56 | # Mongo Explorer plugin: 57 | # .idea/mongoSettings.xml 58 | 59 | ## File-based project format: 60 | *.ipr 61 | *.iws 62 | 63 | ## Plugin-specific files: 64 | 65 | # IntelliJ 66 | /out/ 67 | 68 | # mpeltonen/sbt-idea plugin 69 | .idea_modules/ 70 | 71 | # JIRA plugin 72 | atlassian-ide-plugin.xml 73 | 74 | # Crashlytics plugin (for Android Studio and IntelliJ) 75 | com_crashlytics_export_strings.xml 76 | crashlytics.properties 77 | crashlytics-build.properties 78 | ### Windows template 79 | # Windows image file caches 80 | Thumbs.db 81 | ehthumbs.db 82 | 83 | # Folder config file 84 | Desktop.ini 85 | 86 | # Recycle Bin used on file shares 87 | $RECYCLE.BIN/ 88 | 89 | # Windows Installer files 90 | *.cab 91 | *.msi 92 | *.msm 93 | *.msp 94 | 95 | # Windows shortcuts 96 | *.lnk 97 | ### Java template 98 | *.class 99 | 100 | # Mobile Tools for Java (J2ME) 101 | .mtj.tmp/ 102 | 103 | # Package Files # 104 | *.jar 105 | *.war 106 | *.ear 107 | 108 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 109 | hs_err_pid* 110 | ### Gradle template 111 | .gradle 112 | build/ 113 | 114 | # Ignore Gradle GUI config 115 | gradle-app.setting 116 | 117 | # Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) 118 | !gradle-wrapper.jar 119 | ### OSX template 120 | .DS_Store 121 | .AppleDouble 122 | .LSOverride 123 | 124 | # Icon must end with two \r 125 | Icon 126 | 127 | # Thumbnails 128 | ._* 129 | 130 | # Files that might appear in the root of a volume 131 | .DocumentRevisions-V100 132 | .fseventsd 133 | .Spotlight-V100 134 | .TemporaryItems 135 | .Trashes 136 | .VolumeIcon.icns 137 | 138 | # Directories potentially created on remote AFP share 139 | .AppleDB 140 | .AppleDesktop 141 | Network Trash Folder 142 | Temporary Items 143 | .apdisk 144 | 145 | # Created by .ignore support plugin (hsz.mobi) 146 | -------------------------------------------------------------------------------- /app/src/main/res/layout/cardview_list_item_with_title.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 21 | 22 | 32 | 33 | 37 | 38 | 53 | 54 | 69 | 70 | 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /lib/src/main/java/net/kibotu/android/deviceinfo/library/cpu/CpuUsage.java: -------------------------------------------------------------------------------- 1 | package net.kibotu.android.deviceinfo.library.cpu; 2 | 3 | import net.kibotu.android.deviceinfo.library.misc.Proc; 4 | import net.kibotu.android.deviceinfo.library.misc.UpdateTimer; 5 | 6 | import java.util.HashMap; 7 | import java.util.Map; 8 | import java.util.Scanner; 9 | 10 | import static java.lang.Integer.parseInt; 11 | import static net.kibotu.android.deviceinfo.library.misc.ShellExtensions.readLineFrom; 12 | import static net.kibotu.android.deviceinfo.library.misc.ShellExtensions.readRandomAcccessFileFrom; 13 | 14 | public class CpuUsage extends UpdateTimer { 15 | 16 | private Cpu previousCpu; 17 | 18 | @Override 19 | protected Cpu getData() { 20 | return getCpuUsage(); 21 | } 22 | 23 | /** 24 | * @see cpustats 25 | */ 26 | public Cpu getCpuUsage() { 27 | if (previousCpu == null) { 28 | previousCpu = Proc.getCpu(); 29 | return previousCpu; 30 | } 31 | 32 | final Cpu cpu = Proc.getCpu(); 33 | 34 | // the amount of cores can be different since don't receive infos about idling cores 35 | final int usedCores = Math.min(cpu.cores.size(), previousCpu.cores.size()); 36 | 37 | computeCoreUsage(cpu.allCores, previousCpu.allCores); 38 | 39 | for (int i = 0; i < usedCores; ++i) { 40 | final Core core = cpu.cores.get(i); 41 | final Core previousCore = previousCpu.cores.get(i); 42 | computeCoreUsage(core, previousCore); 43 | } 44 | 45 | return cpu; 46 | } 47 | 48 | private static void computeCoreUsage(Core core, Core previousCore) { 49 | // usuage can only be determined by the difference between previous and current total usage 50 | int total = core.total(); 51 | int previousTotal = previousCore.total(); 52 | 53 | final int totalDiff = total - previousTotal; 54 | if (totalDiff > 0) { 55 | final int idleDiff = core.idle - previousCore.idle; 56 | 57 | core.usage = 100 - idleDiff * 100 / (float) totalDiff; 58 | } 59 | } 60 | 61 | // endregion 62 | 63 | // region frequency 64 | 65 | public static int getCurrentCpuFreq() { 66 | return parseInt(readLineFrom("/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq")); 67 | } 68 | 69 | public static int getMinCpuFreq() { 70 | return parseInt(readLineFrom("/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq")); 71 | } 72 | 73 | public static int getMaxCpuFreq() { 74 | return parseInt(readLineFrom("/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq")); 75 | } 76 | 77 | // endregion 78 | 79 | public static Map getCpuInfo() { 80 | HashMap map = new HashMap<>(); 81 | 82 | String s = readRandomAcccessFileFrom("/proc/cpuinfo"); 83 | 84 | Scanner scanner = new Scanner(s); 85 | 86 | while (scanner.hasNextLine()) { 87 | String line = scanner.nextLine(); 88 | String[] split = line.split(":"); 89 | if (split.length > 1) 90 | map.put(split[0].trim(), split[1].trim()); 91 | else 92 | map.put(line, ""); 93 | } 94 | 95 | return map; 96 | } 97 | } -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem http://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 33 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 34 | 35 | @rem Find java.exe 36 | if defined JAVA_HOME goto findJavaFromJavaHome 37 | 38 | set JAVA_EXE=java.exe 39 | %JAVA_EXE% -version >NUL 2>&1 40 | if "%ERRORLEVEL%" == "0" goto init 41 | 42 | echo. 43 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 44 | echo. 45 | echo Please set the JAVA_HOME variable in your environment to match the 46 | echo location of your Java installation. 47 | 48 | goto fail 49 | 50 | :findJavaFromJavaHome 51 | set JAVA_HOME=%JAVA_HOME:"=% 52 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 53 | 54 | if exist "%JAVA_EXE%" goto init 55 | 56 | echo. 57 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 58 | echo. 59 | echo Please set the JAVA_HOME variable in your environment to match the 60 | echo location of your Java installation. 61 | 62 | goto fail 63 | 64 | :init 65 | @rem Get command-line arguments, handling Windows variants 66 | 67 | if not "%OS%" == "Windows_NT" goto win9xME_args 68 | 69 | :win9xME_args 70 | @rem Slurp the command line arguments. 71 | set CMD_LINE_ARGS= 72 | set _SKIP=2 73 | 74 | :win9xME_args_slurp 75 | if "x%~1" == "x" goto execute 76 | 77 | set CMD_LINE_ARGS=%* 78 | 79 | :execute 80 | @rem Setup the command line 81 | 82 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 83 | 84 | @rem Execute Gradle 85 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 86 | 87 | :end 88 | @rem End local scope for the variables with windows NT shell 89 | if "%ERRORLEVEL%"=="0" goto mainEnd 90 | 91 | :fail 92 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 93 | rem the _cmd.exe /c_ return code! 94 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 95 | exit /b 1 96 | 97 | :mainEnd 98 | if "%OS%"=="Windows_NT" endlocal 99 | 100 | :omega 101 | -------------------------------------------------------------------------------- /app/src/main/java/net/kibotu/android/deviceinfo/model/ListItem.java: -------------------------------------------------------------------------------- 1 | package net.kibotu.android.deviceinfo.model; 2 | 3 | import androidx.annotation.Nullable; 4 | import net.kibotu.android.recyclerviewpresenter.RecyclerViewModel; 5 | 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | 9 | /** 10 | * Created by Nyaruhodo on 21.02.2016. 11 | */ 12 | public class ListItem extends RecyclerViewModel { 13 | 14 | public ListItem clear() { 15 | if (hasChildren()) { 16 | children.clear(); 17 | } 18 | return this; 19 | } 20 | 21 | public boolean hasChildren() { 22 | return children != null && !children.isEmpty(); 23 | } 24 | 25 | private String label; 26 | private String value; 27 | private String description; 28 | private List children; 29 | 30 | public ListItem setLabel(String label) { 31 | this.label = label; 32 | return this; 33 | } 34 | 35 | public List getChildren() { 36 | return children; 37 | } 38 | 39 | public ListItem setChildren(List children) { 40 | this.children = children; 41 | return this; 42 | } 43 | 44 | public ListItem addChild(ListItem child) { 45 | if (children == null) 46 | children = new ArrayList<>(); 47 | 48 | this.children.add(child); 49 | return this; 50 | } 51 | 52 | public String getLabel() { 53 | return label; 54 | } 55 | 56 | 57 | public ListItem setValue(@Nullable Object value) { 58 | if (value != null) 59 | this.value = value.toString(); 60 | return this; 61 | } 62 | 63 | public String getValue() { 64 | return value; 65 | } 66 | 67 | public ListItem setDescription(String description) { 68 | this.description = description; 69 | return this; 70 | } 71 | 72 | public String getDescription() { 73 | return description; 74 | } 75 | 76 | @Override 77 | public boolean equals(Object o) { 78 | if (this == o) return true; 79 | if (o == null || getClass() != o.getClass()) return false; 80 | 81 | ListItem listItem = (ListItem) o; 82 | 83 | if (label != null ? !label.equals(listItem.label) : listItem.label != null) return false; 84 | if (value != null ? !value.equals(listItem.value) : listItem.value != null) return false; 85 | if (description != null ? !description.equals(listItem.description) : listItem.description != null) 86 | return false; 87 | return children != null ? children.equals(listItem.children) : listItem.children == null; 88 | 89 | } 90 | 91 | @Override 92 | public int hashCode() { 93 | int result = label != null ? label.hashCode() : 0; 94 | result = 31 * result + (value != null ? value.hashCode() : 0); 95 | result = 31 * result + (description != null ? description.hashCode() : 0); 96 | result = 31 * result + (children != null ? children.hashCode() : 0); 97 | return result; 98 | } 99 | 100 | @Override 101 | public String toString() { 102 | return "ListItem{" + 103 | "label='" + label + '\'' + 104 | ", value='" + value + '\'' + 105 | ", description='" + description + '\'' + 106 | ", children=" + children + 107 | '}'; 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /app/src/main/java/net/kibotu/android/deviceinfo/ui/battery/BatteryFragment.java: -------------------------------------------------------------------------------- 1 | package net.kibotu.android.deviceinfo.ui.battery; 2 | 3 | import android.os.BatteryManager; 4 | import android.os.Bundle; 5 | import androidx.annotation.Nullable; 6 | import android.view.View; 7 | 8 | import com.orhanobut.hawk.Hawk; 9 | 10 | import net.kibotu.android.deviceinfo.R; 11 | import net.kibotu.android.deviceinfo.library.battery.Battery; 12 | import net.kibotu.android.deviceinfo.library.battery.BatteryReceiver; 13 | import net.kibotu.android.deviceinfo.library.battery.BatteryUpdateListener; 14 | import net.kibotu.android.deviceinfo.ui.list.ListFragment; 15 | 16 | import static net.kibotu.android.deviceinfo.library.Device.getBatteryReceiver; 17 | import static net.kibotu.android.deviceinfo.library.ViewHelper.formatBool; 18 | 19 | /** 20 | * Created by Nyaruhodo on 21.02.2016. 21 | */ 22 | public class BatteryFragment extends ListFragment { 23 | 24 | private BatteryReceiver batteryReceiver; 25 | 26 | @Override 27 | public String getTitle() { 28 | return getString(R.string.menu_item_battery); 29 | } 30 | 31 | @Override 32 | protected int getHomeIcon() { 33 | return R.drawable.battery; 34 | } 35 | 36 | @Override 37 | public void onDestroyView() { 38 | batteryReceiver.unregisterReceiver(); 39 | super.onDestroyView(); 40 | } 41 | 42 | @Override 43 | public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { 44 | super.onViewCreated(view, savedInstanceState); 45 | 46 | batteryReceiver = getBatteryReceiver().addObserver(new BatteryUpdateListener() { 47 | 48 | @Override 49 | protected void update(Battery battery) { 50 | updateWithBattery(battery); 51 | } 52 | }).registerReceiver(); 53 | } 54 | 55 | private void updateWithBattery(Battery battery) { 56 | clear(); 57 | 58 | addHorizontallyCard("Technology", battery.getTechnology(), "Technology of the current batteryReceiver."); 59 | addHorizontallyCard("Status", battery.getStatusAsString(), "Current status constant."); 60 | addHorizontallyCard("Charging Level", battery.getChargingLevelAsString(), "Current batteryReceiver level, from 0 to the maximum batteryReceiver level."); 61 | addHorizontallyCard("Voltage", battery.getVoltage() + " mV", "Current batteryReceiver voltage level."); 62 | addHorizontallyCard("Temperature", battery.getTemperatureCelcius() + " [" + battery.getTemperatureFarenheit() + "]", "Current batteryReceiver temperature."); 63 | addHorizontallyCard("Battery Present", formatBool(battery.isPresent()), "Indicating whether a batteryReceiver is present or not."); 64 | addHorizontallyCard("Health", battery.getHealthAsString(), "Current health constant."); 65 | addHorizontallyCard("Power Source", battery.getPluggedAsString(), "Indicating whether the device is plugged in to a power source; 0 means it is on batteryReceiver, other constants are different types of power sources."); 66 | addHorizontallyCard("Last Charging Source", getLastChargingSource(battery), "Last recorded charging power source."); 67 | 68 | notifyDataSetChanged(); 69 | } 70 | 71 | public String getLastChargingSource(Battery battery) { 72 | final String value = Hawk.get(BatteryManager.EXTRA_PLUGGED, "Unknown"); 73 | Hawk.put(BatteryManager.EXTRA_PLUGGED, battery.getPluggedAsString()); 74 | return value; 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /app/src/main/java/net/kibotu/android/deviceinfo/ui/app/AppFragment.java: -------------------------------------------------------------------------------- 1 | package net.kibotu.android.deviceinfo.ui.app; 2 | 3 | import android.content.pm.FeatureInfo; 4 | import android.os.Bundle; 5 | import androidx.annotation.Nullable; 6 | import android.view.View; 7 | 8 | import net.kibotu.android.deviceinfo.R; 9 | import net.kibotu.android.deviceinfo.library.buildinfo.BuildInfo; 10 | import net.kibotu.android.deviceinfo.model.ListItem; 11 | import net.kibotu.android.deviceinfo.ui.list.ListFragment; 12 | 13 | import java.util.Map; 14 | 15 | import static net.kibotu.android.deviceinfo.library.Device.getFileSize; 16 | import static net.kibotu.android.deviceinfo.library.Device.getRuntimeFreeMemory; 17 | import static net.kibotu.android.deviceinfo.library.Device.getRuntimeMaxMemory; 18 | import static net.kibotu.android.deviceinfo.library.Device.getRuntimeTotalMemory; 19 | import static net.kibotu.android.deviceinfo.library.Device.getUsedMemorySize; 20 | import static net.kibotu.android.deviceinfo.library.ViewHelper.formatBytes; 21 | 22 | /** 23 | * Created by Nyaruhodo on 21.02.2016. 24 | */ 25 | public class AppFragment extends ListFragment { 26 | 27 | @Override 28 | public String getTitle() { 29 | return getString(R.string.menu_item_app); 30 | } 31 | 32 | @Override 33 | protected int getHomeIcon() { 34 | return R.drawable.info; 35 | } 36 | 37 | @Override 38 | public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { 39 | super.onViewCreated(view, savedInstanceState); 40 | 41 | addHorizontallyCard("App Version", BuildInfo.getVersionFromPackageManager(), ""); 42 | addHorizontallyCard("Threads Count", Thread.getAllStackTraces().keySet().size(), ""); 43 | addAppRuntimeMemory(); 44 | addVerticallyCard("APK Storage Path", getFileSize(getContext().getPackageCodePath()), ""); 45 | addVerticallyCard("Internal Storage Path", getFileSize(getContext().getFilesDir().getParent()), ""); 46 | addPermissions(); 47 | addSharedLibraries(); 48 | } 49 | 50 | private void addAppRuntimeMemory() { 51 | addSubListItem(new ListItem().setLabel("Runtime Memory App") 52 | .addChild(new ListItem().setLabel("Max").setValue(formatBytes(getRuntimeMaxMemory()))) 53 | .addChild(new ListItem().setLabel("Total").setValue(formatBytes(getRuntimeTotalMemory()))) 54 | .addChild(new ListItem().setLabel("Free").setValue(formatBytes(getRuntimeFreeMemory()))) 55 | .addChild(new ListItem().setLabel("Used").setValue(formatBytes(getUsedMemorySize()))) 56 | .addChild(new ListItem().setLabel("Max").setValue(formatBytes(getRuntimeMaxMemory())))); 57 | } 58 | 59 | private void addPermissions() { 60 | final Map systemAvailableFeatures = BuildInfo.getSystemAvailableFeatures(); 61 | final ListItem item = new ListItem().setLabel("Permissions").setDescription("All enabled permissions for this app."); 62 | for (String permission : BuildInfo.getPermissions()) 63 | item.addChild(new ListItem().setLabel(permission)); 64 | 65 | addSubListItem(item); 66 | } 67 | 68 | private void addSharedLibraries() { 69 | final Map systemAvailableFeatures = BuildInfo.getSystemAvailableFeatures(); 70 | final ListItem item = new ListItem().setLabel("Shared Libraries").setDescription("List of shared libraries that are available on the system."); 71 | for (String lib : BuildInfo.getSharedLibraries()) 72 | item.addChild(new ListItem().setLabel(lib)); 73 | 74 | addSubListItem(item); 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /lib/src/main/java/net/kibotu/android/deviceinfo/library/gpu/Egl.java: -------------------------------------------------------------------------------- 1 | package net.kibotu.android.deviceinfo.library.gpu; 2 | 3 | import javax.microedition.khronos.egl.EGL10; 4 | import javax.microedition.khronos.egl.EGLConfig; 5 | import javax.microedition.khronos.egl.EGLDisplay; 6 | 7 | import static net.kibotu.android.deviceinfo.library.gpu.OpenGLExtensions.eglGetConfigAttrib; 8 | 9 | public final class Egl { 10 | 11 | public final int EGL_NON_CONFORMANT_CONFIG; 12 | public final int EGL_SAMPLES; 13 | public final int EGL_STENCIL_SIZE; 14 | public final int EGL_DEPTH_SIZE; 15 | public final int EGL_ALPHA_SIZE; 16 | public final int EGL_BLUE_SIZE; 17 | public final int EGL_GREEN_SIZE; 18 | public final int EGL_RED_SIZE; 19 | 20 | public Egl(final EGL10 egl, final EGLDisplay display, final EGLConfig eglConfig) { 21 | EGL_RED_SIZE = eglGetConfigAttrib(EGL10.EGL_RED_SIZE, egl, display, eglConfig); 22 | EGL_BLUE_SIZE = eglGetConfigAttrib(EGL10.EGL_BLUE_SIZE, egl, display, eglConfig); 23 | EGL_GREEN_SIZE = eglGetConfigAttrib(EGL10.EGL_GREEN_SIZE, egl, display, eglConfig); 24 | EGL_ALPHA_SIZE = eglGetConfigAttrib(EGL10.EGL_ALPHA_SIZE, egl, display, eglConfig); 25 | EGL_DEPTH_SIZE = eglGetConfigAttrib(EGL10.EGL_DEPTH_SIZE, egl, display, eglConfig); 26 | EGL_STENCIL_SIZE = eglGetConfigAttrib(EGL10.EGL_STENCIL_SIZE, egl, display, eglConfig); 27 | EGL_SAMPLES = eglGetConfigAttrib(EGL10.EGL_SAMPLES, egl, display, eglConfig); 28 | EGL_NON_CONFORMANT_CONFIG = eglGetConfigAttrib(EGL10.EGL_NON_CONFORMANT_CONFIG, egl, display, eglConfig); 29 | } 30 | 31 | @Override 32 | public boolean equals(Object o) { 33 | if (this == o) return true; 34 | if (o == null || getClass() != o.getClass()) return false; 35 | 36 | Egl egl = (Egl) o; 37 | 38 | if (EGL_ALPHA_SIZE != egl.EGL_ALPHA_SIZE) return false; 39 | if (EGL_BLUE_SIZE != egl.EGL_BLUE_SIZE) return false; 40 | if (EGL_DEPTH_SIZE != egl.EGL_DEPTH_SIZE) return false; 41 | if (EGL_GREEN_SIZE != egl.EGL_GREEN_SIZE) return false; 42 | if (EGL_NON_CONFORMANT_CONFIG != egl.EGL_NON_CONFORMANT_CONFIG) return false; 43 | if (EGL_RED_SIZE != egl.EGL_RED_SIZE) return false; 44 | if (EGL_SAMPLES != egl.EGL_SAMPLES) return false; 45 | if (EGL_STENCIL_SIZE != egl.EGL_STENCIL_SIZE) return false; 46 | 47 | return true; 48 | } 49 | 50 | @Override 51 | public int hashCode() { 52 | int result = EGL_NON_CONFORMANT_CONFIG; 53 | result = 31 * result + EGL_SAMPLES; 54 | result = 31 * result + EGL_STENCIL_SIZE; 55 | result = 31 * result + EGL_DEPTH_SIZE; 56 | result = 31 * result + EGL_ALPHA_SIZE; 57 | result = 31 * result + EGL_BLUE_SIZE; 58 | result = 31 * result + EGL_GREEN_SIZE; 59 | result = 31 * result + EGL_RED_SIZE; 60 | return result; 61 | } 62 | 63 | @Override 64 | public String toString() { 65 | 66 | // rgba (rgba) depth stencil samples non comfort 67 | return "RGB" + (EGL_ALPHA_SIZE > 0 ? "A" : "") + 68 | " " + (EGL_RED_SIZE + EGL_GREEN_SIZE + EGL_BLUE_SIZE + EGL_ALPHA_SIZE) + " bit" + 69 | " (" + EGL_RED_SIZE + "" + EGL_GREEN_SIZE + EGL_BLUE_SIZE + "" + (EGL_ALPHA_SIZE > 0 ? EGL_ALPHA_SIZE : "") + ")" + 70 | (EGL_DEPTH_SIZE > 0 ? " Depth " + EGL_DEPTH_SIZE + "bit" : "") + 71 | (EGL_STENCIL_SIZE > 0 ? " Stencil " + EGL_STENCIL_SIZE : "") + 72 | (EGL_SAMPLES > 0 ? " Samples x" + EGL_SAMPLES : "") + 73 | (EGL_NON_CONFORMANT_CONFIG > 0 ? " Non-Conformant" : ""); 74 | } 75 | } -------------------------------------------------------------------------------- /lib/src/main/java/net/kibotu/android/deviceinfo/library/gpu/OpenGLGles10Info.java: -------------------------------------------------------------------------------- 1 | package net.kibotu.android.deviceinfo.library.gpu; 2 | 3 | import android.opengl.GLES10; 4 | 5 | import java.util.Arrays; 6 | 7 | import static net.kibotu.android.deviceinfo.library.gpu.OpenGLExtensions.glGetIntegerv; 8 | import static net.kibotu.android.deviceinfo.library.gpu.OpenGLExtensions.glGetString; 9 | 10 | public class OpenGLGles10Info extends OpenGLInfo { 11 | 12 | // general 13 | public String GL_RENDERER; 14 | public String GL_VERSION; 15 | public String GL_VENDOR; 16 | 17 | // texture related 18 | public int GL_MAX_TEXTURE_SIZE; 19 | public int GL_MAX_TEXTURE_UNITS; 20 | public int[] GL_MAX_VIEWPORT_DIMS; 21 | 22 | // fixed function pipeline constrains 23 | public int GL_MAX_MODELVIEW_STACK_DEPTH; 24 | public int GL_MAX_PROJECTION_STACK_DEPTH; 25 | public int GL_MAX_TEXTURE_STACK_DEPTH; 26 | public int GL_MAX_LIGHTS; 27 | public int GL_SUBPIXEL_BITS; 28 | public int GL_DEPTH_BITS; 29 | public int GL_STENCIL_BITS; 30 | public int GL_MAX_ELEMENTS_INDICES; 31 | public int GL_MAX_ELEMENTS_VERTICES; 32 | 33 | // extensions 34 | public String GL_EXTENSIONS; 35 | 36 | public OpenGLGles10Info() { 37 | super(1); 38 | } 39 | 40 | @Override 41 | protected void loadOnCreate() { 42 | GL_RENDERER = glGetString(GLES10.GL_RENDERER); 43 | GL_VERSION = glGetString(GLES10.GL_VERSION); 44 | GL_VENDOR = glGetString(GLES10.GL_VENDOR); 45 | GL_MAX_TEXTURE_SIZE = OpenGLExtensions.glGetIntegerv(GLES10.GL_MAX_TEXTURE_SIZE); 46 | GL_MAX_TEXTURE_UNITS = OpenGLExtensions.glGetIntegerv(GLES10.GL_MAX_TEXTURE_UNITS); 47 | GL_MAX_LIGHTS = OpenGLExtensions.glGetIntegerv(GLES10.GL_MAX_LIGHTS); 48 | GL_SUBPIXEL_BITS = OpenGLExtensions.glGetIntegerv(GLES10.GL_SUBPIXEL_BITS); 49 | GL_MAX_ELEMENTS_VERTICES = OpenGLExtensions.glGetIntegerv(GLES10.GL_MAX_ELEMENTS_VERTICES); 50 | GL_MAX_ELEMENTS_INDICES = OpenGLExtensions.glGetIntegerv(GLES10.GL_MAX_ELEMENTS_INDICES); 51 | GL_MAX_MODELVIEW_STACK_DEPTH = OpenGLExtensions.glGetIntegerv(GLES10.GL_MAX_MODELVIEW_STACK_DEPTH); 52 | GL_MAX_PROJECTION_STACK_DEPTH = OpenGLExtensions.glGetIntegerv(GLES10.GL_MAX_PROJECTION_STACK_DEPTH); 53 | GL_MAX_TEXTURE_STACK_DEPTH = OpenGLExtensions.glGetIntegerv(GLES10.GL_MAX_TEXTURE_STACK_DEPTH); 54 | GL_DEPTH_BITS = OpenGLExtensions.glGetIntegerv(GLES10.GL_DEPTH_BITS); 55 | GL_STENCIL_BITS = OpenGLExtensions.glGetIntegerv(GLES10.GL_STENCIL_BITS); 56 | GL_EXTENSIONS = glGetString(GLES10.GL_EXTENSIONS); 57 | GL_MAX_VIEWPORT_DIMS = glGetIntegerv(GLES10.GL_MAX_VIEWPORT_DIMS, 2); 58 | } 59 | 60 | @Override 61 | public String toString() { 62 | return "OpenGLGles10Info{" + '\n' + 63 | "GL_RENDERER='" + GL_RENDERER + '\'' + '\n' + 64 | ", GL_VERSION='" + GL_VERSION + '\'' + '\n' + 65 | ", GL_VENDOR='" + GL_VENDOR + '\'' + '\n' + 66 | ", GL_MAX_TEXTURE_SIZE=" + GL_MAX_TEXTURE_SIZE + '\n' + 67 | ", GL_MAX_TEXTURE_UNITS=" + GL_MAX_TEXTURE_UNITS + '\n' + 68 | ", GL_MAX_VIEWPORT_DIMS=" + Arrays.toString(GL_MAX_VIEWPORT_DIMS) + '\n' + 69 | ", GL_MAX_MODELVIEW_STACK_DEPTH=" + GL_MAX_MODELVIEW_STACK_DEPTH + '\n' + 70 | ", GL_MAX_PROJECTION_STACK_DEPTH=" + GL_MAX_PROJECTION_STACK_DEPTH + '\n' + 71 | ", GL_MAX_TEXTURE_STACK_DEPTH=" + GL_MAX_TEXTURE_STACK_DEPTH + 72 | ", GL_MAX_LIGHTS=" + GL_MAX_LIGHTS + '\n' + 73 | ", GL_SUBPIXEL_BITS=" + GL_SUBPIXEL_BITS + '\n' + 74 | ", GL_DEPTH_BITS=" + GL_DEPTH_BITS + '\n' + 75 | ", GL_STENCIL_BITS=" + GL_STENCIL_BITS + '\n' + 76 | ", GL_MAX_ELEMENTS_INDICES=" + GL_MAX_ELEMENTS_INDICES + '\n' + 77 | ", GL_MAX_ELEMENTS_VERTICES=" + GL_MAX_ELEMENTS_VERTICES + '\n' + 78 | ", GL_EXTENSIONS='" + GL_EXTENSIONS + '\'' + '\n' + 79 | '}'; 80 | } 81 | } -------------------------------------------------------------------------------- /lib/src/main/java/net/kibotu/android/deviceinfo/library/network/Network.java: -------------------------------------------------------------------------------- 1 | package net.kibotu.android.deviceinfo.library.network; 2 | 3 | import android.webkit.WebView; 4 | 5 | import net.kibotu.android.deviceinfo.library.Device; 6 | 7 | import java.net.InetAddress; 8 | import java.net.NetworkInterface; 9 | import java.util.Collections; 10 | import java.util.List; 11 | 12 | import static net.kibotu.android.deviceinfo.library.services.SystemService.getWifiManager; 13 | 14 | /** 15 | * Created by Nyaruhodo on 06.03.2016. 16 | */ 17 | public class Network { 18 | /** 19 | * Returns MAC address of the given interface name. 20 | * 21 | * @param interfaceName eth0, wlan0 or NULL=use first interface 22 | * @return mac address or empty string 23 | */ 24 | public static String getMACAddress(String interfaceName) { 25 | try { 26 | List interfaces = Collections.list(NetworkInterface.getNetworkInterfaces()); 27 | for (NetworkInterface intf : interfaces) { 28 | if (interfaceName != null) { 29 | if (!intf.getName().equalsIgnoreCase(interfaceName)) continue; 30 | } 31 | byte[] mac = intf.getHardwareAddress(); 32 | if (mac == null) return ""; 33 | StringBuilder buf = new StringBuilder(); 34 | for (final byte aMac : mac) buf.append(String.format("%02X:", aMac)); 35 | if (buf.length() > 0) buf.deleteCharAt(buf.length() - 1); 36 | return buf.toString(); 37 | } 38 | } catch (final Exception ignored) { 39 | } // for now eat exceptions 40 | return ""; 41 | /*try { 42 | // this is so Linux hack 43 | return loadFileAsString("/sys/class/net/" +interfaceName + "/address").toUpperCase().trim(); 44 | } catch (IOException ex) { 45 | return null; 46 | }*/ 47 | } 48 | 49 | /** 50 | * Get IP address from first non-localhost interface 51 | * 52 | * @param useIPv4 true=return ipv4, false=return ipv6 53 | * @return address or empty string 54 | */ 55 | public static String getIPAddress(boolean useIPv4) { 56 | try { 57 | List interfaces = Collections.list(NetworkInterface.getNetworkInterfaces()); 58 | for (NetworkInterface intf : interfaces) { 59 | List addrs = Collections.list(intf.getInetAddresses()); 60 | for (InetAddress addr : addrs) { 61 | if (!addr.isLoopbackAddress()) { 62 | String sAddr = addr.getHostAddress().toUpperCase(); 63 | boolean isIPv4 = InetAddressUtils.isIPv4Address(sAddr); 64 | if (useIPv4) { 65 | if (isIPv4) 66 | return sAddr; 67 | } else { 68 | if (!isIPv4) { 69 | int delim = sAddr.indexOf('%'); // drop ip6 port suffix 70 | return delim < 0 ? sAddr : sAddr.substring(0, delim); 71 | } 72 | } 73 | } 74 | } 75 | } 76 | } catch (final Exception ignored) { 77 | // for now eat exceptions 78 | } 79 | return ""; 80 | } 81 | 82 | public static String getUserAgent() { 83 | return new WebView(Device.getContext()).getSettings().getUserAgentString(); 84 | } 85 | 86 | public static ProxySettings getProxySettings() { 87 | return new ProxySettings(Device.getContext()); 88 | } 89 | 90 | /** 91 | * Returns MAC Address. 92 | *

93 | * IMPORTANT! requires {@link android.Manifest.permission#ACCESS_WIFI_STATE} 94 | *

95 | * Disadvantages: 96 | * - Device should have Wi-Fi (where not all devices have Wi-Fi) 97 | * - If Wi-Fi present in Device should be turned on otherwise does not report the MAC address 98 | */ 99 | public static String getMacAdress() { 100 | return getWifiManager().getConnectionInfo().getMacAddress(); 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /app/src/main/java/net/kibotu/android/deviceinfo/MainActivity.java: -------------------------------------------------------------------------------- 1 | package net.kibotu.android.deviceinfo; 2 | 3 | import android.content.Context; 4 | import android.content.Intent; 5 | import android.content.res.Configuration; 6 | import android.os.Bundle; 7 | import android.view.WindowManager; 8 | import android.widget.TextView; 9 | import androidx.annotation.CallSuper; 10 | import androidx.annotation.NonNull; 11 | import androidx.appcompat.app.AppCompatActivity; 12 | import androidx.fragment.app.Fragment; 13 | import com.exozet.android.core.utils.DeviceExtensions; 14 | import com.exozet.android.core.utils.FragmentExtensions; 15 | import com.robohorse.gpversionchecker.GPVersionChecker; 16 | import com.robohorse.gpversionchecker.base.CheckingStrategy; 17 | import net.kibotu.android.deviceinfo.ui.BaseFragment; 18 | import net.kibotu.android.deviceinfo.ui.buildinfo.BuildFragment; 19 | import net.kibotu.android.deviceinfo.ui.menu.Menu; 20 | import net.kibotu.logger.Logger; 21 | import uk.co.chrisjenx.calligraphy.CalligraphyContextWrapper; 22 | 23 | import static com.exozet.android.core.extensions.FragmentExtensions.currentFragment; 24 | import static com.exozet.android.core.extensions.ResourceExtensions.getResColor; 25 | import static com.exozet.android.core.utils.ViewExtensions.getContentRoot; 26 | 27 | public class MainActivity extends AppCompatActivity { 28 | 29 | private static final java.lang.String TAG = MainActivity.class.getSimpleName(); 30 | 31 | @Override 32 | protected void onCreate(Bundle savedInstanceState) { 33 | super.onCreate(savedInstanceState); 34 | setContentView(R.layout.activity_main); 35 | 36 | // Keep the screen always on 37 | if (BuildConfig.DEBUG) 38 | getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); 39 | 40 | Menu.with(this); 41 | 42 | FragmentExtensions.replace(new BuildFragment()); 43 | 44 | new GPVersionChecker.Builder(this) 45 | .setCheckingStrategy(CheckingStrategy.ALWAYS) 46 | .showDialog(true) 47 | // .forceUpdate(BuildConfig.RELEASE) 48 | // .setCustomPackageName("net.kibotu.android.deviceinfo") 49 | .setVersionInfoListener(version -> { 50 | Logger.v(TAG, "version=" + version); 51 | }) 52 | .create(); 53 | } 54 | 55 | @Override 56 | protected void onResume() { 57 | super.onResume(); 58 | final TextView title = getContentRoot().findViewById(R.id.actionbar_title); 59 | title.setTextColor(getResColor(R.color.white)); 60 | } 61 | 62 | @Override 63 | public void onConfigurationChanged(Configuration newConfig) { 64 | super.onConfigurationChanged(newConfig); 65 | Logger.v(TAG, "[onConfigurationChanged] " + newConfig); 66 | } 67 | 68 | @Override 69 | protected void attachBaseContext(Context newBase) { 70 | super.attachBaseContext(CalligraphyContextWrapper.wrap(newBase)); 71 | } 72 | 73 | @Override 74 | public void onBackPressed() { 75 | 76 | // hide keyboard 77 | DeviceExtensions.hideKeyboard(); 78 | 79 | // close menu 80 | if (Menu.isDrawerOpen()) { 81 | Menu.closeDrawer(); 82 | return; 83 | } 84 | 85 | if (BaseFragment.onBackPressed()) 86 | return; 87 | 88 | // pop back stack 89 | if (getSupportFragmentManager().getBackStackEntryCount() > 0) { 90 | getSupportFragmentManager().popBackStack(); 91 | FragmentExtensions.printBackStack(); 92 | return; 93 | } 94 | 95 | // quit app 96 | finish(); 97 | } 98 | 99 | @Override 100 | protected void onActivityResult(int requestCode, int resultCode, Intent data) { 101 | super.onActivityResult(requestCode, resultCode, data); 102 | final Fragment fragment = currentFragment(R.id.fragment_container); 103 | if (fragment != null) 104 | fragment.onActivityResult(requestCode, resultCode, data); 105 | } 106 | 107 | @CallSuper 108 | @Override 109 | public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { 110 | super.onRequestPermissionsResult(requestCode, permissions, grantResults); 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /lib/src/main/java/net/kibotu/android/deviceinfo/library/buildinfo/DeviceUuidFactory.java: -------------------------------------------------------------------------------- 1 | package net.kibotu.android.deviceinfo.library.buildinfo; 2 | 3 | import android.Manifest; 4 | import android.content.Context; 5 | import android.content.SharedPreferences; 6 | import android.provider.Settings; 7 | import androidx.annotation.NonNull; 8 | import android.telephony.TelephonyManager; 9 | 10 | import androidx.annotation.RequiresPermission; 11 | 12 | import java.io.UnsupportedEncodingException; 13 | import java.util.UUID; 14 | 15 | /** 16 | * credits go to http://stackoverflow.com/a/5626208/957370 17 | */ 18 | public class DeviceUuidFactory { 19 | 20 | protected static final String PREFS_FILE = "device_id.xml"; 21 | protected static final String PREFS_DEVICE_ID = "device_id"; 22 | protected volatile static UUID uuid; 23 | 24 | @RequiresPermission(Manifest.permission.READ_PHONE_STATE) 25 | public DeviceUuidFactory(@NonNull final Context context) { 26 | if (uuid != null) { 27 | return; 28 | } 29 | synchronized (DeviceUuidFactory.class) { 30 | if (uuid != null) { 31 | return; 32 | } 33 | final SharedPreferences prefs = context.getSharedPreferences(PREFS_FILE, 0); 34 | final String id = prefs.getString(PREFS_DEVICE_ID, null); 35 | if (id != null) { 36 | // Use the ids previously computed and stored in the 37 | // prefs file 38 | uuid = UUID.fromString(id); 39 | } else { 40 | final String androidId = Settings.Secure.getString( 41 | context.getContentResolver(), Settings.Secure.ANDROID_ID); 42 | // Use the Android ID unless it's broken, in which case 43 | // fallback on deviceId, 44 | // unless it's not available, then fallback on a random 45 | // number which we store to a prefs file 46 | try { 47 | if (!"9774d56d682e549c".equals(androidId)) { 48 | uuid = UUID.nameUUIDFromBytes(androidId 49 | .getBytes("utf8")); 50 | } else { 51 | final String deviceId = ((TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE)).getDeviceId(); 52 | uuid = deviceId != null ? UUID.nameUUIDFromBytes(deviceId.getBytes("utf8")) : UUID.randomUUID(); 53 | } 54 | } catch (@NonNull final UnsupportedEncodingException e) { 55 | throw new RuntimeException(e); 56 | } 57 | // Write the value out to the prefs file 58 | prefs.edit().putString(PREFS_DEVICE_ID, uuid.toString()).apply(); 59 | } 60 | } 61 | } 62 | 63 | /** 64 | * Returns a unique UUID for the current android device. As with all UUIDs, 65 | * this unique ID is "very highly likely" to be unique across all Android 66 | * devices. Much more so than ANDROID_ID is. 67 | *

68 | * The UUID is generated by using ANDROID_ID as the base key if appropriate, 69 | * falling back on TelephonyManager.getDeviceID() if ANDROID_ID is known to 70 | * be incorrect, and finally falling back on a random UUID that's persisted 71 | * to SharedPreferences if getDeviceID() does not return a usable value. 72 | *

73 | * In some rare circumstances, this ID may change. In particular, if the 74 | * device is factory reset a new device ID may be generated. In addition, if 75 | * a user upgrades their phone from certain buggy implementations of Android 76 | * 2.2 to a newer, non-buggy version of Android, the device ID may change. 77 | * Or, if a user uninstalls your app on a device that has neither a proper 78 | * Android ID nor a Device ID, this ID may change on reinstallation. 79 | *

80 | * Note that if the code falls back on using TelephonyManager.getDeviceId(), 81 | * the resulting ID will NOT change after a factory reset. Something to be 82 | * aware of. 83 | *

84 | * Works around a bug in Android 2.2 for many devices when using ANDROID_ID 85 | * directly. 86 | * 87 | * @return a UUID that may be used to uniquely identify your device for most 88 | * purposes. 89 | * @see http://code.google.com/p/android/issues/detail?id=10603 90 | */ 91 | public UUID getDeviceUuid() { 92 | return uuid; 93 | } 94 | } -------------------------------------------------------------------------------- /app/src/main/java/net/kibotu/android/deviceinfo/ui/list/ListFragment.java: -------------------------------------------------------------------------------- 1 | package net.kibotu.android.deviceinfo.ui.list; 2 | 3 | import android.os.Bundle; 4 | import androidx.annotation.NonNull; 5 | import androidx.annotation.Nullable; 6 | import android.support.v7.widget.LinearLayoutManager; 7 | import android.support.v7.widget.RecyclerView; 8 | import android.view.View; 9 | import android.view.animation.OvershootInterpolator; 10 | 11 | import androidx.recyclerview.widget.RecyclerView; 12 | import com.common.android.utils.interfaces.TitleProvider; 13 | 14 | import net.kibotu.android.deviceinfo.R; 15 | import net.kibotu.android.deviceinfo.model.ListItem; 16 | import net.kibotu.android.deviceinfo.ui.BaseFragment; 17 | import net.kibotu.android.deviceinfo.ui.list.binder.CardViewHorizontalListItemBinder; 18 | import net.kibotu.android.deviceinfo.ui.list.binder.CardViewSubListItemBinder; 19 | import net.kibotu.android.deviceinfo.ui.list.binder.VerticalListItemBinderCardView; 20 | import net.kibotu.android.deviceinfo.ui.menu.Menu; 21 | import net.kibotu.android.recyclerviewpresenter.PresenterAdapter; 22 | 23 | import butterknife.BindView; 24 | import jp.wasabeef.recyclerview.adapters.ScaleInAnimationAdapter; 25 | import jp.wasabeef.recyclerview.animators.LandingAnimator; 26 | import me.everything.android.ui.overscroll.OverScrollDecoratorHelper; 27 | 28 | import static android.text.TextUtils.isEmpty; 29 | 30 | /** 31 | * Created by Nyaruhodo on 20.02.2016. 32 | */ 33 | public abstract class ListFragment extends BaseFragment { 34 | 35 | @NonNull 36 | @BindView(R.id.list) 37 | RecyclerView list; 38 | protected PresenterAdapter adapter; 39 | 40 | @Override 41 | public int getLayout() { 42 | return R.layout.fragment_list; 43 | } 44 | 45 | @Override 46 | public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { 47 | super.onViewCreated(view, savedInstanceState); 48 | 49 | Menu.setActionBarIcon(getHomeIcon()); 50 | 51 | setListItemAnimator(); 52 | 53 | adapter = new PresenterAdapter<>(); 54 | list.setAdapter(injectAdapterAnimation(adapter)); 55 | } 56 | 57 | protected RecyclerView.Adapter injectAdapterAnimation(RecyclerView.Adapter adapter) { 58 | final ScaleInAnimationAdapter animationAdapter = new ScaleInAnimationAdapter(adapter, 0.90f); 59 | animationAdapter.setDuration(200); 60 | animationAdapter.setFirstOnly(false); 61 | animationAdapter.setInterpolator(new OvershootInterpolator(1f)); 62 | return animationAdapter; 63 | } 64 | 65 | private void setListItemAnimator() { 66 | OverScrollDecoratorHelper.setUpOverScroll(list, OverScrollDecoratorHelper.ORIENTATION_VERTICAL); 67 | list.setItemAnimator(new LandingAnimator(new OvershootInterpolator(1f))); 68 | list.getItemAnimator().setAddDuration(125); 69 | list.getItemAnimator().setRemoveDuration(125); 70 | list.getItemAnimator().setMoveDuration(125); 71 | list.getItemAnimator().setChangeDuration(125); 72 | } 73 | 74 | protected void notifyDataSetChanged() { 75 | adapter.notifyDataSetChanged(); 76 | } 77 | 78 | protected void clear() { 79 | adapter.clear(); 80 | } 81 | 82 | protected void addHorizontallyCard(String label, Object value, String description) { 83 | final String content = String.valueOf(value); 84 | 85 | if (isEmpty(content)) 86 | return; 87 | 88 | adapter.append(new ListItem() 89 | .setLabel(label) 90 | .setValue(content) 91 | .setDescription(description), 92 | CardViewHorizontalListItemBinder.class); 93 | } 94 | 95 | protected void addVerticallyCard(String label, Object value, String description) { 96 | final String content = String.valueOf(value); 97 | 98 | if (isEmpty(content)) 99 | return; 100 | 101 | adapter.append(new ListItem() 102 | .setLabel(label) 103 | .setValue(String.valueOf(value)) 104 | .setDescription(description), 105 | VerticalListItemBinderCardView.class); 106 | } 107 | 108 | public void addSubListItem(ListItem item) { 109 | if (item == null) 110 | return; 111 | 112 | adapter.add(item, CardViewSubListItemBinder.class); 113 | } 114 | 115 | protected abstract int getHomeIcon(); 116 | 117 | @Override 118 | protected void onActiveAfterBackStackChanged() { 119 | super.onActiveAfterBackStackChanged(); 120 | 121 | Menu.setActionBarIcon(getHomeIcon()); 122 | Menu.setActionBarTitle(getTitle()); 123 | } 124 | } 125 | -------------------------------------------------------------------------------- /lib/src/main/java/net/kibotu/android/deviceinfo/library/network/Connectivity.java: -------------------------------------------------------------------------------- 1 | package net.kibotu.android.deviceinfo.library.network; 2 | 3 | import android.net.ConnectivityManager; 4 | import android.net.NetworkInfo; 5 | import android.telephony.TelephonyManager; 6 | 7 | import static net.kibotu.android.deviceinfo.library.services.SystemService.getConnectivityManager; 8 | 9 | /** 10 | * Check device's network connectivity and speed 11 | * 12 | * @author emil http://stackoverflow.com/users/220710/emil 13 | */ 14 | public class Connectivity { 15 | 16 | /** 17 | * Get the network info 18 | * 19 | * @return NetworkInfo 20 | */ 21 | public static NetworkInfo getNetworkInfo() { 22 | return getConnectivityManager().getActiveNetworkInfo(); 23 | } 24 | 25 | /** 26 | * Check if there is any connectivity 27 | * 28 | * @return true if connected 29 | */ 30 | public static boolean isConnected() { 31 | NetworkInfo info = Connectivity.getNetworkInfo(); 32 | return (info != null && info.isConnected()); 33 | } 34 | 35 | /** 36 | * Check if there is any connectivity to a Wifi network 37 | * 38 | * @param type 39 | * @return 40 | */ 41 | public static boolean isConnectedWifi() { 42 | NetworkInfo info = Connectivity.getNetworkInfo(); 43 | return (info != null && info.isConnected() && info.getType() == ConnectivityManager.TYPE_WIFI); 44 | } 45 | 46 | /** 47 | * Check if there is any connectivity to a mobile network 48 | * 49 | * @param type 50 | * @return 51 | */ 52 | public static boolean isConnectedMobile() { 53 | NetworkInfo info = Connectivity.getNetworkInfo(); 54 | return (info != null && info.isConnected() && info.getType() == ConnectivityManager.TYPE_MOBILE); 55 | } 56 | 57 | /** 58 | * Check if there is fast connectivity 59 | * 60 | * @return 61 | */ 62 | public static boolean isConnectedFast() { 63 | NetworkInfo info = Connectivity.getNetworkInfo(); 64 | return (info != null && info.isConnected() && Connectivity.isConnectionFast(info.getType(), info.getSubtype())); 65 | } 66 | 67 | /** 68 | * Check if the connection is fast 69 | * 70 | * @param type 71 | * @param subType 72 | * @return 73 | */ 74 | public static boolean isConnectionFast(int type, int subType) { 75 | if (type == ConnectivityManager.TYPE_WIFI) { 76 | return true; 77 | } else if (type == ConnectivityManager.TYPE_MOBILE) { 78 | switch (subType) { 79 | case TelephonyManager.NETWORK_TYPE_1xRTT: 80 | return false; // ~ 50-100 kbps 81 | case TelephonyManager.NETWORK_TYPE_CDMA: 82 | return false; // ~ 14-64 kbps 83 | case TelephonyManager.NETWORK_TYPE_EDGE: 84 | return false; // ~ 50-100 kbps 85 | case TelephonyManager.NETWORK_TYPE_EVDO_0: 86 | return true; // ~ 400-1000 kbps 87 | case TelephonyManager.NETWORK_TYPE_EVDO_A: 88 | return true; // ~ 600-1400 kbps 89 | case TelephonyManager.NETWORK_TYPE_GPRS: 90 | return false; // ~ 100 kbps 91 | case TelephonyManager.NETWORK_TYPE_HSDPA: 92 | return true; // ~ 2-14 Mbps 93 | case TelephonyManager.NETWORK_TYPE_HSPA: 94 | return true; // ~ 700-1700 kbps 95 | case TelephonyManager.NETWORK_TYPE_HSUPA: 96 | return true; // ~ 1-23 Mbps 97 | case TelephonyManager.NETWORK_TYPE_UMTS: 98 | return true; // ~ 400-7000 kbps 99 | /* 100 | * Above API level 7, make sure to set android:targetSdkVersion 101 | * to appropriate level to use these 102 | */ 103 | case TelephonyManager.NETWORK_TYPE_EHRPD: // API level 11 104 | return true; // ~ 1-2 Mbps 105 | case TelephonyManager.NETWORK_TYPE_EVDO_B: // API level 9 106 | return true; // ~ 5 Mbps 107 | case TelephonyManager.NETWORK_TYPE_HSPAP: // API level 13 108 | return true; // ~ 10-20 Mbps 109 | case TelephonyManager.NETWORK_TYPE_IDEN: // API level 8 110 | return false; // ~25 kbps 111 | case TelephonyManager.NETWORK_TYPE_LTE: // API level 11 112 | return true; // ~ 10+ Mbps 113 | // Unknown 114 | case TelephonyManager.NETWORK_TYPE_UNKNOWN: 115 | default: 116 | return false; 117 | } 118 | } else { 119 | return false; 120 | } 121 | } 122 | 123 | } -------------------------------------------------------------------------------- /lib/src/main/java/net/kibotu/android/deviceinfo/library/cpu/Core.java: -------------------------------------------------------------------------------- 1 | package net.kibotu.android.deviceinfo.library.cpu; 2 | 3 | /** 4 | * Created by Nyaruhodo on 06.03.2016. 5 | */ 6 | public class Core { 7 | 8 | /** 9 | * normal processes executing in user mode 10 | */ 11 | public int user; 12 | /** 13 | * niced processes executing in user mode 14 | */ 15 | public int nice; 16 | /** 17 | * processes executing in kernel mode 18 | */ 19 | public int system; 20 | /** 21 | * twiddling thumbs 22 | */ 23 | public int idle; 24 | /** 25 | * waiting for I/O to complete 26 | */ 27 | public int iowait; 28 | /** 29 | * servicing public interrupts 30 | */ 31 | public int irq; 32 | /** 33 | * servicing softirqs 34 | */ 35 | public int softirq; 36 | /** 37 | * involuntary wait 38 | */ 39 | public int steal; 40 | /** 41 | * running a normal guest 42 | */ 43 | public int guest; 44 | /** 45 | * running a niced guest 46 | */ 47 | public int guest_nice; 48 | 49 | /** 50 | * computed difference between previous and current core usage 51 | */ 52 | public float usage; 53 | 54 | public int total() { 55 | return user + nice + system + idle + iowait + irq + softirq + steal + guest + guest_nice; 56 | } 57 | 58 | public int getUser() { 59 | return user; 60 | } 61 | 62 | public Core setUser(int user) { 63 | this.user = user; 64 | return this; 65 | } 66 | 67 | public int getNice() { 68 | return nice; 69 | } 70 | 71 | public Core setNice(int nice) { 72 | this.nice = nice; 73 | return this; 74 | } 75 | 76 | public int getSystem() { 77 | return system; 78 | } 79 | 80 | public Core setSystem(int system) { 81 | this.system = system; 82 | return this; 83 | } 84 | 85 | public int getIdle() { 86 | return idle; 87 | } 88 | 89 | public Core setIdle(int idle) { 90 | this.idle = idle; 91 | return this; 92 | } 93 | 94 | public int getIowait() { 95 | return iowait; 96 | } 97 | 98 | public Core setIowait(int iowait) { 99 | this.iowait = iowait; 100 | return this; 101 | } 102 | 103 | public int getIrq() { 104 | return irq; 105 | } 106 | 107 | public Core setIrq(int irq) { 108 | this.irq = irq; 109 | return this; 110 | } 111 | 112 | public int getSoftirq() { 113 | return softirq; 114 | } 115 | 116 | public Core setSoftirq(int softirq) { 117 | this.softirq = softirq; 118 | return this; 119 | } 120 | 121 | public int getSteal() { 122 | return steal; 123 | } 124 | 125 | public Core setSteal(int steal) { 126 | this.steal = steal; 127 | return this; 128 | } 129 | 130 | public int getGuest() { 131 | return guest; 132 | } 133 | 134 | public Core setGuest(int guest) { 135 | this.guest = guest; 136 | return this; 137 | } 138 | 139 | public int getGuest_nice() { 140 | return guest_nice; 141 | } 142 | 143 | public Core setGuest_nice(int guest_nice) { 144 | this.guest_nice = guest_nice; 145 | return this; 146 | } 147 | 148 | @Override 149 | public boolean equals(Object o) { 150 | if (this == o) return true; 151 | if (o == null || getClass() != o.getClass()) return false; 152 | 153 | Core core = (Core) o; 154 | 155 | if (user != core.user) return false; 156 | if (nice != core.nice) return false; 157 | if (system != core.system) return false; 158 | if (idle != core.idle) return false; 159 | if (iowait != core.iowait) return false; 160 | if (irq != core.irq) return false; 161 | if (softirq != core.softirq) return false; 162 | if (steal != core.steal) return false; 163 | if (guest != core.guest) return false; 164 | if (guest_nice != core.guest_nice) return false; 165 | return Float.compare(core.usage, usage) == 0; 166 | 167 | } 168 | 169 | @Override 170 | public int hashCode() { 171 | int result = user; 172 | result = 31 * result + nice; 173 | result = 31 * result + system; 174 | result = 31 * result + idle; 175 | result = 31 * result + iowait; 176 | result = 31 * result + irq; 177 | result = 31 * result + softirq; 178 | result = 31 * result + steal; 179 | result = 31 * result + guest; 180 | result = 31 * result + guest_nice; 181 | result = 31 * result + (usage != +0.0f ? Float.floatToIntBits(usage) : 0); 182 | return result; 183 | } 184 | 185 | @Override 186 | public String toString() { 187 | return "Core{" + 188 | "user=" + user + 189 | ", nice=" + nice + 190 | ", system=" + system + 191 | ", idle=" + idle + 192 | ", iowait=" + iowait + 193 | ", irq=" + irq + 194 | ", softirq=" + softirq + 195 | ", steal=" + steal + 196 | ", guest=" + guest + 197 | ", guest_nice=" + guest_nice + 198 | ", usage=" + usage + 199 | '}'; 200 | } 201 | } 202 | -------------------------------------------------------------------------------- /lib/src/main/java/net/kibotu/android/deviceinfo/library/misc/ReflectionHelper.java: -------------------------------------------------------------------------------- 1 | package net.kibotu.android.deviceinfo.library.misc; 2 | 3 | import java.lang.reflect.Field; 4 | import java.lang.reflect.InvocationTargetException; 5 | import java.lang.reflect.Method; 6 | 7 | final public class ReflectionHelper { 8 | 9 | private ReflectionHelper() throws IllegalAccessException { 10 | throw new IllegalAccessException("static class"); 11 | } 12 | 13 | public static String getSystemProperty(final String propName) { 14 | Class clsSystemProperties = tryClassForName("android.os.SystemProperties"); 15 | Method mtdGet = tryGetMethod(clsSystemProperties, "get", String.class); 16 | return tryInvoke(mtdGet, null, propName); 17 | } 18 | 19 | public static Class tryClassForName(final String className) { 20 | try { 21 | return Class.forName(className); 22 | } catch (final ClassNotFoundException e) { 23 | e.printStackTrace(); 24 | return null; 25 | } 26 | } 27 | 28 | public static Method tryGetMethod(final Class cls, final String name, final Class... parameterTypes) { 29 | try { 30 | return cls.getDeclaredMethod(name, parameterTypes); 31 | } catch (final Exception e) { 32 | e.printStackTrace(); 33 | return null; 34 | } 35 | } 36 | 37 | public static T tryInvoke(final Method m, final Object object, final Object... params) { 38 | try { 39 | return (T) m.invoke(object, params); 40 | } catch (final InvocationTargetException e) { 41 | throw new RuntimeException(e.getTargetException()); 42 | } catch (final Exception e) { 43 | e.printStackTrace(); 44 | return null; 45 | } 46 | } 47 | 48 | public static T get(final Class cls, final String method, final Object target, final Object... params) { 49 | Method m = tryGetMethod(cls, method); 50 | return tryInvoke(m, target, params); 51 | } 52 | 53 | public static T getPublicStaticField(final Class cls, final String method) { 54 | 55 | T result = null; 56 | 57 | try { 58 | final Field field = cls.getField(method); 59 | result = (T) field.get(null); 60 | } catch (final NoSuchFieldException e) { 61 | e.printStackTrace(); 62 | } catch (final IllegalAccessException e) { 63 | e.printStackTrace(); 64 | } 65 | 66 | return result; 67 | } 68 | 69 | public static T tryInvokePublicStatic(String cls, String method, final ReflectionHelperParamater params) { 70 | T t = null; 71 | try { 72 | final Method m = tryClassForName(cls).getMethod(method, params.types); 73 | t = (T) m.invoke(null, params.values); 74 | } catch (final NoSuchMethodException e) { 75 | e.printStackTrace(); 76 | } catch (InvocationTargetException e) { 77 | e.printStackTrace(); 78 | } catch (IllegalAccessException e) { 79 | e.printStackTrace(); 80 | } 81 | return t; 82 | } 83 | 84 | public static Object contruct(final String cls) { 85 | try { 86 | return ReflectionHelper.tryClassForName(cls).getConstructor(String.class).newInstance("Throwable"); 87 | } catch (final InstantiationException e) { 88 | e.printStackTrace(); 89 | } catch (final IllegalAccessException e) { 90 | e.printStackTrace(); 91 | } catch (final InvocationTargetException e) { 92 | e.printStackTrace(); 93 | } catch (final NoSuchMethodException e) { 94 | e.printStackTrace(); 95 | } 96 | return null; 97 | } 98 | 99 | public static void tryInvoke(final Class cls, final Object object, final String method, final ReflectionHelperParamater params) { 100 | Method m = ReflectionHelper.tryGetMethod(cls, method, params.types); 101 | try { 102 | m.invoke(object, params.values); 103 | } catch (final IllegalAccessException e) { 104 | e.printStackTrace(); 105 | } catch (final InvocationTargetException e) { 106 | e.printStackTrace(); 107 | } 108 | } 109 | 110 | public static Object contruct(final Class cls, final ReflectionHelperParamater params) { 111 | try { 112 | return cls.getConstructor(params.types).newInstance(params.values); 113 | } catch (final InstantiationException e) { 114 | e.printStackTrace(); 115 | } catch (final IllegalAccessException e) { 116 | e.printStackTrace(); 117 | } catch (final InvocationTargetException e) { 118 | e.printStackTrace(); 119 | } catch (final NoSuchMethodException e) { 120 | e.printStackTrace(); 121 | } 122 | return null; 123 | } 124 | 125 | public static void tryInvoke(final Class cls, final Object obj, final String method) { 126 | tryInvoke(tryGetMethod(cls, method, null), obj); 127 | } 128 | 129 | final static public class ReflectionHelperParamater { 130 | public final Class[] types; 131 | public final Object[] values; 132 | 133 | public ReflectionHelperParamater(final Class[] types, final Object[] values) { 134 | this.types = types; 135 | this.values = values; 136 | } 137 | } 138 | } -------------------------------------------------------------------------------- /lib/src/main/java/net/kibotu/android/deviceinfo/library/cpu/Cpu.java: -------------------------------------------------------------------------------- 1 | package net.kibotu.android.deviceinfo.library.cpu; 2 | 3 | import java.io.File; 4 | import java.util.ArrayList; 5 | 6 | /** 7 | * Created by Nyaruhodo on 06.03.2016. 8 | */ 9 | public class Cpu { 10 | 11 | /** 12 | * Measures the number of jiffies (1/100 of a second for x86 systems) that the system has been in user mode, 13 | * user mode with low priority (nice), system mode, idle task, I/O wait, IRQ (hardirq), and softirq respectively. 14 | * The IRQ (hardirq) is the direct response to a hardware event. The IRQ takes minimal work for queuing the "heavy" work up for the softirq to execute. 15 | * The softirq runs at a lower priority than the IRQ and therefore may be interrupted more frequently. 16 | * The total for all CPUs is given at the top, while each individual CPU is listed below with its own statistics. 17 | * The following example is a 4-way Intel Pentium Xeon configuration with multi-threading enabled, 18 | * therefore showing four physical processors and four virtual processors totaling eight processors. 19 | */ 20 | public Core allCores; 21 | 22 | private static int amountCoresCache = -1; 23 | 24 | public ArrayList cores; 25 | 26 | /** 27 | * context switches across all CPUs. 28 | */ 29 | public int ctxt; 30 | 31 | /** 32 | * time at which the system booted in epoch unix time in seconds 33 | */ 34 | public int btime; 35 | 36 | /** 37 | * number of processes and threads created 38 | */ 39 | public int processes; 40 | 41 | /** 42 | * number of processes currently running on CPUs 43 | */ 44 | public int procs_running; 45 | 46 | /** 47 | * processes currently blocked 48 | */ 49 | public int procs_blocked; 50 | 51 | public Cpu() { 52 | cores = new ArrayList<>(); 53 | } 54 | 55 | public ArrayList getCores() { 56 | return cores; 57 | } 58 | 59 | public int getCtxt() { 60 | return ctxt; 61 | } 62 | 63 | public int getBtimeAsEpoch() { 64 | return btime; 65 | } 66 | 67 | public int getProcesses() { 68 | return processes; 69 | } 70 | 71 | public int getProcs_running() { 72 | return procs_running; 73 | } 74 | 75 | public int getProcs_blocked() { 76 | return procs_blocked; 77 | } 78 | 79 | public Core getAllCores() { 80 | return allCores; 81 | } 82 | 83 | public void setAllCores(Core allCores) { 84 | this.allCores = allCores; 85 | } 86 | 87 | public void setCores(ArrayList cores) { 88 | this.cores = cores; 89 | } 90 | 91 | public void setCtxt(int ctxt) { 92 | this.ctxt = ctxt; 93 | } 94 | 95 | public void setBtime(int btime) { 96 | this.btime = btime; 97 | } 98 | 99 | public void setProcesses(int processes) { 100 | this.processes = processes; 101 | } 102 | 103 | public void setProcs_running(int procs_running) { 104 | this.procs_running = procs_running; 105 | } 106 | 107 | public void setProcs_blocked(int procs_blocked) { 108 | this.procs_blocked = procs_blocked; 109 | } 110 | 111 | /** 112 | * Gets the number of cores available in this device, across all processors. 113 | * Requires: Ability to peruse the filesystem at "/sys/devices/system/cpu" 114 | * 115 | * @return The number of cores, or 1 if failed to get result 116 | */ 117 | public static int getAmountCores() { 118 | if (amountCoresCache != -1) 119 | return amountCoresCache; 120 | 121 | try { 122 | //Get directory containing CPU info 123 | File dir = new File("/sys/devices/system/cpu/"); 124 | //Filter to only list the devices we care about 125 | final File[] files = dir.listFiles(new CpuFileFilter()); 126 | //Return the number of cores (virtual CPU devices) 127 | return amountCoresCache = files.length; 128 | } catch (final Exception e) { 129 | e.printStackTrace(); 130 | //Default to return 1 core 131 | return 1; 132 | } 133 | } 134 | 135 | @Override 136 | public boolean equals(Object o) { 137 | if (this == o) return true; 138 | if (o == null || getClass() != o.getClass()) return false; 139 | 140 | Cpu cpu = (Cpu) o; 141 | 142 | if (ctxt != cpu.ctxt) return false; 143 | if (btime != cpu.btime) return false; 144 | if (processes != cpu.processes) return false; 145 | if (procs_running != cpu.procs_running) return false; 146 | if (procs_blocked != cpu.procs_blocked) return false; 147 | if (allCores != null ? !allCores.equals(cpu.allCores) : cpu.allCores != null) return false; 148 | return cores != null ? cores.equals(cpu.cores) : cpu.cores == null; 149 | 150 | } 151 | 152 | @Override 153 | public int hashCode() { 154 | int result = allCores != null ? allCores.hashCode() : 0; 155 | result = 31 * result + (cores != null ? cores.hashCode() : 0); 156 | result = 31 * result + ctxt; 157 | result = 31 * result + btime; 158 | result = 31 * result + processes; 159 | result = 31 * result + procs_running; 160 | result = 31 * result + procs_blocked; 161 | return result; 162 | } 163 | 164 | @Override 165 | public String toString() { 166 | return "Cpu{" + 167 | "allCores=" + allCores + 168 | ", cores=" + cores + 169 | ", ctxt=" + ctxt + 170 | ", btime=" + btime + 171 | ", processes=" + processes + 172 | ", procs_running=" + procs_running + 173 | ", procs_blocked=" + procs_blocked + 174 | '}'; 175 | } 176 | } 177 | -------------------------------------------------------------------------------- /lib/src/main/java/net/kibotu/android/deviceinfo/library/display/Display.java: -------------------------------------------------------------------------------- 1 | package net.kibotu.android.deviceinfo.library.display; 2 | 3 | import android.annotation.TargetApi; 4 | import android.content.pm.ActivityInfo; 5 | import android.content.res.Configuration; 6 | import android.graphics.Point; 7 | import android.os.Build; 8 | import android.util.DisplayMetrics; 9 | 10 | import androidx.annotation.NonNull; 11 | import net.kibotu.android.deviceinfo.library.R; 12 | 13 | import static android.os.Build.VERSION_CODES.JELLY_BEAN_MR1; 14 | import static java.lang.Math.max; 15 | import static java.lang.Math.min; 16 | import static java.lang.Math.sqrt; 17 | import static net.kibotu.android.deviceinfo.library.Device.getContext; 18 | import static net.kibotu.android.deviceinfo.library.services.SystemService.getWindowManager; 19 | import static net.kibotu.android.deviceinfo.library.version.Version.isAtLeastVersion; 20 | 21 | public class Display { 22 | 23 | public static android.view.Display getDefaultDisplay() { 24 | return getWindowManager().getDefaultDisplay(); 25 | } 26 | 27 | public static float getRefreshRate() { 28 | return getDefaultDisplay().getRefreshRate(); 29 | } 30 | 31 | @NonNull 32 | public static DisplayMetrics getDisplayMetrics() { 33 | final DisplayMetrics metrics = new DisplayMetrics(); 34 | getDefaultDisplay().getMetrics(metrics); 35 | return metrics; 36 | } 37 | 38 | 39 | @TargetApi(JELLY_BEAN_MR1) 40 | @NonNull 41 | public static DisplayMetrics getRealDisplayMetrics() { 42 | final DisplayMetrics metrics = new DisplayMetrics(); 43 | getDefaultDisplay().getRealMetrics(metrics); 44 | return metrics; 45 | } 46 | 47 | public static double getScreenDiagonalAsPixel() { 48 | final Dimension screen = getScreenDimensions(); 49 | return sqrt(screen.width * screen.width + screen.height * screen.height); 50 | } 51 | 52 | public static double getScreenDiagonalAsInch() { 53 | final Dimension screen = getScreenDimensions(); 54 | final DisplayMetrics displayMetrics = getDisplayMetrics(); 55 | return sqrt(screen.width / displayMetrics.xdpi * screen.width / displayMetrics.xdpi 56 | + screen.height / displayMetrics.ydpi * screen.height / displayMetrics.ydpi); 57 | } 58 | 59 | public static boolean hasSoftKeys() { 60 | return getSoftKeyHeight() > 0; 61 | } 62 | 63 | public static boolean isTabletByLayout() { 64 | return getContext().getResources().getBoolean(R.bool.IsTablet); 65 | } 66 | 67 | /** 68 | * determine-if-the-device-is-a-smartphone-or-tablet 69 | */ 70 | public static boolean isTablet() { 71 | return (getContext().getResources().getConfiguration().screenLayout 72 | & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_LARGE; 73 | } 74 | 75 | public static int getOrientation() { 76 | return isTablet() 77 | ? ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE 78 | : ActivityInfo.SCREEN_ORIENTATION_PORTRAIT; 79 | } 80 | 81 | public static int getStatusBarHeight() { 82 | int result = 0; 83 | int resourceId = getContext().getResources().getIdentifier("status_bar_height", "dimen", "android"); 84 | if (resourceId > 0) { 85 | result = getContext().getResources().getDimensionPixelSize(resourceId); 86 | } 87 | return result; 88 | } 89 | 90 | public static String getDisplayCountry() { 91 | return getContext().getResources().getConfiguration().locale.getDisplayCountry(); 92 | } 93 | 94 | public static int getUsableScreenHeight() { 95 | return getScreenDimensions().height - getStatusBarHeight() - getSoftKeyHeight(); 96 | } 97 | 98 | public static int getSoftKeyHeight() { 99 | return isAtLeastVersion(JELLY_BEAN_MR1) 100 | ? getRealDisplayMetrics().heightPixels - getDisplayMetrics().heightPixels 101 | : getScreenDimensions().height - getDisplayMetrics().heightPixels; 102 | } 103 | 104 | @NonNull 105 | public static Dimension getScreenDimensionsPortrait() { 106 | final Dimension dimension = getScreenDimensions(); 107 | return new Dimension(min(dimension.width, dimension.height), max(dimension.width, dimension.height)); 108 | } 109 | 110 | @NonNull 111 | public static Dimension getScreenDimensionsLandscape() { 112 | final Dimension dimension = getScreenDimensions(); 113 | return new Dimension(max(dimension.width, dimension.height), min(dimension.width, dimension.height)); 114 | } 115 | 116 | @NonNull 117 | public static Dimension getScreenDimensions() { 118 | 119 | final DisplayMetrics dm = new DisplayMetrics(); 120 | final android.view.Display display = getDefaultDisplay(); 121 | display.getMetrics(dm); 122 | 123 | int screenWidth = dm.widthPixels; 124 | int screenHeight = dm.heightPixels; 125 | 126 | if (Build.VERSION.SDK_INT >= 14 && Build.VERSION.SDK_INT < 17) { 127 | try { 128 | screenWidth = (Integer) android.view.Display.class.getMethod("getRawWidth").invoke(display); 129 | screenHeight = (Integer) android.view.Display.class.getMethod("getRawHeight").invoke(display); 130 | } catch (Exception ignored) { 131 | } 132 | } 133 | if (Build.VERSION.SDK_INT >= 17) { 134 | try { 135 | Point realSize = new Point(); 136 | android.view.Display.class.getMethod("getRealSize", Point.class).invoke(display, realSize); 137 | screenWidth = realSize.x; 138 | screenHeight = realSize.y; 139 | } catch (Exception ignored) { 140 | } 141 | } 142 | 143 | return new Dimension(screenWidth, screenHeight); 144 | } 145 | } --------------------------------------------------------------------------------