I ve developed Android Wear App also SDK is 4.4AW. After finished that applitacion I tested on new android wear SDK that is 5.0.1 Emulator AND motorola360(with 5.0.1) then I recived this errror (Show in the below)
Message Sum:
can't resolve host
Detailed Message:
Unable to resolve host "URL": No address associated with hostname
The App works perfect on 4.4 android wear but failed on 5.0.1 (I used Android studio and there is no Error before execution , Successful Build, Crash on Emulator.)
Im certainly sure that I used internet permision as u can see :
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-feature android:name="android.hardware.type.watch" />
Glade Detail :
apply plugin: 'com.android.application'
android { compileSdkVersion 21 buildToolsVersion "21.1.1"
defaultConfig {
applicationId "com.hakyazilim.onlywear"
minSdkVersion 20
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.support:wearable:1.1.0'
compile 'com.google.android.gms:play-services-wearable:6.5.87'
compile files ('lib/android-async-http-1.4.3.jar')
}
I used "android-async-http-1.4.3.jar" Lib. Following this Code :
String requestURL = "My ASPX page (includes XML)";
asyncHttpClient.get(requestURL, new AsyncHttpResponseHandler() {
@Override
public void onSuccess(String response) {
try {
mTextView.setText(response.toString());
} catch (Exception e) {
e.printStackTrace();
Log.d(">>>>", "Part 1 Load Fail !");
}
}
public void onFailure(Throwable e, String response) {
//"EROR = can't resolve host"
}
});
Best regards