Integrating Twitter to Android: Host is unresolved: api.twitter.com:443
I am using the same SDK to integrate Twitter to my Android app as the foll开发者_高级运维owing post:
Sugree/twitter-android-sdk
And got the same error:
D/twitter ( 2233): Login failed: com.sugree.twitter.DialogError: Communication with the service provider failed: Host is unresolved: api.twitter.com:443
In above post, the OP said
Problem was with the twitter server. It started working from next day.
But I tried many days, it is still not working, and opening the link: api.twitter.com in browser does work, so I wonder what the problem is, and, if there is any other WORKING library for twitter on Android?
Thanks!
By the sounds of this I think you've not added the Internet permission to the AndroidManifest.xml
file yet.
You should add the following line before your application can make requests:
<uses-permission android:name="android.permission.INTERNET" />
If this is not the case and it is the Java library, maybe you can try Twitter4J. This library is used in many Android applications.
It definitely sounds like you are having problems connecting to the web - are you able to connect other apps on your emulator to the web? When I have problems with an internet connection through the emulator it shows up with no signal (e.g. there are no bars in the signal indicator and a little x by it). Have you been able to connect this app/other apps to the web on the emulator before?
Piro is right with Twitter4J - its a nice library that makes twitter integration on any java platform really easy. there is a simple tutorial here, and a more complex one covering the OAuth integration here
精彩评论