diff --git a/MyApplication/.idea/compiler.xml b/MyApplication/.idea/compiler.xml
index fb7f4a8..443b5d2 100644
--- a/MyApplication/.idea/compiler.xml
+++ b/MyApplication/.idea/compiler.xml
@@ -1,6 +1,6 @@
-
+
\ No newline at end of file
diff --git a/MyApplication/.idea/gradle.xml b/MyApplication/.idea/gradle.xml
index 16cb8d7..37236d1 100644
--- a/MyApplication/.idea/gradle.xml
+++ b/MyApplication/.idea/gradle.xml
@@ -7,12 +7,12 @@
-
+
diff --git a/MyApplication/.idea/jarRepositories.xml b/MyApplication/.idea/jarRepositories.xml
index 19e238e..fb11910 100644
--- a/MyApplication/.idea/jarRepositories.xml
+++ b/MyApplication/.idea/jarRepositories.xml
@@ -21,5 +21,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/MyApplication/.idea/vcs.xml b/MyApplication/.idea/vcs.xml
new file mode 100644
index 0000000..6c0b863
--- /dev/null
+++ b/MyApplication/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/MyApplication/build.gradle b/MyApplication/build.gradle
index 7b262c2..ba74084 100644
--- a/MyApplication/build.gradle
+++ b/MyApplication/build.gradle
@@ -1,33 +1,29 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
-apply plugin: 'com.huawei.ohos.app'
-//For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#section1112183053510
-ohos {
- compileSdkVersion 6
-}
-
buildscript {
+
repositories {
- maven {
- url 'https://repo.huaweicloud.com/repository/maven/'
- }
- maven {
- url 'https://developer.huawei.com/repo/'
- }
+ google()
+ jcenter()
}
dependencies {
- classpath 'com.huawei.ohos:hap:3.0.3.2'
- classpath 'com.huawei.ohos:decctest:1.2.6.0'
+ classpath 'com.android.tools.build:gradle:3.1.3'
+ classpath 'com.meituan.android.walle:plugin:1.1.6'
+
+
+ // NOTE: Do not place your application dependencies here; they belong
+ // in the individual module build.gradle files
}
}
allprojects {
repositories {
- maven {
- url 'https://repo.huaweicloud.com/repository/maven/'
- }
- maven {
- url 'https://developer.huawei.com/repo/'
- }
+ google()
+ jcenter()
+ maven { url 'https://jitpack.io' }
}
}
+
+task clean(type: Delete) {
+ delete rootProject.buildDir
+}
diff --git a/MyApplication/entry/.gitignore b/MyApplication/entry/.gitignore
index 7d5b7a9..3ae816f 100644
--- a/MyApplication/entry/.gitignore
+++ b/MyApplication/entry/.gitignore
@@ -1,2 +1,5 @@
/build
-/node_modules
+/.gradle
+.idea
+/.idea
+app.iml
\ No newline at end of file
diff --git a/MyApplication/entry/build.gradle b/MyApplication/entry/build.gradle
index d493119..32ac13a 100644
--- a/MyApplication/entry/build.gradle
+++ b/MyApplication/entry/build.gradle
@@ -1,26 +1,91 @@
-apply plugin: 'com.huawei.ohos.hap'
-apply plugin: 'com.huawei.ohos.decctest'
-//For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#section1112183053510
-ohos {
- compileSdkVersion 6
+apply plugin: 'com.android.application'
+apply plugin: 'walle'
+
+android {
+ compileSdkVersion 28
defaultConfig {
- compatibleSdkVersion 6
+ applicationId "com.heweather.owp"
+ minSdkVersion 19
+ targetSdkVersion 28
+ versionCode 3
+ versionName "1.0.2"
+ testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
- buildTypes {
- release {
- proguardOpt {
- proguardEnabled false
- rulesFiles 'proguard-rules.pro'
- }
+ signingConfigs {
+ he {
+ keyAlias "heweather"
+ keyPassword "He123qwe."
+ storeFile rootProject.file("he.jks")
+ storePassword "He123qwe."
}
}
-}
+ buildTypes {
+ debug {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ signingConfig signingConfigs.he
+ }
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ signingConfig signingConfigs.he
+ }
+ }
+ allprojects {
+ repositories {
+ mavenCentral()
+ }
+ }
+ sourceSets {
+ main {
+ jniLibs.srcDirs = ['libs']
+ }
+ // Move the tests to tests/java, tests/res, etc...
+// instrumentTest.setRoot('tests')
+
+ // Move the build types to build-types/
+ // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
+ // This moves them out of them default location under src//... which would
+ // conflict with src/ being used by the main source set.
+ // Adding new build types or product flavors should be accompanied
+ // by a similar customization.
+ debug.setRoot('build-types/debug')
+ release.setRoot('build-types/release')
+ }
+}
+buildscript {
+ repositories {
+ jcenter()
+ }
+}
+//生成渠道包 ./gradlew clean assembleReleaseChannels
+//支持 productFlavors ./gradlew clean assembleMeituanReleaseChannels
+//生成单个渠道包 ./gradlew clean assembleReleaseChannels -PchannelList=google
+//生成多个渠道包 ./gradlew clean assembleReleaseChannels -PchannelList=google,dianping
+walle {
+ // 指定渠道包的输出路径
+ apkOutputFolder = new File("${project.buildDir}/channels")
+ // 定制渠道包的APK的文件名称
+ apkFileNameFormat = '${appName}-${channel}-${buildType}-v${versionName}-${versionCode}-${buildTime}.apk'
+ // 渠道配置文件
+ channelFile = new File("${project.getProjectDir()}/channel")
+}
dependencies {
- implementation fileTree(dir: 'libs', include: ['*.jar', '*.har'])
- testImplementation 'junit:junit:4.13.1'
- ohosTestImplementation 'com.huawei.ohos.testkit:runner:1.0.0.200'
-}
-decc {
- supportType = ['html','xml']
+ implementation fileTree(include: ['*.jar'], dir: 'libs')
+ implementation 'com.android.support:appcompat-v7:28.0.0'
+ implementation 'com.android.support:design:28.0.0'
+ implementation 'com.android.support.constraint:constraint-layout:1.1.3'
+ implementation 'com.android.support:support-v4:28.0.0'
+ testImplementation 'junit:junit:4.12'
+ androidTestImplementation 'com.android.support.test:runner:1.0.1'
+ androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
+ implementation 'joda-time:joda-time:2.10'
+ implementation 'com.squareup.okhttp3:okhttp:3.10.0'
+ implementation 'com.zhy:okhttputils:2.6.2'
+ implementation files('libs/android-logging-log4j-1.0.3.jar')
+ implementation files('libs/log4j-1.2.17.jar')
+ implementation 'com.google.code.gson:gson:2.8.0'
+ implementation files('libs/AMap_Location_V4.0.1_20180426.jar')
+ implementation files('libs/HeWeather_sdk.jar')
}
diff --git a/MyApplication/entry/proguard-rules.pro b/MyApplication/entry/proguard-rules.pro
deleted file mode 100644
index f7666e4..0000000
--- a/MyApplication/entry/proguard-rules.pro
+++ /dev/null
@@ -1 +0,0 @@
-# config module specific ProGuard rules here.
\ No newline at end of file
diff --git a/MyApplication/entry/src/main/config.json b/MyApplication/entry/src/main/config.json
deleted file mode 100644
index 8d9d5b4..0000000
--- a/MyApplication/entry/src/main/config.json
+++ /dev/null
@@ -1,51 +0,0 @@
-{
- "app": {
- "bundleName": "com.example.myapplication",
- "vendor": "example",
- "version": {
- "code": 1000000,
- "name": "1.0.0"
- }
- },
- "deviceConfig": {},
- "module": {
- "package": "com.example.myapplication",
- "name": ".MyApplication",
- "mainAbility": "com.example.myapplication.MainAbility",
- "deviceType": [
- "phone",
- "tablet",
- "tv",
- "wearable",
- "car"
- ],
- "distro": {
- "deliveryWithInstall": true,
- "moduleName": "entry",
- "moduleType": "entry",
- "installationFree": false
- },
- "abilities": [
- {
- "skills": [
- {
- "entities": [
- "entity.system.home"
- ],
- "actions": [
- "action.system.home"
- ]
- }
- ],
- "orientation": "unspecified",
- "visible": true,
- "name": "com.example.myapplication.MainAbility",
- "icon": "$media:icon",
- "description": "$string:mainability_description",
- "label": "$string:entry_MainAbility",
- "type": "page",
- "launchType": "standard"
- }
- ]
- }
-}
\ No newline at end of file
diff --git a/MyApplication/entry/src/main/java/com/heweather/owp/adapter/ForecastAdapter.java b/MyApplication/entry/src/main/java/com/heweather/owp/adapter/ForecastAdapter.java
index b47b8c0..85601fa 100644
--- a/MyApplication/entry/src/main/java/com/heweather/owp/adapter/ForecastAdapter.java
+++ b/MyApplication/entry/src/main/java/com/heweather/owp/adapter/ForecastAdapter.java
@@ -1,5 +1,5 @@
package com.heweather.owp.adapter;
-/**/
+
import android.annotation.SuppressLint;
import android.content.Context;
import android.support.annotation.NonNull;
diff --git a/MyApplication/entry/src/main/resources/base/element/string.json b/MyApplication/entry/src/main/resources/base/element/string.json
deleted file mode 100644
index c2a6b66..0000000
--- a/MyApplication/entry/src/main/resources/base/element/string.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "string": [
- {
- "name": "entry_MainAbility",
- "value": "entry_MainAbility"
- },
- {
- "name": "mainability_description",
- "value": "Java_Empty Ability"
- },
- {
- "name": "mainability_HelloWorld",
- "value": "Hello World"
- }
- ]
-}
\ No newline at end of file
diff --git a/MyApplication/entry/src/main/resources/base/graphic/background_ability_main.xml b/MyApplication/entry/src/main/resources/base/graphic/background_ability_main.xml
deleted file mode 100644
index c0c0a3d..0000000
--- a/MyApplication/entry/src/main/resources/base/graphic/background_ability_main.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/MyApplication/entry/src/main/resources/base/layout/ability_main.xml b/MyApplication/entry/src/main/resources/base/layout/ability_main.xml
deleted file mode 100644
index fd19d6d..0000000
--- a/MyApplication/entry/src/main/resources/base/layout/ability_main.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/MyApplication/entry/src/main/resources/base/media/icon.png b/MyApplication/entry/src/main/resources/base/media/icon.png
deleted file mode 100644
index ce307a8..0000000
Binary files a/MyApplication/entry/src/main/resources/base/media/icon.png and /dev/null differ
diff --git a/MyApplication/entry/src/main/resources/en/element/string.json b/MyApplication/entry/src/main/resources/en/element/string.json
deleted file mode 100644
index bcf9f99..0000000
--- a/MyApplication/entry/src/main/resources/en/element/string.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "string": [
- {
- "name": "entry_MainAbility",
- "value": "entry_MainAbility"
- },
- {
- "name": "mainability_description",
- "value": "Java_Empty Ability"
- },
- {
- "name": "mainability_HelloWorld",
- "value": "Hello World"
- }
- ]
-}
diff --git a/MyApplication/entry/src/main/resources/zh/element/string.json b/MyApplication/entry/src/main/resources/zh/element/string.json
deleted file mode 100644
index fdc4bd1..0000000
--- a/MyApplication/entry/src/main/resources/zh/element/string.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "string": [
- {
- "name": "entry_MainAbility",
- "value": "entry_MainAbility"
- },
- {
- "name": "mainability_description",
- "value": "Java_Empty Ability"
- },
- {
- "name": "mainability_HelloWorld",
- "value": "你好,世界"
- }
- ]
-}
\ No newline at end of file
diff --git a/MyApplication/entry/src/ohosTest/java/com/example/myapplication/ExampleOhosTest.java b/MyApplication/entry/src/ohosTest/java/com/example/myapplication/ExampleOhosTest.java
deleted file mode 100644
index 54fafd8..0000000
--- a/MyApplication/entry/src/ohosTest/java/com/example/myapplication/ExampleOhosTest.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package com.example.myapplication;
-
-import ohos.aafwk.ability.delegation.AbilityDelegatorRegistry;
-import org.junit.Test;
-
-import static org.junit.Assert.assertEquals;
-
-public class ExampleOhosTest {
- @Test
- public void testBundleName() {
- final String actualBundleName = AbilityDelegatorRegistry.getArguments().getTestBundleName();
- assertEquals("com.example.myapplication", actualBundleName);
- }
-}
\ No newline at end of file
diff --git a/MyApplication/entry/src/test/java/com/example/myapplication/ExampleTest.java b/MyApplication/entry/src/test/java/com/example/myapplication/ExampleTest.java
deleted file mode 100644
index 160d520..0000000
--- a/MyApplication/entry/src/test/java/com/example/myapplication/ExampleTest.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package com.example.myapplication;
-
-import org.junit.Test;
-
-public class ExampleTest {
- @Test
- public void onStart() {
- }
-}
diff --git a/MyApplication/gradle.properties b/MyApplication/gradle.properties
index be49249..743d692 100644
--- a/MyApplication/gradle.properties
+++ b/MyApplication/gradle.properties
@@ -1,13 +1,13 @@
# Project-wide Gradle settings.
-# IDE (e.g. DevEco Studio) users:
+# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
-# If the Chinese output is garbled, please configure the following parameter.
-# This function is enabled by default when the DevEco Studio builds the hap/app,if you need disable gradle parallel,you should set org.gradle.parallel false.
-# more information see https://docs.gradle.org/current/userguide/performance.html
-# org.gradle.parallel=false
-# org.gradle.jvmargs=-Dfile.encoding=GBK
\ No newline at end of file
+org.gradle.jvmargs=-Xmx1536m
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. More details, visit
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
+# org.gradle.parallel=true
diff --git a/MyApplication/gradle/wrapper/gradle-wrapper.jar b/MyApplication/gradle/wrapper/gradle-wrapper.jar
deleted file mode 100644
index 490fda8..0000000
Binary files a/MyApplication/gradle/wrapper/gradle-wrapper.jar and /dev/null differ
diff --git a/MyApplication/gradle/wrapper/gradle-wrapper.properties b/MyApplication/gradle/wrapper/gradle-wrapper.properties
deleted file mode 100644
index f59159e..0000000
--- a/MyApplication/gradle/wrapper/gradle-wrapper.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-distributionBase=GRADLE_USER_HOME
-distributionPath=wrapper/dists
-distributionUrl=https\://repo.huaweicloud.com/gradle/gradle-6.3-bin.zip
-zipStoreBase=GRADLE_USER_HOME
-zipStorePath=wrapper/dists
diff --git a/MyApplication/gradlew b/MyApplication/gradlew
index 2fe81a7..cccdd3d 100644
--- a/MyApplication/gradlew
+++ b/MyApplication/gradlew
@@ -1,21 +1,5 @@
#!/usr/bin/env sh
-#
-# Copyright 2015 the original author or authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# https://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
##############################################################################
##
## Gradle start up script for UN*X
@@ -44,7 +28,7 @@ APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
+DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
@@ -125,8 +109,8 @@ if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
-# For Cygwin or MSYS, switch paths to Windows format before running java
-if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
@@ -154,19 +138,19 @@ if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
else
eval `echo args$i`="\"$arg\""
fi
- i=`expr $i + 1`
+ i=$((i+1))
done
case $i in
- 0) set -- ;;
- 1) set -- "$args0" ;;
- 2) set -- "$args0" "$args1" ;;
- 3) set -- "$args0" "$args1" "$args2" ;;
- 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
- 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
- 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
- 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
- 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
- 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
@@ -175,9 +159,14 @@ save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
-APP_ARGS=`save "$@"`
+APP_ARGS=$(save "$@")
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+ cd "$(dirname "$0")"
+fi
+
exec "$JAVACMD" "$@"
diff --git a/MyApplication/gradlew.bat b/MyApplication/gradlew.bat
index 62bd9b9..f955316 100644
--- a/MyApplication/gradlew.bat
+++ b/MyApplication/gradlew.bat
@@ -1,19 +1,3 @@
-@rem
-@rem Copyright 2015 the original author or authors.
-@rem
-@rem Licensed under the Apache License, Version 2.0 (the "License");
-@rem you may not use this file except in compliance with the License.
-@rem You may obtain a copy of the License at
-@rem
-@rem https://www.apache.org/licenses/LICENSE-2.0
-@rem
-@rem Unless required by applicable law or agreed to in writing, software
-@rem distributed under the License is distributed on an "AS IS" BASIS,
-@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-@rem See the License for the specific language governing permissions and
-@rem limitations under the License.
-@rem
-
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@@ -29,11 +13,8 @@ if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
-@rem Resolve any "." and ".." in APP_HOME to make it shorter.
-for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
-
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
+set DEFAULT_JVM_OPTS=
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
diff --git a/MyApplication/settings.gradle b/MyApplication/settings.gradle
index 4773db7..e7b4def 100644
--- a/MyApplication/settings.gradle
+++ b/MyApplication/settings.gradle
@@ -1 +1 @@
-include ':entry'
+include ':app'