version:2.1

fix:修复地图失败,修复获取天气失败
update:
This commit is contained in:
2022-06-15 16:51:00 +08:00
parent f954fc036d
commit b6e1b51545
7 changed files with 22 additions and 29 deletions

View File

@@ -2,7 +2,7 @@ apply plugin: 'com.android.application'
apply plugin: "com.tencent.android.tpns"
def appName() {
return "桌面"
return "老人桌面"
}
def releaseTime() {
@@ -16,8 +16,8 @@ android {
applicationId "com.uiui.aios"
minSdkVersion 24
targetSdkVersion 29
versionCode 11
versionName "2.0"
versionCode 12
versionName "2.1"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@@ -31,6 +31,10 @@ android {
XG_ACCESS_ID : "1500030457",
XG_ACCESS_KEY : "AZZXANJF4HBD",
]
manifestPlaceholders = [
AMAP_KEY: "ff08045221483b649cc41e77ee2ad941"
]
}
lintOptions {
@@ -76,27 +80,19 @@ android {
buildTypes {
zhanRuiRelease.initWith(release)
zhanRuiRelease {
manifestPlaceholders = [
AMAP_KEY: "70f37634f84b00c5c7347c545bc2a3b9"
]
buildConfigField "boolean", "LOG_DEBUG", "false"
signingConfig signingConfigs.zhanRui
}
zhanRuiDebug.initWith(debug)
zhanRuiDebug {
manifestPlaceholders = [
AMAP_KEY: "70f37634f84b00c5c7347c545bc2a3b9"
]
buildConfigField "boolean", "LOG_DEBUG", "true"
versionNameSuffix "-debug"
debuggable true
signingConfig signingConfigs.zhanRui
}
debug {
manifestPlaceholders = [
AMAP_KEY: "e7c2b3cb84ca7ac4100b1ffceb3d5685"
]
// 显示Log
buildConfigField "boolean", "LOG_DEBUG", "true"
versionNameSuffix "-debug"
@@ -114,9 +110,6 @@ android {
}
}
release {
manifestPlaceholders = [
AMAP_KEY: "e7c2b3cb84ca7ac4100b1ffceb3d5685"
]
// 不显示Log
buildConfigField "boolean", "LOG_DEBUG", "false"
//混淆
@@ -147,7 +140,7 @@ android {
dependencies {
// implementation fileTree(dir: 'libs', include: ['*.jar'])
compileOnly files('libs/framework.jar')
implementation files('libs/QWeather_Public_Android_V4.6.jar')
implementation files('libs/QWeather_Public_Android_V4.9.jar')
//保持1.3.1 更新会报错
implementation 'androidx.appcompat:appcompat:1.3.1'
//2.0.4以上无法预览
@@ -176,7 +169,7 @@ dependencies {
implementation "com.squareup.retrofit2:adapter-rxjava3:2.9.0"
//Gson
implementation 'com.google.code.gson:gson:2.9.0'
implementation 'com.google.zxing:core:3.4.1'
implementation 'com.google.zxing:core:3.5.0'
//生命周期管理
implementation 'com.trello.rxlifecycle4:rxlifecycle:4.0.2'
implementation 'com.trello.rxlifecycle4:rxlifecycle-android:4.0.2'
@@ -190,7 +183,7 @@ dependencies {
implementation 'com.amap.api:location:5.1.0'
//MMKV
implementation 'com.tencent:mmkv-static:1.2.12'
implementation 'com.tencent.tpns:tpns:1.3.4.1-release'
implementation 'com.tencent.tpns:tpns:1.3.4.3-release'
//状态栏透明
implementation 'com.gitee.zackratos:UltimateBarX:0.8.0'
//指示器

Binary file not shown.

View File

@@ -12,7 +12,7 @@ import com.qweather.sdk.bean.weather.WeatherDailyBean;
import com.qweather.sdk.view.QWeather;
import com.tencent.mmkv.MMKV;
import com.trello.rxlifecycle4.android.ActivityEvent;
import com.uiui.aios.utils.AmapManager;
import com.uiui.aios.manager.AmapManager;
import java.lang.reflect.Type;

View File

@@ -18,7 +18,7 @@ import com.uiui.aios.BuildConfig;
import com.uiui.aios.network.NetInterfaceManager;
import com.uiui.aios.service.main.MainService;
import com.uiui.aios.utils.AlarmUtils;
import com.uiui.aios.utils.AmapManager;
import com.uiui.aios.manager.AmapManager;
import com.uiui.aios.utils.AppUsedTimeUtils;
import com.uiui.aios.utils.Utils;
@@ -61,7 +61,9 @@ public class BaseApplication extends Application {
tpushInit();
AppUsedTimeUtils.init(this);
AlarmUtils.init(this);
HeConfig.init("HE2111041506381545", "32b5ec69545e44119583a5e0ed4e87df");
HeConfig.init("HE2206151627491952", "03125bfee8934cf4b640af48e8187c9d");
//切换至开发版服务
HeConfig.switchToDevService();
AmapManager.init(this);
NetInterfaceManager.init(this);
startService(new Intent(this, MainService.class));

View File

@@ -6,7 +6,6 @@ import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.ResolveInfo;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.wifi.WifiInfo;
@@ -33,7 +32,6 @@ import com.amap.api.location.AMapLocationListener;
import com.blankj.utilcode.util.NetworkUtils;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.king.view.circleprogressview.CircleProgressView;
import com.qweather.sdk.bean.base.Code;
import com.qweather.sdk.bean.base.Lang;
import com.qweather.sdk.bean.base.Unit;
@@ -43,14 +41,13 @@ import com.qweather.sdk.view.QWeather;
import com.tencent.mmkv.MMKV;
import com.uiui.aios.BuildConfig;
import com.uiui.aios.R;
import com.uiui.aios.activity.APPListActivity;
import com.uiui.aios.activity.EmergencyActivity;
import com.uiui.aios.activity.weather.WeatherActivity;
import com.uiui.aios.adapter.NotificationAdapter;
import com.uiui.aios.adapter.SOSNnmberAdapter;
import com.uiui.aios.bean.AlarmClockData;
import com.uiui.aios.bean.AlarmItem;
import com.uiui.aios.utils.AmapManager;
import com.uiui.aios.manager.AmapManager;
import com.uiui.aios.utils.ApkUtils;
import com.uiui.aios.utils.AppUtil;
import com.uiui.aios.utils.SchemeUtils;
@@ -81,7 +78,7 @@ public class CustomFragment extends Fragment implements NetworkUtils.OnNetworkSt
ConstraintLayout cl_soso;
@BindView(R.id.cl_weather)
ConstraintLayout cl_weather;
// @BindView(R.id.cl_battery)
// @BindView(R.id.cl_battery)
// ConstraintLayout cl_battery;
// @BindView(R.id.tv_add)
// TextView tv_add;
@@ -93,7 +90,7 @@ public class CustomFragment extends Fragment implements NetworkUtils.OnNetworkSt
ImageView iv_pic;
@BindView(R.id.tv_temp)
TextView tv_temp;
// @BindView(R.id.cpv)
// @BindView(R.id.cpv)
// CircleProgressView cpv;
// @BindView(R.id.iv_charging)
// ImageView iv_charging;
@@ -447,6 +444,7 @@ public class CustomFragment extends Fragment implements NetworkUtils.OnNetworkSt
private void getweather(double longitude, double latitude) {
String location = longitude + "," + latitude;
Log.e(TAG, "getweather: " + location);
/**
* 实况天气数据
* @param location 所查询的地区可通过该地区名称、ID、IP和经纬度进行查询经纬度格式经度,纬度
@@ -455,7 +453,6 @@ public class CustomFragment extends Fragment implements NetworkUtils.OnNetworkSt
* @param unit (选填)单位选择公制m或英制i默认为公制单位
* @param listener 网络访问结果回调
*/
QWeather.getWeatherNow(getActivity(), location, Lang.ZH_HANS, Unit.METRIC, new QWeather.OnResultWeatherNowListener() {
@Override
public void onError(Throwable e) {

View File

@@ -1,4 +1,4 @@
package com.uiui.aios.utils;
package com.uiui.aios.manager;
import android.annotation.SuppressLint;
import android.content.Context;
@@ -76,6 +76,7 @@ public class AmapManager {
} else {
//定位失败
Log.e(TAG, "onLocationChanged: " + "定位失败");
Log.e(TAG, "onLocationChanged: " + aMapLocation.getErrorInfo());
}
}
});