我正在使用 Android Emulator 并尝试对位于本地主机上的根文档执行 GET 请求,并允许我登录。
登录方法
* @param rootDocumentUri The Uri the login attempt is to be invoked against.
* @param loginSuccessfulCallback The callback that is called if the login attempt was successful.
* @param loginFailedCallback The callback that is called if the login attempt was not successful.
* @param timeout The length of time, in milliseconds, to wait for a response from the server.
*/
public void login(Uri rootDocumentUri, LoginCompletedListener loginSuccessfulCallback,
LoginCompletedListener loginFailedCallback, int timeout);
使用方法:
MobileBaseUri = Address for my Uri.
MobileApi.login(Uri.parse(MobileBaseUri), new LoginSuccessful(), new LoginFailed(), MobileSettings.getInstance().getHttpRequestTimeoutPeriod() );
当我尝试登录时,应用程序在 RootDocument 上执行 GET,但我得到的只是:“HttpClient(1884): org.apache.http.conn.ConnectTimeoutException: Connect to /10.0.0.8:80 timed out”
超时设置为一分钟,服务器在我的本地主机上,所以我应该被任何防火墙阻止..
有谁知道问题可能是什么?
谢谢。