R.styleable,R.style和R.attr之间有什么区别?我在所有这三个类中找到了TextAppearance.
我正在尝试使用SkyDrive REST API从Java桌面客户端应用程序实现OAuth 2.0隐式授权.我使用以下代码:
Desktop.getDesktop().browse(new URL(st.toString()).toURI());
JOptionPane.showMessageDialog(null, "Press ok to continue once you have authenticated.");
Run Code Online (Sandbox Code Playgroud)
我的代码打开Web浏览器并要求用户登录,然后SkyDrive以下列形式将访问令牌发送到浏览器URL:
https://login.live.com/oauth20_desktop.srf?lc=1033#access_token=EwAwAq1DBAAUlbRW.....
Run Code Online (Sandbox Code Playgroud)
我想要做的是从我的java程序中读取此访问令牌.我试图从控制台读取httpconnection:
HttpURLConnection con = (HttpURLConnection) url.openConnection();
BufferedReader reader = new BufferedReader( new InputStreamReader(url.openStream()));
while(reader.readLine()!=null){
System.out.println(reader.readLine());
Run Code Online (Sandbox Code Playgroud)
但似乎java httpurlconnection不处理javascript响应.它回复:
<html dir="..... Windows Live ID requires JavaScript to sign in. This web browser either does not support JavaScript, or scripts are being blocked......<body onload="evt_LoginHostMobile_onload(event);">
Run Code Online (Sandbox Code Playgroud)
那么,有没有办法直接从java中检索访问令牌?