I have used this code to send an mms and all parameters are correct, but the connection is refused.. And the netWork is connected on mobile mms.
HttpUtils is a class from a library downloaded here : https://github.com/android/platform_packages_apps_mms
HttpUtils.httpConnection(getApplicationContext(), 4444L, MMSCenterUrl, bytesToSendFromPDU, HttpUtils.HTTP_POST_METHOD, !TextUtils.isEmpty(MMSProxy), MMSProxy, port);
06-29 19:51:26.208: I/Log MMSCenterUrl(13071): http: //mmsnrj
06-29 19:51:26.208: I/Log MMSProxy(13071): 10.143.156.5
06-29 19:51:26.208: I/Log MMSPort(13071): 8080
06-29 19:51:26.288: E/Mms:transaction(13071): Url: http: //mmsnrj
06-29 19:51:26.288: E/Mms:transaction(13071): Connection to http: //10.143.156.5:8080 refused
Manifiest file :
<uses-permission android:name="android.permission.WRITE_SMS" />
<uses-permission android:name="android.permission.SEND_SMS"/>
<uses-permission android:name="android.permission.RECEIVE_SMS" />
<uses-permission android:name="android.permission.READ_SMS" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.VIBRATE" />
Crossing out usual suspects
Uses Internet permission in manifest file
Server is actually up.Please send a post request form the browser using Post master or any such tool
10.143.156.5 ip seems its an external system. Ensure that firewalls are not making your development life miserable. (Port forwarding or open the port on the routers)
Related
I got this message sometimes above my app in the Dashboard menu. Sometimes it is here, sometimes it is not. What the heck is going on here, my app uses the following permissions:
ACCESS_NETWORK_STATE
INTERNET
Also, I double checked it:
when I install app on phone, and check on phone => apps => permissions, there are none other permission except those listed above
So I am pretty much 100% sure I dont use these permissions, but I still see the warning. Why? It simply must be a bug or something... ? i want to contact google play support please give me a direct link to the issue, or another solution, i also make new update with those changes below
<uses-permission
android:name="android.permission.RECEIVE_SMS"
tools:node="remove" />
<uses-permission
android:name="android.permission.READ_SMS"
tools:node="remove" />
<uses-permission
android:name="android.permission.SEND_SMS"
tools:node="remove" />
<uses-permission
android:name="android.permission.WRITE_SMS"
tools:node="remove" />
<uses-permission
android:name="android.permission.RECEIVE_WAP_PUSH"
tools:node="remove" />
<uses-permission
android:name="android.permission.RECEIVE_MMS"
tools:node="remove" />
<uses-permission
android:name="android.permission.READ_CALL_LOG"
tools:node="remove" />
<uses-permission
android:name="android.permission.WRITE_CALL_LOG"
tools:node="remove" />
<uses-permission
android:name="android.permission.PROCESS_OUTGOING_CALLS"
tools:node="remove" />
I had the same issue.
For that, I had just looked into Release management -> Artifact library-> Active artifacts, it was showing me an older active version(which have permissions of SMS) in the alpha version then after I had just uploaded new latest APK file(without SMS/Call permissions) in alpha version.
Finally, they removed warning from my console.
So, Firstly you have to check out that there is no other old alpha/beta versions are in active mode. I hope it will resolve your issue.
I need to register with app on my tablet, but when I press the button "register" I get ConnectionException: Connection refused.
This is my endpoint:
public static String URL_REGISTER = "http://192.168.1.129/android_login_api/register.php";
MANIFEST:
<?xml version="1.0" encoding="utf-8"?>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
</manifest>
I don't know why it doesn't work!
Can someone help me?
I am implementing the necessary code. But when I try to submit the score I am getting this error. I tried out the solutions provided in answers to different questions, but I couldn't solve my problem.
Code:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
setupView();
beginUserInitiatedSignIn();
}
public void onClick(View v) {
switch (v.getId()) {
case R.id.play_button:
Games.Leaderboards.submitScoreImmediate(getApiClient(),
getString(R.string.leaderboard_winner),
numGuesses).setResultCallback(new myLeaderBoardSubmitScoreCallback());
numGuesses++;
break;
case R.id.bests:
startActivityForResult(Games.Leaderboards.getLeaderboardIntent(getApiClient(), getString(R.string.leaderboard_winner)), 2);
break;
}
}
Android Manifest Permisssions:
<uses-permission android:name="com.android.vending.BILLING" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" />
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />
Based from the documentation, STATUS_NETWORK_ERROR_OPERATION_FAILED error means that a network error occurred while attempting to perform an operation that requires network access. There is a possibility that you are not signed in when this error occurs. Make sure to perform some sort of check, such as getGamesClient.isConnected() or isSignedIn().
Also, maybe you are submitting a score greater than the one you have configured on the console to be the min value for that leaderboard.
I'm trying to connect to a web app running my computer from the android emulator using the apache httpClient.
HttpPost post = new HttpPost("http://dev.example.com:8443/gatekeeper/rs/authenticate/login");
post.setHeader("Content-type","application/x-www-form-urlencoded");
post.setEntity(new UrlEncodedFormEntity(formparams));
HttpClient client=new DefaultHttpClient();
response = client.execute(post);
I do have the required android manifest configuration as below
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
I did check I can access the internet from the browser on the emulator. I can not access the app URL from the browser as well. My application also fails with an error
java.net.UnknownHostException: Unable to resolve host
"dev.example.com": No address associated with hostname
My application works fine when used with IP address of my computer. I also have entry in my hosts file
192.168.1.8 dev.example.com
What can I be missing here? It looks like android emulator can't look in to my hosts file to resolve the host name!
Please check the Connectivity programitically before calling for response
or If there is no response the also this exception is thrown
Working on an Android application...
I'm getting this error message:
i/o failure: java.net.UnKnownHostException: Unable to resolve host
"api.parse.com": No address associated with hostname
Many suggest to add internet permission in the manifest file, I have these permissions already:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
Any suggestions?
Thanks!
I'm guessing that the device is
not connected to the private LAN that has
the DNS server that resolves the hostname. The emulator shares the network
connectivity of its host; not so the
real device.
The error says that the dns server the device is talking to can't resolve
the name. It may also mean we can't talk to the dns server.
You have these two entries in AndroidManifest.xml file:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
I don't think there might be other reason for that except the connection.