/sdk-base-android

An XYO inspired utility framework for Android and Kotlin

Primary LanguageKotlinGNU Lesser General Public License v3.0LGPL-3.0

logo

sdk-base-android

BCH compliance Codacy Badge Maintainability Known Vulnerabilities

The XYO Foundation provides this source code available in our efforts to advance the understanding of the XYO Protocol and its possible uses. We continue to maintain this software in the interest of developer education. Usage of this source code is not intended for production.

Table of Contents

An XY inspired utility framework for Android and Kotlin

Install

Add as dependency in build.gradle

dependencies {
    api 'com.github.XYOracleNetwork:sdk-base-android:2.1.289'
}

How to use

Easily check for required permissions:

 val permissions = XYPermissions(this.activity!!)
 permissions.requestPermission(Manifest.permission.READ_EXTERNAL_STORAGE,
    "Store a picture on your device.", CAM_PERMISSION_REQ_CODE)

Get the device name:

 val deviceName = XYDeviceName.getDeviceName()
 val deviceName = XYDeviceName.getDeviceName("default_val_if_unknown")
 val deviceName = XYDeviceName.getDeviceName(Build.MANUFACTURER, Build.MODEL, "default_val_if_unknown")

Logging:

 log.info("A simple INFO log")
 log.info("myFunctionName", "A simple INFO log")
 log.action("Actions are events that are generated by the user, like pushing a button")
 log.status("Status are Large Scale Events, Such As Startup, or Shutdown")
 log.error("An error occured" , false) //set true to rethrow error
 log.error(myException) //Any Handled Exceptions
 log.error("An error with a custom message")

Contributing

Please note that any contributions must clear the release branch.

License

See the LICENSE.md file for license details.

Credits

Made with 🔥and ❄️ by XYO