在获取access_token的时候需要一个验证码,但是验证码只出现在 点击授权后返回的游览器地址中。请问怎么获取啊
尽量详细点

解决方案 »

  1.   

    我跟你遇到的问题一样,我也在研究! java没办法获取前台的URL地址的;而且这个授权码出现在地址栏的最后六位,是个随机数;根据他的API是需要得到这6位的随机数的,在java中用来得到授权,进而可以实现不同用户发送微博功能!我和楼主坐等高手或者有过这方面的经验的!!!!!
      

  2.   

    但moto的blur可以实现qzone的验证码,不知道他们是怎么实现的
      

  3.   

    你自己集成一个java的内置浏览器,到网上找找把。 这样一切都能自己掌握。 熊猫看书就是这么做的。 
    不要用那个默认的浏览器了。你没法获取。
      

  4.   

    我给你找了一个
    http://code.google.com/p/apps-for-android/source/browse/trunk/Samples/WebViewDemo/src/com/google/android/webviewdemo/WebViewDemo.java
    package com.google.android.webviewdemo;import android.app.Activity;
    import android.os.Bundle;
    import android.os.Handler;
    import android.util.Log;
    import android.webkit.JsResult;
    import android.webkit.WebChromeClient;
    import android.webkit.WebSettings;
    import android.webkit.WebView;/**
     * Demonstrates how to embed a WebView in your activity. Also demonstrates how
     * to have javascript in the WebView call into the activity, and how the activity 
     * can invoke javascript.
     * <p>
     * In this example, clicking on the android in the WebView will result in a call into
     * the activities code in {@link DemoJavaScriptInterface#clickOnAndroid()}. This code
     * will turn around and invoke javascript using the {@link WebView#loadUrl(String)}
     * method.
     * <p>
     * Obviously all of this could have been accomplished without calling into the activity
     * and then back into javascript, but this code is intended to show how to set up the 
     * code paths for this sort of communication.
     *
     */
    public class WebViewDemo extends Activity {    private static final String LOG_TAG = "WebViewDemo";    private WebView mWebView;    private Handler mHandler = new Handler();    @Override
        public void onCreate(Bundle icicle) {
            super.onCreate(icicle);
            setContentView(R.layout.main);
            mWebView = (WebView) findViewById(R.id.webview);        WebSettings webSettings = mWebView.getSettings();
            webSettings.setSavePassword(false);
            webSettings.setSaveFormData(false);
            webSettings.setJavaScriptEnabled(true);
            webSettings.setSupportZoom(false);        mWebView.setWebChromeClient(new MyWebChromeClient());        mWebView.addJavascriptInterface(new DemoJavaScriptInterface(), "demo");        mWebView.loadUrl("file:///android_asset/demo.html");
        }    final class DemoJavaScriptInterface {        DemoJavaScriptInterface() {
            }        /**
             * This is not called on the UI thread. Post a runnable to invoke
             * loadUrl on the UI thread.
             */
            public void clickOnAndroid() {
                mHandler.post(new Runnable() {
                    public void run() {
                        mWebView.loadUrl("javascript:wave()");
                    }
                });        }
        }    /**
         * Provides a hook for calling "alert" from javascript. Useful for
         * debugging your javascript.
         */
        final class MyWebChromeClient extends WebChromeClient {
            @Override
            public boolean onJsAlert(WebView view, String url, String message, JsResult result) {
                Log.d(LOG_TAG, message);
                result.confirm();
                return true;
            }
        }
    }
      

  5.   

    这个不是说在在activity中使用webview吗,