GithubHelp home page GithubHelp logo

serg7k / android_sdk_demo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ttlock/android_sdk_demo

0.0 0.0 0.0 860 KB

TTLock is a global provider of solutions for smart locks. We provide PCBA and softwares for lock manufactures and end users. We provide open API/SDK for developers. With these APIs/SDKs, you can develop your own applications to manage smart locks. The SDK here is for mobile app to communicate with locks via bluetooth.

Java 100.00%

android_sdk_demo's Introduction

NewSDKAndroidDemo

instructions in English

https://github.com/ttlock/Android_SDK_Demo/blob/master/README.en.md

Developers Email list

[email protected]

介绍

新版SDK Android端Demo
1.锁操作相关: TTLockClient
2.锁固件升级相关:LockDfuClient
3.网关操作相关:GatewayClient

IDE

Android Studio

Minimum SDK Version

18

使用说明

引入SDK

implementation 'com.ttlock:ttlock:3.1.9'

manifest配置

添加Permission

<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

SDK初始化

1)确保蓝牙开启

2)SDK初始化

TTLockClient.getDefault().prepareBTService(getApplicationContext());

3)开始调用接口 比如扫描周围蓝牙智能锁:

TTLockClient.getDefault().startScanLock(new ScanLockCallback() {
    @Override
    public void onScanLockSuccess(ExtendedBluetoothDevice device) {

    }
});

重置SDK服务

退出页面之后记得关闭SDK服务

TTLockClient.getDefault().stopBTService();

android_sdk_demo's People

Contributors

lxk123 avatar ttlock avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.