-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 818ac18
Showing
131 changed files
with
7,762 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
*.iml | ||
.gradle | ||
/local.properties | ||
/.idea/caches/build_file_checksums.ser | ||
/.idea/libraries | ||
/.idea/modules.xml | ||
/.idea/workspace.xml | ||
.DS_Store | ||
/build | ||
/captures | ||
.externalNativeBuild |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# NewSDKAndroidDemo | ||
|
||
#### Description | ||
New SDK Android Demo | ||
|
||
#### Software Architecture | ||
Software architecture description | ||
1.Lock Operate Api:TTLockClient | ||
2.Lock firmware update Api:LockDfuClient | ||
3.Gateway Api:GatewayClient | ||
|
||
#### IDE | ||
Android Studio | ||
|
||
#### Minimum SDK Version | ||
18 | ||
|
||
#### Installation | ||
1. \ implementation 'com.tongtonglock:ttlock:3.0.0' | ||
2. add permission in manifest | ||
\<uses-permission android:name="android.permission.BLUETOOTH" /><br /> | ||
\<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" /><br /> | ||
\<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> | ||
\<uses-permission android:name="android.permission.INTERNET" /> <br /> | ||
\<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> | ||
|
||
3. before use sdk,make sure bluetooth is enabled. | ||
|
||
#### Instructions | ||
|
||
1. init sdk : \GatewayClient.getDefault().prepareBTService(getApplicationContext()); | ||
2. use api:\TTLockClient.getDefault().startScanLock(new ScanLockCallback() { | ||
@Override | ||
public void onScanLockSuccess(ExtendedBluetoothDevice device) { | ||
|
||
} | ||
}); | ||
3. when Activity finished,you should close SDK service:\TTLockClient.getDefault().stopBTService(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# NewSDKAndroidDemo | ||
|
||
#### 介绍 | ||
新版SDK Android端Demo | ||
1.锁操作相关: TTLockClient | ||
2.锁固件升级相关:LockDfuClient | ||
3.网关操作相关:GatewayClient | ||
|
||
#### IDE | ||
Android Studio | ||
|
||
#### Minimum SDK Version | ||
18 | ||
|
||
## 使用说明 | ||
### 引入SDK | ||
\ implementation 'com.tongtonglock:ttlock:3.0.0' | ||
|
||
### manifest配置 | ||
#### 添加Permission | ||
\<uses-permission android:name="android.permission.BLUETOOTH" /><br /> | ||
\<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" /><br /> | ||
\<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> | ||
\<uses-permission android:name="android.permission.INTERNET" /> <br /> | ||
\<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> | ||
|
||
### SDK初始化 | ||
#### 1)确保蓝牙开启 | ||
#### 2)SDK初始化 \GatewayClient.getDefault().prepareBTService(getApplicationContext()); | ||
|
||
#### 3)开始调用接口 比如扫描周围蓝牙智能锁: | ||
\TTLockClient.getDefault().startScanLock(new ScanLockCallback() { | ||
@Override | ||
public void onScanLockSuccess(ExtendedBluetoothDevice device) { | ||
|
||
} | ||
}); | ||
### 重置SDK服务 | ||
#### 3)退出页面之后记得关闭SDK服务 \TTLockClient.getDefault().stopBTService(); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/build | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
apply plugin: 'com.android.application' | ||
|
||
android { | ||
compileSdkVersion 27 | ||
defaultConfig { | ||
applicationId "ttlock.demo" | ||
minSdkVersion 23 | ||
targetSdkVersion 27 | ||
versionCode 1 | ||
versionName "1.0" | ||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" | ||
} | ||
buildTypes { | ||
release { | ||
buildConfigField "String", "API_URL", '"http://120.26.119.23:8085"' | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
|
||
dataBinding { | ||
enabled true | ||
} | ||
|
||
compileOptions { | ||
targetCompatibility JavaVersion.VERSION_1_8 | ||
sourceCompatibility JavaVersion.VERSION_1_8 | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation fileTree(include: ['*.jar'], dir: 'libs') | ||
implementation "com.android.support:appcompat-v7:$rootProject.supportLibraryVersion" | ||
implementation "com.android.support:recyclerview-v7:$rootProject.supportLibraryVersion" | ||
implementation "com.android.support:design:$rootProject.supportLibraryVersion" | ||
implementation 'com.android.support.constraint:constraint-layout:1.1.3' | ||
testImplementation 'junit:junit:4.12' | ||
androidTestImplementation 'com.android.support.test:runner:1.0.2' | ||
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' | ||
implementation 'com.google.code.gson:gson:2.6.2' | ||
implementation 'com.tongtonglock:ttlock:3.0.0' | ||
implementation 'com.squareup.retrofit2:retrofit:2.4.0' | ||
implementation 'com.squareup.retrofit2:converter-gson:2.4.0' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Add project specific ProGuard rules here. | ||
# You can control the set of applied configuration files using the | ||
# proguardFiles setting in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} | ||
|
||
# Uncomment this to preserve the line number information for | ||
# debugging stack traces. | ||
#-keepattributes SourceFile,LineNumberTable | ||
|
||
# If you keep the line number information, uncomment this to | ||
# hide the original source file name. | ||
#-renamesourcefileattribute SourceFile |
26 changes: 26 additions & 0 deletions
26
app/src/androidTest/java/tool/pubhouse/com/ttlocksdkdemo/ExampleInstrumentedTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package tool.pubhouse.com.ttlocksdkdemo; | ||
|
||
import android.content.Context; | ||
import android.support.test.InstrumentationRegistry; | ||
import android.support.test.runner.AndroidJUnit4; | ||
|
||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
/** | ||
* Instrumented test, which will execute on an Android device. | ||
* | ||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a> | ||
*/ | ||
@RunWith(AndroidJUnit4.class) | ||
public class ExampleInstrumentedTest { | ||
@Test | ||
public void useAppContext() { | ||
// Context of the app under test. | ||
Context appContext = InstrumentationRegistry.getTargetContext(); | ||
|
||
assertEquals("tool.pubhouse.com.ttlocksdkdemo", appContext.getPackageName()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="ttlock.demo"> | ||
|
||
<uses-permission android:name="android.permission.BLUETOOTH" /> | ||
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" /> | ||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> | ||
<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" /> | ||
|
||
<application | ||
android:name=".MyApplication" | ||
android:allowBackup="true" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" | ||
android:roundIcon="@mipmap/ic_launcher_round" | ||
android:supportsRtl="true" | ||
android:theme="@style/AppTheme"> | ||
<activity android:name=".AuthActivity"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
|
||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
<activity android:name=".MainActivity"> | ||
|
||
<!-- <intent-filter> --> | ||
<!-- <action android:name="android.intent.action.MAIN" /> --> | ||
|
||
|
||
<!-- <category android:name="android.intent.category.LAUNCHER" /> --> | ||
<!-- </intent-filter> --> | ||
</activity> | ||
<activity android:name=".lock.LockApiActivity" /> | ||
<activity android:name=".lock.ScanLockActivity" /> | ||
<activity android:name=".firmwareupdate.FirmwareUpdateActivity" /> | ||
<activity android:name=".lock.UnlockActivity" /> | ||
<activity android:name=".lock.EnableDisableSomeLockFuncionActivity" /> | ||
<activity android:name=".lock.PassageModeActivity" /> | ||
<activity android:name=".lock.LockTimeActivity" /> | ||
<activity android:name=".passcode.PasscodeActivity" /> | ||
<activity android:name=".passcode.CreateCustomPasscodeActivity" /> | ||
<activity android:name=".passcode.ModifyPasscodeActivity" /> | ||
<activity android:name=".passcode.AdminPasscodeActivity" /> | ||
<activity android:name=".fingerprint.FingerprintActivity" /> | ||
<activity android:name=".iccard.ICCardActivity" /> | ||
<activity android:name=".gateway.GatewayActivity" /> | ||
<activity android:name=".lock.UserLockActivity" /> | ||
<activity android:name=".fingerprint.MyFingerprintListActivity" /> | ||
<activity android:name=".fingerprint.FingerprintModifyActivity" /> | ||
<activity android:name=".iccard.MyICCardListActivity" /> | ||
<activity android:name=".iccard.ICCardModifyActivity" /> | ||
<activity android:name=".gateway.InitGatewayActivity" /> | ||
<activity android:name=".gateway.GatewayDfuActivity" /> | ||
<activity android:name=".gateway.UserGatewayActivity" /> | ||
<activity android:name=".IndexActivity"></activity> | ||
</application> | ||
|
||
</manifest> |
Oops, something went wrong.