- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我有一些关于 android 7.0.0 的问题。
我在我的应用程序中使用了 volley 库,它在 Android 7.0 之外运行良好
这是我的部分代码;
String url_goster = "http://185.126.217.71/clog.php";
RequestQueue requestQueue;
StringRequest request= new StringRequest(Request.Method.POST, url_goster, new Response.Listener<String>() {
@Override
public void onResponse(String response) {
JSONObject veri_json;
try {
veri_json = new JSONObject(response);
JSONArray serial_no = veri_json.getJSONArray("Bilgiler");
for (int i = 0; i< serial_no.length(); i++){
JSONObject bilgis = serial_no.getJSONObject(i);
// JSON olarak verileri çekiyoruz
String GELEN_SERIAL = bilgis.getString("GELEN_SERIAL");
String TERMINAL_ADI = bilgis.getString("TERMINAL_ADI");
String SICAKLIK_T1 = bilgis.getString("SICAKLIK_T1");
String SICAKLIK_T2 = bilgis.getString("SICAKLIK_T2");
String SICAKLIK_T3 = bilgis.getString("SICAKLIK_T3");
String SON_DATA = bilgis.getString("SON_DATA");
String NEM_H1 = bilgis.getString("NEM_H1");
String NEM_H2 = bilgis.getString("NEM_H2");
String NEM_H3 = bilgis.getString("NEM_H3");
String SENSOR_1_AD = bilgis.getString("SENSOR_1_AD");
String SENSOR_2_AD = bilgis.getString("SENSOR_2_AD");
String SENSOR_3_AD = bilgis.getString("SENSOR_3_AD");
int SENSOR_SAYISI = bilgis.getInt("SENSOR_SAYISI");
kisiler.add(new Kisi(TERMINAL_ADI, SON_DATA, SENSOR_1_AD, SENSOR_2_AD, SENSOR_3_AD, SICAKLIK_T1, SICAKLIK_T2, SICAKLIK_T3, NEM_H1, NEM_H2, NEM_H3, GELEN_SERIAL, SENSOR_SAYISI));
}
} catch (JSONException e) {
Log.e("JSON ALIRKEN HATA",e.getLocalizedMessage());
Toast.makeText(getApplicationContext(), "Server'a bağlanılırken bir hata ile karşılaşıldı.", Toast.LENGTH_SHORT).show();
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
}
}){
@Override
protected Map<String, String> getParams() throws AuthFailureError {
Map<String,String> params = new HashMap<String,String>();
params.put("ad",USER);
return params;
}
};
requestQueue.add(request);
}
如果我在 Android 7.0 上测试我的应用程序,控制台的输出是;
D/NetworkSecurityConfig: No Network Security Config specified, using platform default I/Choreographer: Skipped 127 frames! The application may be doing too much work on its main thread.
但这只发生在 Android 7.0 上,应用程序看起来是空白的,因为它没有从互联网上得到响应
.我该如何解决这个问题?
最佳答案
这条消息没有问题:
D/NetworkSecurityConfig: No Network Security Config specified, using platform default
D/
表示这是一条调试消息。它表示您没有定义自己的网络安全配置,因此平台默认规则适用。这很好。
application looks empty because it does not response from the internet
据我所知,您正在解析一些 JSON,对其进行迭代,然后填充 kisiler
。也许 kisiler
没有连接到您的 UI。
关于java - NetworkSecurityConfig : No Network Security Config specified -- Android 7. 0 错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41365334/
我已经搜索过这个问题,但无法解决该问题我在 android 8 中有互联网,但在 android 9 中没有任何连接 usesCleartextTraffic=true >> 未解决 NetworkS
我们从特定的 flavor 交付发布 apk 构建( QA ) 给我们的质量检查团队。 我想添加 networkSecurityConfig只有那个flavor . 为此,我需要将下一个配置添加到 l
注意:这是a followup question .我试图在 react native 应用程序的 android list 中允许 http 流量。 如解释here ,我创建了一个 xml 文件:
在我的应用程序中,我使用以下内容设置网络安全配置文件: 我在 list 中这样设置: 此外,我添加了一个第
正如我在这个 article 中发现的那样. 我想更新我的网络安全配置以允许来 self 的 android 模拟器的个人商店的根证书。但是当我这样做时,我不能再构建我的应用程序了。错误信息: Una
我正在尝试连接到这些地方中的任何一个并获取 JSON 数据:- https://content.guardianapis.com/search?q=debate&tag=politics/politi
正如标题所示,尽管在 android list 文件以及网络配置安全文件中添加了所有必要的更改,但 volley 仍会抛出“不允许明文 http 流量”的错误。我正在 android studio 中
我有一些关于 android 7.0.0 的问题。 我在我的应用程序中使用了 volley 库,它在 Android 7.0 之外运行良好 这是我的部分代码; String url_goster =
我正在使用下载管理器从 Internet 下载文件。在Android 6、8.1下下载成功,在Android 9.0上下载失败 DownloadManager.Request request = ne
将设备操作系统更新到 Android 9.0 时,之前此代码运行良好(小米 A2)。现在,Android Pie 9.0 上无法下载文件。 此外,它在奥利奥、牛轧糖、棉花糖中运行良好 这是代码 fra
我是一名优秀的程序员,十分优秀!