Skip to content

Commit

Permalink
2021.03.08: 优化bug
Browse files Browse the repository at this point in the history
  • Loading branch information
konewu committed Mar 8, 2021
1 parent e051405 commit bff9358
Show file tree
Hide file tree
Showing 17 changed files with 654 additions and 475 deletions.
6 changes: 6 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 11 additions & 4 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 35 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 11 additions & 5 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,25 @@ android {
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
testImplementation 'junit:junit:4.12'
implementation 'androidx.constraintlayout:constraintlayout:2.0.2'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'

implementation project(path: ':sinovoble')

implementation 'com.alibaba:fastjson:1.1.72.android' //fastjson 解析库
implementation 'com.alibaba:fastjson:1.2.40' //fastjson 解析库

implementation('com.aliyun.alink.linksdk:iot-linkkit:1.7.2')
implementation('com.aliyun.alink.linksdk:public-channel-core:0.7.7.1')
// implementation('com.aliyun.alink.linksdk:iot-linkkit:1.7.2')
// implementation('com.aliyun.alink.linksdk:public-channel-core:0.7.7.1')
}
16 changes: 9 additions & 7 deletions app/src/main/java/com/sinovotec/sinovobledemo/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@
import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.os.Looper;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

import com.alibaba.fastjson.JSONObject;
import com.sinovotec.sinovoble.SinovoBle;
import com.sinovotec.sinovoble.callback.IConnectCallback;
import com.sinovotec.sinovoble.callback.IScanCallBack;
Expand All @@ -25,7 +23,7 @@ public class MainActivity extends AppCompatActivity {
/**
* 扫描回调
*/
private IScanCallBack mBleScanCallBack = new IScanCallBack() {
private final IScanCallBack mBleScanCallBack = new IScanCallBack() {
@Override
public void onDeviceFound(String scanResult) {
Log.w("xxx", "onDeviceFound:" + scanResult);
Expand All @@ -42,7 +40,7 @@ public void onScanTimeout(String scanResult) {
/**
* 连接回调
*/
private IConnectCallback mConnCallBack = new IConnectCallback() {
private final IConnectCallback mConnCallBack = new IConnectCallback() {

@Override
public void onConnectSuccess(String macAddress) {
Expand All @@ -66,8 +64,7 @@ public void onBluetoothOn() {
}

@Override
public void onDisconnect() {
Log.i("xxx","连接回调 IConnectCallback 连接断开");
public void onDisconnect(String macaddress) {

}

Expand Down Expand Up @@ -143,6 +140,11 @@ public void onAuthorOther(String result) {

}

@Override
public void onLockFrozen(String result) {

}

@Override
public void onReceiveDataFailed() {

Expand All @@ -161,7 +163,7 @@ protected void onCreate(Bundle savedInstanceState) {
Button chkp = findViewById(R.id.btn_chkpower);

final EditText myet = findViewById(R.id.lockid_et);
final EditText usernameet = findViewById(R.id.username_et);
// final EditText usernameet = findViewById(R.id.username_et);
reslut_tv = findViewById(R.id.result_tv);

newbtn.setOnClickListener(new View.OnClickListener() {
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {

}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.4'
classpath 'com.android.tools.build:gradle:3.5.2'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Thu Sep 10 15:52:33 CST 2020
#Mon Mar 08 11:25:46 CST 2021
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Expand Down
18 changes: 14 additions & 4 deletions sinovoble/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,34 @@ android {
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

sourceSets {
main{
jniLibs.srcDirs = ['jnilibs']
}
}

repositories {
maven {
url "https://repo.eclipse.org/content/repositories/paho-snapshots/"
}
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

implementation 'androidx.appcompat:appcompat:1.2.0'
testImplementation 'junit:junit:4.12'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation 'com.alibaba:fastjson:1.1.72.android' //fastjson 解析库
implementation 'com.alibaba:fastjson:1.2.40' //fastjson 解析库 原来 1.1.72

implementation('com.aliyun.alink.linksdk:iot-linkkit:1.7.2')
implementation('com.aliyun.alink.linksdk:public-channel-core:0.7.7.1')
implementation 'org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.1.0' //原来 1.1.0
implementation 'org.eclipse.paho:org.eclipse.paho.android.service:1.1.1'

}
6 changes: 6 additions & 0 deletions sinovoble/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,11 @@
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" /> <!-- 5.0以上的手机可能会需要这个权限 -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<application>
<!-- Mqtt Service -->
<service android:name="org.eclipse.paho.android.service.MqttService"/>
</application>


</manifest>

Loading

0 comments on commit bff9358

Please sign in to comment.