AndroidOpenDemo/.idea/workspace.xml
@@ -6,7 +6,6 @@ </shared> </component> <component name="AndroidLogFilters"> <option name="TOOL_WINDOW_CUSTOM_FILTER" value="404" /> <option name="TOOL_WINDOW_LOG_LEVEL" value="verbose" /> <option name="TOOL_WINDOW_CONFIGURED_FILTER" value="Show only selected application" /> </component> @@ -15,18 +14,20 @@ </component> <component name="ChangeListManager"> <list default="true" id="7bacc5cf-316f-4ad4-b191-7f5297eb7bcf" name="Default Changelist" comment=""> <change beforePath="$PROJECT_DIR$/.idea/modules/app/LCAndroidSDKDemo.app.iml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/modules/app/LCAndroidSDKDemo.app.iml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/service/DeviceAddService.java" beforeDir="false" afterPath="$PROJECT_DIR$/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/service/DeviceAddService.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/DeviceAddModule/build.gradle" beforeDir="false" afterPath="$PROJECT_DIR$/DeviceAddModule/build.gradle" afterDir="false" /> <change beforePath="$PROJECT_DIR$/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/mobilecommon/base/BaseFragmentActivity.java" beforeDir="false" afterPath="$PROJECT_DIR$/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/mobilecommon/base/BaseFragmentActivity.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/openapi/DeviceAddOpenApiManager.java" beforeDir="false" afterPath="$PROJECT_DIR$/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/openapi/DeviceAddOpenApiManager.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/openapi/HttpSend.java" beforeDir="false" afterPath="$PROJECT_DIR$/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/openapi/HttpSend.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/app/build.gradle" beforeDir="false" afterPath="$PROJECT_DIR$/app/build.gradle" afterDir="false" /> <change beforePath="$PROJECT_DIR$/app/src/main/AndroidManifest.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/AndroidManifest.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/app/src/main/java/com/lechange/demo/ui/EnvGuideActivity.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/com/lechange/demo/ui/EnvGuideActivity.java" afterDir="false" /> </list> <option name="SHOW_DIALOG" value="false" /> <option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" /> <option name="LAST_RESOLUTION" value="IGNORE" /> </component> <component name="ExecutionTargetManager" SELECTED_TARGET="device_and_snapshot_combo_box_target[364c4b3158493098]" /> <component name="ExternalProjectsData"> <projectState path="$PROJECT_DIR$"> <ProjectState /> @@ -136,7 +137,7 @@ <recent name="com" /> </key> </component> <component name="RunManager" selected="Android App.app"> <component name="RunManager" selected="Gradle.AndroidOpenDemo:DeviceAddModule [assembleRelease]"> <configuration default="true" type="AndroidJUnit" factoryName="Android JUnit"> <option name="TEST_OBJECT" value="class" /> <option name="WORKING_DIRECTORY" value="$MODULE_DIR$" /> @@ -354,21 +355,50 @@ <breakpoints> <line-breakpoint enabled="true" suspend="THREAD" type="java-line"> <url>file://$PROJECT_DIR$/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/openapi/HttpSend.java</url> <line>56</line> <line>57</line> <option name="timeStamp" value="6" /> </line-breakpoint> <line-breakpoint enabled="true" suspend="THREAD" type="java-line"> <url>file://$PROJECT_DIR$/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/mobilecommon/base/BaseFragmentActivity.java</url> <line>163</line> <option name="timeStamp" value="13" /> </line-breakpoint> <line-breakpoint enabled="true" suspend="THREAD" type="java-line"> <url>file://$PROJECT_DIR$/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/mobilecommon/base/BaseFragmentActivity.java</url> <line>160</line> <option name="timeStamp" value="14" /> </line-breakpoint> <line-breakpoint enabled="true" suspend="THREAD" type="java-line"> <url>file://$PROJECT_DIR$/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/mobilecommon/base/BaseFragmentActivity.java</url> <line>181</line> <option name="timeStamp" value="15" /> </line-breakpoint> <line-breakpoint enabled="true" suspend="THREAD" type="java-line"> <url>file://$PROJECT_DIR$/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/openapi/HttpSend.java</url> <line>71</line> <option name="timeStamp" value="18" /> </line-breakpoint> <line-breakpoint enabled="true" suspend="THREAD" type="java-line"> <url>file://$PROJECT_DIR$/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/LCDeviceEngine.java</url> <line>47</line> <option name="timeStamp" value="19" /> </line-breakpoint> <line-breakpoint enabled="true" suspend="THREAD" type="java-line"> <url>file://$PROJECT_DIR$/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/LCDeviceEngine.java</url> <line>51</line> <option name="timeStamp" value="20" /> </line-breakpoint> <line-breakpoint enabled="true" suspend="THREAD" type="java-line"> <url>file://$PROJECT_DIR$/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/mobilecommon/base/BaseFragmentActivity.java</url> <line>142</line> <option name="timeStamp" value="24" /> </line-breakpoint> </breakpoints> </breakpoint-manager> <watches-manager> <configuration name="app"> <watch expression="openApi" language="JAVA" /> <watch expression="new Gson().fromJson(openApi,JsonObject.class);" language="JAVA" /> <watch expression="e.getMessage()" language="JAVA" /> <watch expression="exception" language="JAVA" /> <watch expression="jsonResult.get("msg").getAsString()" language="JAVA" /> <watch expression="jsonObject" language="JAVA" /> <watch expression="jsonResult.get("code").getAsString()" language="JAVA" /> <watch expression="b" language="JAVA" /> <watch expression="addBaseDialogFragment();" language="JAVA" /> <watch expression="intent.getStringExtra("data");" language="JAVA" /> </configuration> </watches-manager> </component> AndroidOpenDemo/DeviceAddModule/build.gradle
@@ -51,9 +51,10 @@ dependencies { api fileTree(include: ['imageload4dh.jar'], dir: 'libs') // compileOnly fileTree(include: ['eventbus:3.0.0.jar'], dir: 'libs') api fileTree(include: ['eventbus-3.0.0.jar'], dir: 'libs') compileOnly fileTree(include: ['lechangeSDK.jar'], dir: 'libs') // api fileTree(include: ['lechangeSDK.jar'], dir: 'libs') api fileTree(include: ['eventbus-3.0.0.jar'], dir: 'libs') // compile project(':LcOpenSDk') AndroidOpenDemo/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/mobilecommon/base/BaseFragmentActivity.java
@@ -140,7 +140,6 @@ private void registerBroadCast() { IntentFilter mIntentFilter = createBroadCast(); mIntentFilter.addAction("xxxx"); if (mIntentFilter != null && mIntentFilter.countActions() > 0) { broadcastReceiver = new BaseBroadcast(); registerReceiver(broadcastReceiver, mIntentFilter); @@ -155,11 +154,16 @@ } protected IntentFilter createBroadCast() { return null; return new IntentFilter("hdlUserDeviceBind"); } protected void onReceive(Context context, Intent intent) { if(intent!= null){ String action = intent.getAction(); if(action.equals("hdlUserDeviceBind")){ String ddd = intent.getStringExtra("data"); } } } @Override AndroidOpenDemo/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/openapi/DeviceAddOpenApiManager.java
@@ -139,9 +139,9 @@ BindDeviceData.Response response = new BindDeviceData.Response(); response.parseData(json); Intent intent = new Intent(); intent.setAction("hdlUserDeviceBind"); intent.putExtra("data",response.data.toString()); // Intent intent = new Intent(); // intent.setAction("hdlUserDeviceBind"); // intent.putExtra("data",response.data.toString()); return response; } AndroidOpenDemo/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/openapi/HttpSend.java
@@ -1,5 +1,6 @@ package com.mm.android.deviceaddmodule.openapi; import android.content.Intent; import android.text.TextUtils; import com.google.gson.Gson; @@ -55,9 +56,21 @@ if (!"0".equals(code)) { try { String msg = jsonResult.get("msg").getAsString(); if (method.equals("bindDevice")) { Intent intent = new Intent(); intent.setAction("hdlUserDeviceBind"); intent.putExtra("data", jsonResult.toString()); LCDeviceEngine.newInstance().getContext().sendBroadcast(intent); } throw new BusinessException(code + msg); }catch (Exception exception){ String msg = jsonResult.get("message").getAsString(); if (method.equals("bindDevice")) { Intent intent = new Intent(); intent.setAction("hdlUserDeviceBind"); intent.putExtra("data", jsonResult.toString()); LCDeviceEngine.newInstance().getContext().sendBroadcast(intent); } throw new BusinessException(code + msg); } } AndroidOpenDemo/app/build.gradle
@@ -1,88 +1,3 @@ //apply plugin: 'com.android.application' //repositories { // flatDir { // dirs 'libs' // } //} //android { // compileSdkVersion 29 // buildToolsVersion "30.0.1" // defaultConfig { // applicationId "com.lechange.demo.a" // minSdkVersion 21 // //noinspection ExpiredTargetSdkVersion // targetSdkVersion 26 // versionCode 1 // versionName "1.0" // testInstrumentationRunner "android.test.runner.AndroidJUnitRunner" // ndk{ // abiFilters "armeabi","arm64-v8a" // } // // javaCompileOptions { // annotationProcessorOptions { // arguments = [ AROUTER_MODULE_NAME : project.getName() ] // } // } // } // signingConfigs { // debug { // keyAlias 'key' // keyPassword 'lcmobile' // storeFile file('demo.keystore') // storePassword 'lcmobile' // } // release { // keyAlias 'key' // keyPassword 'lcmobile' // storeFile file('demo.keystore') // storePassword 'lcmobile' // } // } // buildTypes { // release { // minifyEnabled false // signingConfig signingConfigs.getByName('release') // proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' // } // } // android { // lintOptions { // abortOnError false // } // } // // applicationVariants.all { variant -> // variant.outputs.all { output -> // if (variant.buildType.name.equals('release')) { // variant.getPackageApplication().outputDirectory = new File(project.rootDir.absolutePath + File.separator + "artifacts") // def fileName = "AndroidDemo_V${defaultConfig.versionName}.R.${releaseTime()}.apk" // outputFileName = fileName // }else { // def file = output.outputFile // variant.getPackageApplication().outputDirectory = new File(file.parent) // def fileName = "AndroidDemo_V${defaultConfig.versionName}.R.${releaseTime()}.apk" // outputFileName = fileName // } // } // } //} // // //def releaseTime() { // return new Date().format("yyyyMMdd") //} // //dependencies { // implementation fileTree(dir: 'libs', include: ['*.jar']) // 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' // api project(':usermodule') // annotationProcessor 'com.alibaba:arouter-compiler:1.2.2' //// implementation("com.android.support:support-v4:28.0.0") //} apply plugin: 'com.android.application' repositories { flatDir { AndroidOpenDemo/app/src/main/AndroidManifest.xml
@@ -23,10 +23,10 @@ android:launchMode="singleTop" android:theme="@style/AppTheme" android:screenOrientation="portrait"> <!-- <intent-filter>--> <!-- <action android:name="android.intent.action.MAIN" />--> <!-- <category android:name="android.intent.category.LAUNCHER" />--> <!-- </intent-filter>--> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name=".ui.DeviceListActivity" AndroidOpenDemo/app/src/main/java/com/lechange/demo/ui/EnvGuideActivity.java
@@ -73,10 +73,11 @@ HdlToLcUtils.getInstance().initData(this, "HDL-HOME-APP-TEST", "WeJ8TY88vbakCcnvH8G1tDUqzLWY8yss", "https://test-gz.hdlcontrol.com"); HdlToLcUtils.getInstance().setHomeId("1547099040465408002"); HdlToLcUtils.getInstance().setToken("eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJqdGkiOiJjYjRjY2JkZDgxNTQ0YzY3YWIxZDJmMjVjMmQ0NGY0NyIsImNvbXBhbnlJZCI6IjAiLCJyb2xlIjoiIiwiaGVhZGVyUHJlZml4IjoiQmVhcmVyICIsInVzZXJBY2NvdW50Ijoid3hyIiwidGVuYW50SWQiOiIyMCIsInVzZXJUeXBlIjoiVVNFUl9DIiwidG9rZW5UeXBlIjoiYWNjZXNzX3Rva2VuIiwidXNlck5hbWUiOiJrYWVkZSIsIm9wZW5BcHBsaWNhdGlvbklkIjoiMCIsInVzZXJJZCI6IjEzOTIwMzU1NjgyMDQ0MjMxNjkiLCJleHAiOjE2NzA0MDM1OTMsIm5iZiI6MTY3MDM5NjM5M30.fi6cs3nYjsVs2aFzhcJWqTTB3D7oiGlNPLNrS0itMRlb0tQvvVU7QfZ2Oc-YYJgaQ0AsqUsItG2gI9g1tDU6xFEjcB6Pi4OFDJQp7hHEKXXLzrCtIiszoxavumqHwWKKDt6S2ERm056e12nNulAHpEV5BMWoWp8GhCdaNSX2oDQ"); HdlToLcUtils.getInstance().setSubAccessToken("St_0000sgfdc5297c88a840e59264b22681"); HdlToLcUtils.getInstance().setToken("eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJqdGkiOiJhMGRiYmFjZDk4NzM0YmUyYWFhNDAwNjEzNzk5NTk0NSIsImNvbXBhbnlJZCI6IjAiLCJyb2xlIjoiIiwiaGVhZGVyUHJlZml4IjoiQmVhcmVyICIsInVzZXJBY2NvdW50Ijoid3hyIiwidGVuYW50SWQiOiIyMCIsInVzZXJUeXBlIjoiVVNFUl9DIiwidG9rZW5UeXBlIjoiYWNjZXNzX3Rva2VuIiwidXNlck5hbWUiOiJ3eHIiLCJ1c2VyRGF0YVJpZ2h0IjoiMSIsIm9wZW5BcHBsaWNhdGlvbklkIjoiMCIsInVzZXJJZCI6IjEzOTIwMzU1NjgyMDQ0MjMxNjkiLCJleHAiOjE2NzY5Njg0NTQsIm5iZiI6MTY3Njk2MTI1NH0.clsu2lKT8v3YPYrR7xtOwo21iCi9c__m_GCkIURNfXOid-ATAkvTjQvMveQyC-Q9f7qkH9O5TxUi0zPpTwqiFDxkO2_Xpcsuly310uhb3xBGpgp96_AKbyI69G9Q2lfj2EYBExcVwz54Sf2kgpX4kIXJINFULM4xYb7haNalRVw"); HdlToLcUtils.getInstance().setSubAccessToken("St_0000sg1cd05955ed7043b58f35d5456e"); // HdlToLcUtils.getInstance().openActivity(); // HdlToLcUtils.getInstance().openActivity(); HdlToLcUtils.getInstance().addCamera(new IAddCamera() { @Override public void back() {