2
Google은 canlender 보여줄 웹 뷰를 사용하고 있지만 프로그래밍 방식으로 Google 계정을 전달하려는, 그래서 setHttpAuthUsernamePassword() 함수는 내가 필요로해야하지만 전혀 작동하지 않습니다. 코드는 다음과 같습니다.안드로이드 어떻게 webview에 Google 계정을 전달
WebView webview = (WebView) findViewById(R.id.webview);
webview.getSettings().setJavaScriptEnabled(true);
webview.setHttpAuthUsernamePassword("www.google.com", "", "email", "password");
webview.setWebViewClient(new WebViewClient() {
@Override
public void onReceivedHttpAuthRequest (WebView view, HttpAuthHandler handler, String host,String realm){
handler.proceed("email","password");
}
}
public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
Toast.makeText(activity, description, Toast.LENGTH_SHORT).show();
}
});
webview.loadUrl("http://www.google.com/calendar/");
이 작업을 수행 할 생각이 있으면 알려주십시오. 나는 많은 것을 찾으려고 노력했지만 어떤 도움도 보이지 않는다.
구글 앱스 자바 클라이언트를 사용해도 인증을 위해 사용자 입력이 필요하기 때문에 결코 작동하지 않을 것이라고 생각합니다. 여기에서 http://code.google.com/apis/accounts/docs/AuthForInstalledApps.html을 확인하십시오. 만약 내가 .... 정정하십시오 – thanhbinh84