Benjamin wrote:
>> The first step to do that (after creating a new facebook-app on
>> facebook) is asking access to the user's informations.
>>
>> We can do that from this url
>> :http://m.facebook.com/code_gen.php?v=1.0&api_key=[your
>> api_key]
Isn't there a pure API you can use for that, perhaps tied to Facebook
Connect or some such? Instead of trying to use a WebView for this?
>> I'm having trouble with the WebView. First of all, we have to connect
>> two times to Facebook. Then, we're clicking on the "Generate" button
>> (on the facebook page), but it's still loading this page again and
>> again.
That would suggest that Facebook is not getting all the data it thinks
it should.
>> I tried it on the Chrome navigator, and it works just fine!
Other than both being affiliated with Google and having some WebKit
plumbing, Chrome and WebView are not terribly similar.
>> WebView webview;
>> webview = (WebView) findViewById(R.id.facebookview);
>> webview.getSettings().setJavaScriptEnabled(true);
>> webview.setWebViewClient(new FacebookWebViewClient());
>> webview.loadUrl("http://m.facebook.com/code_gen.php?v=1.0&api_key=
>> [my_api_key]");
>>
>> [...]
>>
>> private class FacebookWebViewClient extends WebViewClient {
>> @Override
>> public boolean shouldOverrideUrlLoading(WebView view, String
>> url) {
>> view.loadUrl(url);
>> return true;
>> }
>>
>> }
Bear in mind that HTTP POST operations may not necessarily work as you
may be expecting. I do not know if shouldOverrideUrlLoading() is invoked
for form POSTs (I have comments from one book subscriber to suggest it
does not) and, even if it does, it would appear the form data would be
lost in the call to loadUrl().
Do you know if the affected page is using an HTTP POST form to try to
move to the page, where it does not work?
--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy
Warescription: Three Android Books, Plus Updates, $35/Year
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---