![](/img/trans.png)
[英]Detection error with Azure Cognitive Services: Unable to resolve host “centralus.api.cognitive.microsoft.com”
[英]Error on calling Microsoft Azure API
字符串api =“ notificationregistration?handle =” + libFile.getDeviceToken();
mClient.invokeApi(api, null, "POST", null, new ApiJsonOperationCallback()
{
@Override
public void onCompleted(JsonElement jsonElement, Exception e, ServiceFilterResponse serviceFilterResponse)
{
if(e == null)
{
try
{
String registrationId = jsonElement.toString().replaceAll("\"","");
if(AppConstants.DEBUG) Log.v(AppConstants.DEBUG_TAG, "NOTIFICATION REGISTRATION ID : "+registrationId);
}
catch (Exception e1)
{
e1.printStackTrace();
}
}
else
{
e.printStackTrace();
}
}
});
错误:
Setting airplane_mode_on has moved from android.provider.Settings.System to android.provider.Settings.Global, returning read-only value.
at com.microsoft.windowsazure.mobileservices.http.MobileServiceConnection$1.onNext(MobileServiceConnection.java:128)
at com.microsoft.windowsazure.mobileservices.MobileServiceClient$15.handleRequest(MobileServiceClient.java:1499)
at com.microsoft.windowsazure.mobileservices.http.MobileServiceConnection.start(MobileServiceConnection.java:113)
at com.microsoft.windowsazure.mobileservices.http.RequestAsyncTask.doInBackground(RequestAsyncTask.java:78)
at com.microsoft.windowsazure.mobileservices.http.RequestAsyncTask.doInBackground(RequestAsyncTask.java:35)
at android.os.AsyncTask$2.call(AsyncTask.java:292)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)
您的代码中有任何明显的问题。 仅根据错误信息,它似乎已在Android设备上启用飞行模式。 是吗 请检查并重试。
或某些第三方库可能会引起此问题,例如另一个SO线程为什么当我的应用程序与此无关时,为什么我将“ Settingplane_mode_on已从android.provider.Settings.System [...]移到了logcat中?” 制作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.