========
For Infinity IoT devices you can write your own Android code using this Infinity SDK and install it into your devices.
For more information please see [the website][site].
Download the latest library
or using Gradle:
- add the repository:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
- add the dependency:
dependencies {
implementation 'com.github.infinityiot:infinity-sdk:1.0.0-alpha.3'
}
Minimum Android SDK 19+.
- Initializate the SDK
public class MainActivity extends Activity {
InfinitySDK sdk = null;
@Override
protected void onCreate(Bundle savedInstanceState) {
...
sdk = new InfinitySDK(this, null);
}- Run a command
public void onButtonClick(View view) {
sdk.commands.setAirplaneModeEnabled(false, null);
}setAirplaneModeEnabled: Turn Airplane mode on or off.- param: value -
trueto on,falseto off - param: cb -
nullorInfinitySDK.CommandCallbackobject with the result of the operation: succeed or not
- param: value -
setClockStyle: Set clock style on the lock screen.- param: value -
0to analog,1to digital - param: cb -
nullorInfinitySDK.CommandCallbackobject with the result of the operation: succeed or not
- param: value -
reboot: Reboot the device.- param: cb -
nullorInfinitySDK.CommandCallbackobject with the result of the operation: succeed or not
- param: cb -
shutdown: Turn off the device.- param: cb -
nullorInfinitySDK.CommandCallbackobject with the result of the operation: succeed or not
- param: cb -
InfinitySDK.CommandCallback- Infinity callback interface. Used to notify the user asynchronously of the results of the Command execution.
- method:
void onSuccess(String descrtiption, Bundle params)- Called when the command was completed successfully, where- param: descrtiption - Text description of the command result.
- param: params - Additional information if available.
- method:
void onError(java.lang.String error, android.os.Bundle params)- Called when the Command occurred an error, where- param: error - Error desciption.
- param: params - Additional information if available.
Copyright 2020 Foxifinder, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.