version:2.1
fix:修复地图失败,修复获取天气失败 update:
This commit is contained in:
@@ -2,7 +2,7 @@ apply plugin: 'com.android.application'
|
|||||||
apply plugin: "com.tencent.android.tpns"
|
apply plugin: "com.tencent.android.tpns"
|
||||||
|
|
||||||
def appName() {
|
def appName() {
|
||||||
return "桌面"
|
return "老人桌面"
|
||||||
}
|
}
|
||||||
|
|
||||||
def releaseTime() {
|
def releaseTime() {
|
||||||
@@ -16,8 +16,8 @@ android {
|
|||||||
applicationId "com.uiui.aios"
|
applicationId "com.uiui.aios"
|
||||||
minSdkVersion 24
|
minSdkVersion 24
|
||||||
targetSdkVersion 29
|
targetSdkVersion 29
|
||||||
versionCode 11
|
versionCode 12
|
||||||
versionName "2.0"
|
versionName "2.1"
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
|
|
||||||
@@ -31,6 +31,10 @@ android {
|
|||||||
XG_ACCESS_ID : "1500030457",
|
XG_ACCESS_ID : "1500030457",
|
||||||
XG_ACCESS_KEY : "AZZXANJF4HBD",
|
XG_ACCESS_KEY : "AZZXANJF4HBD",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
manifestPlaceholders = [
|
||||||
|
AMAP_KEY: "ff08045221483b649cc41e77ee2ad941"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
lintOptions {
|
lintOptions {
|
||||||
@@ -76,27 +80,19 @@ android {
|
|||||||
buildTypes {
|
buildTypes {
|
||||||
zhanRuiRelease.initWith(release)
|
zhanRuiRelease.initWith(release)
|
||||||
zhanRuiRelease {
|
zhanRuiRelease {
|
||||||
manifestPlaceholders = [
|
|
||||||
AMAP_KEY: "70f37634f84b00c5c7347c545bc2a3b9"
|
|
||||||
]
|
|
||||||
buildConfigField "boolean", "LOG_DEBUG", "false"
|
buildConfigField "boolean", "LOG_DEBUG", "false"
|
||||||
signingConfig signingConfigs.zhanRui
|
signingConfig signingConfigs.zhanRui
|
||||||
}
|
}
|
||||||
|
|
||||||
zhanRuiDebug.initWith(debug)
|
zhanRuiDebug.initWith(debug)
|
||||||
zhanRuiDebug {
|
zhanRuiDebug {
|
||||||
manifestPlaceholders = [
|
|
||||||
AMAP_KEY: "70f37634f84b00c5c7347c545bc2a3b9"
|
|
||||||
]
|
|
||||||
buildConfigField "boolean", "LOG_DEBUG", "true"
|
buildConfigField "boolean", "LOG_DEBUG", "true"
|
||||||
versionNameSuffix "-debug"
|
versionNameSuffix "-debug"
|
||||||
debuggable true
|
debuggable true
|
||||||
signingConfig signingConfigs.zhanRui
|
signingConfig signingConfigs.zhanRui
|
||||||
}
|
}
|
||||||
debug {
|
debug {
|
||||||
manifestPlaceholders = [
|
|
||||||
AMAP_KEY: "e7c2b3cb84ca7ac4100b1ffceb3d5685"
|
|
||||||
]
|
|
||||||
// 显示Log
|
// 显示Log
|
||||||
buildConfigField "boolean", "LOG_DEBUG", "true"
|
buildConfigField "boolean", "LOG_DEBUG", "true"
|
||||||
versionNameSuffix "-debug"
|
versionNameSuffix "-debug"
|
||||||
@@ -114,9 +110,6 @@ android {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
release {
|
release {
|
||||||
manifestPlaceholders = [
|
|
||||||
AMAP_KEY: "e7c2b3cb84ca7ac4100b1ffceb3d5685"
|
|
||||||
]
|
|
||||||
// 不显示Log
|
// 不显示Log
|
||||||
buildConfigField "boolean", "LOG_DEBUG", "false"
|
buildConfigField "boolean", "LOG_DEBUG", "false"
|
||||||
//混淆
|
//混淆
|
||||||
@@ -147,7 +140,7 @@ android {
|
|||||||
dependencies {
|
dependencies {
|
||||||
// implementation fileTree(dir: 'libs', include: ['*.jar'])
|
// implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
compileOnly files('libs/framework.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 更新会报错
|
//保持1.3.1 更新会报错
|
||||||
implementation 'androidx.appcompat:appcompat:1.3.1'
|
implementation 'androidx.appcompat:appcompat:1.3.1'
|
||||||
//2.0.4以上无法预览
|
//2.0.4以上无法预览
|
||||||
@@ -176,7 +169,7 @@ dependencies {
|
|||||||
implementation "com.squareup.retrofit2:adapter-rxjava3:2.9.0"
|
implementation "com.squareup.retrofit2:adapter-rxjava3:2.9.0"
|
||||||
//Gson
|
//Gson
|
||||||
implementation 'com.google.code.gson:gson:2.9.0'
|
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:4.0.2'
|
||||||
implementation 'com.trello.rxlifecycle4:rxlifecycle-android: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'
|
implementation 'com.amap.api:location:5.1.0'
|
||||||
//MMKV
|
//MMKV
|
||||||
implementation 'com.tencent:mmkv-static:1.2.12'
|
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'
|
implementation 'com.gitee.zackratos:UltimateBarX:0.8.0'
|
||||||
//指示器
|
//指示器
|
||||||
|
|||||||
Binary file not shown.
BIN
app/libs/QWeather_Public_Android_V4.9.jar
Normal file
BIN
app/libs/QWeather_Public_Android_V4.9.jar
Normal file
Binary file not shown.
@@ -12,7 +12,7 @@ import com.qweather.sdk.bean.weather.WeatherDailyBean;
|
|||||||
import com.qweather.sdk.view.QWeather;
|
import com.qweather.sdk.view.QWeather;
|
||||||
import com.tencent.mmkv.MMKV;
|
import com.tencent.mmkv.MMKV;
|
||||||
import com.trello.rxlifecycle4.android.ActivityEvent;
|
import com.trello.rxlifecycle4.android.ActivityEvent;
|
||||||
import com.uiui.aios.utils.AmapManager;
|
import com.uiui.aios.manager.AmapManager;
|
||||||
|
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import com.uiui.aios.BuildConfig;
|
|||||||
import com.uiui.aios.network.NetInterfaceManager;
|
import com.uiui.aios.network.NetInterfaceManager;
|
||||||
import com.uiui.aios.service.main.MainService;
|
import com.uiui.aios.service.main.MainService;
|
||||||
import com.uiui.aios.utils.AlarmUtils;
|
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.AppUsedTimeUtils;
|
||||||
import com.uiui.aios.utils.Utils;
|
import com.uiui.aios.utils.Utils;
|
||||||
|
|
||||||
@@ -61,7 +61,9 @@ public class BaseApplication extends Application {
|
|||||||
tpushInit();
|
tpushInit();
|
||||||
AppUsedTimeUtils.init(this);
|
AppUsedTimeUtils.init(this);
|
||||||
AlarmUtils.init(this);
|
AlarmUtils.init(this);
|
||||||
HeConfig.init("HE2111041506381545", "32b5ec69545e44119583a5e0ed4e87df");
|
HeConfig.init("HE2206151627491952", "03125bfee8934cf4b640af48e8187c9d");
|
||||||
|
//切换至开发版服务
|
||||||
|
HeConfig.switchToDevService();
|
||||||
AmapManager.init(this);
|
AmapManager.init(this);
|
||||||
NetInterfaceManager.init(this);
|
NetInterfaceManager.init(this);
|
||||||
startService(new Intent(this, MainService.class));
|
startService(new Intent(this, MainService.class));
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import android.content.ContentResolver;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.IntentFilter;
|
import android.content.IntentFilter;
|
||||||
import android.content.pm.ResolveInfo;
|
|
||||||
import android.net.ConnectivityManager;
|
import android.net.ConnectivityManager;
|
||||||
import android.net.NetworkInfo;
|
import android.net.NetworkInfo;
|
||||||
import android.net.wifi.WifiInfo;
|
import android.net.wifi.WifiInfo;
|
||||||
@@ -33,7 +32,6 @@ import com.amap.api.location.AMapLocationListener;
|
|||||||
import com.blankj.utilcode.util.NetworkUtils;
|
import com.blankj.utilcode.util.NetworkUtils;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.reflect.TypeToken;
|
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.Code;
|
||||||
import com.qweather.sdk.bean.base.Lang;
|
import com.qweather.sdk.bean.base.Lang;
|
||||||
import com.qweather.sdk.bean.base.Unit;
|
import com.qweather.sdk.bean.base.Unit;
|
||||||
@@ -43,14 +41,13 @@ import com.qweather.sdk.view.QWeather;
|
|||||||
import com.tencent.mmkv.MMKV;
|
import com.tencent.mmkv.MMKV;
|
||||||
import com.uiui.aios.BuildConfig;
|
import com.uiui.aios.BuildConfig;
|
||||||
import com.uiui.aios.R;
|
import com.uiui.aios.R;
|
||||||
import com.uiui.aios.activity.APPListActivity;
|
|
||||||
import com.uiui.aios.activity.EmergencyActivity;
|
import com.uiui.aios.activity.EmergencyActivity;
|
||||||
import com.uiui.aios.activity.weather.WeatherActivity;
|
import com.uiui.aios.activity.weather.WeatherActivity;
|
||||||
import com.uiui.aios.adapter.NotificationAdapter;
|
import com.uiui.aios.adapter.NotificationAdapter;
|
||||||
import com.uiui.aios.adapter.SOSNnmberAdapter;
|
import com.uiui.aios.adapter.SOSNnmberAdapter;
|
||||||
import com.uiui.aios.bean.AlarmClockData;
|
import com.uiui.aios.bean.AlarmClockData;
|
||||||
import com.uiui.aios.bean.AlarmItem;
|
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.ApkUtils;
|
||||||
import com.uiui.aios.utils.AppUtil;
|
import com.uiui.aios.utils.AppUtil;
|
||||||
import com.uiui.aios.utils.SchemeUtils;
|
import com.uiui.aios.utils.SchemeUtils;
|
||||||
@@ -81,7 +78,7 @@ public class CustomFragment extends Fragment implements NetworkUtils.OnNetworkSt
|
|||||||
ConstraintLayout cl_soso;
|
ConstraintLayout cl_soso;
|
||||||
@BindView(R.id.cl_weather)
|
@BindView(R.id.cl_weather)
|
||||||
ConstraintLayout cl_weather;
|
ConstraintLayout cl_weather;
|
||||||
// @BindView(R.id.cl_battery)
|
// @BindView(R.id.cl_battery)
|
||||||
// ConstraintLayout cl_battery;
|
// ConstraintLayout cl_battery;
|
||||||
// @BindView(R.id.tv_add)
|
// @BindView(R.id.tv_add)
|
||||||
// TextView tv_add;
|
// TextView tv_add;
|
||||||
@@ -93,7 +90,7 @@ public class CustomFragment extends Fragment implements NetworkUtils.OnNetworkSt
|
|||||||
ImageView iv_pic;
|
ImageView iv_pic;
|
||||||
@BindView(R.id.tv_temp)
|
@BindView(R.id.tv_temp)
|
||||||
TextView tv_temp;
|
TextView tv_temp;
|
||||||
// @BindView(R.id.cpv)
|
// @BindView(R.id.cpv)
|
||||||
// CircleProgressView cpv;
|
// CircleProgressView cpv;
|
||||||
// @BindView(R.id.iv_charging)
|
// @BindView(R.id.iv_charging)
|
||||||
// ImageView iv_charging;
|
// ImageView iv_charging;
|
||||||
@@ -447,6 +444,7 @@ public class CustomFragment extends Fragment implements NetworkUtils.OnNetworkSt
|
|||||||
|
|
||||||
private void getweather(double longitude, double latitude) {
|
private void getweather(double longitude, double latitude) {
|
||||||
String location = longitude + "," + latitude;
|
String location = longitude + "," + latitude;
|
||||||
|
Log.e(TAG, "getweather: " + location);
|
||||||
/**
|
/**
|
||||||
* 实况天气数据
|
* 实况天气数据
|
||||||
* @param location 所查询的地区,可通过该地区名称、ID、IP和经纬度进行查询经纬度格式:经度,纬度
|
* @param location 所查询的地区,可通过该地区名称、ID、IP和经纬度进行查询经纬度格式:经度,纬度
|
||||||
@@ -455,7 +453,6 @@ public class CustomFragment extends Fragment implements NetworkUtils.OnNetworkSt
|
|||||||
* @param unit (选填)单位选择,公制(m)或英制(i),默认为公制单位
|
* @param unit (选填)单位选择,公制(m)或英制(i),默认为公制单位
|
||||||
* @param listener 网络访问结果回调
|
* @param listener 网络访问结果回调
|
||||||
*/
|
*/
|
||||||
|
|
||||||
QWeather.getWeatherNow(getActivity(), location, Lang.ZH_HANS, Unit.METRIC, new QWeather.OnResultWeatherNowListener() {
|
QWeather.getWeatherNow(getActivity(), location, Lang.ZH_HANS, Unit.METRIC, new QWeather.OnResultWeatherNowListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onError(Throwable e) {
|
public void onError(Throwable e) {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.uiui.aios.utils;
|
package com.uiui.aios.manager;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@@ -76,6 +76,7 @@ public class AmapManager {
|
|||||||
} else {
|
} else {
|
||||||
//定位失败
|
//定位失败
|
||||||
Log.e(TAG, "onLocationChanged: " + "定位失败");
|
Log.e(TAG, "onLocationChanged: " + "定位失败");
|
||||||
|
Log.e(TAG, "onLocationChanged: " + aMapLocation.getErrorInfo());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
Reference in New Issue
Block a user