LF Bluetooth Android Demo Introd

2018-12-20  本文已影响0人  肚子大脖子细

A Brief Introduction

DEMO Download Address

Instruction

Demo's main page is as below


261545290467_.pic.jpg

Introduce ppscalelibrary to your project

Add the following permissions to the AndroidManifest file in the project directory

   <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.ACCESS_COARSE_LOCATION" />

Drag ppscalelibrary into the lib folder in the project directory and build. Gradle for dependencies

  repositories {
        flatDir {
            dirs 'lib'
        }
    }
  dependencies {
      implementation(name: 'ppscalelibrary_v1.0.0', ext: 'aar')
  }

The use of ppscalelibrary

Ppscalelibrary provides a utility class entry called BleManager, which is a singleton that ensures that the bluetooth state is the same when you call from different controllers.

 public static BleManager shareInstance(Context context)

To get an instance object by calling a class method, pass in the current context.

 public void searchDevice(boolean isBinding, List<BleDeviceModel> deviceList, BleUserModel userModel, BleDataProtocoInterface protocoInterface) 
Implement methods in the BleDataProtocoInterface interface class to get the information from the scale.
void progressData(LFPeopleGeneral var1);
void lockedData(LFPeopleGeneral var1, BleDeviceModel var2);
 void historyData(boolean var1, LFPeopleGeneral var2, String var3);
void deviceInfo(BleDeviceModel var1);
public void stopSearch()
上一篇下一篇

猜你喜欢

热点阅读