Accessing mobile twitter site with Android Childbrowser

135 views
Skip to first unread message

Allister

unread,
May 17, 2012, 10:49:13 AM5/17/12
to phonegap
Has anyone managed to get this to work. Whilst my Childbrowser works
fine for any other url, for some reason it doesn't like twitter. Does
anyone know why, or have a solution?
allister

Rui Gomes

unread,
May 17, 2012, 11:14:28 AM5/17/12
to phon...@googlegroups.com
Hi
What platform are you trying this on? Android? If so, what version?

Rui

Petar Kadakevliev

unread,
May 17, 2012, 11:29:33 AM5/17/12
to phonegap
Hi,

Take a look at this, it works for me, and I think it's what you're
asking for :)

http://www.wisejive.com/2010/11/phonegap-jquery-mobile-twitter-and.html

Regards,
Petar

Simon MacDonald

unread,
May 17, 2012, 12:54:56 PM5/17/12
to phon...@googlegroups.com
Hey Allister,

If you are on Android you may want to grab the latest code from
Github. I did some updates recently and I can see the twitter page
just fine.

Simon Mac Donald
http://hi.im/simonmacdonald
> --
> You received this message because you are subscribed to the Google
> Groups "phonegap" group.
> To post to this group, send email to phon...@googlegroups.com
> To unsubscribe from this group, send email to
> phonegap+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/phonegap?hl=en?hl=en
>
> For more info on PhoneGap or to download the code go to www.phonegap.com

madhu

unread,
May 18, 2012, 12:52:51 AM5/18/12
to phon...@googlegroups.com
Am trying for android 2.2 and above

--
You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to
phonegap+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com



--
MADHULATHA

Allister

unread,
May 18, 2012, 6:05:42 AM5/18/12
to phonegap
Thanks folks!

I'll try the latest code and keep my finger crossed!
Allister

On May 17, 5:54 pm, Simon MacDonald <simon.macdon...@gmail.com> wrote:
> Hey Allister,
>
> If you are on Android you may want to grab the latest code from
> Github. I did some updates recently and I can see the twitter page
> just fine.
>
> Simon Mac Donaldhttp://hi.im/simonmacdonald

Allister

unread,
May 18, 2012, 6:22:59 AM5/18/12
to phonegap
OK - bit of a disaster in that I replaced the java and js files but,
in eclipse, errors all over the place now.

I'm on phonegap 1.3. It's always unclear which plugins to use as there
seem to be versions with cordova and versions with phonegap that are
both being maintained. Where would I find the childbrowser version you
describe that would work for me? And can I just exchange files or do I
need to start over?

allister

Simon MacDonald

unread,
May 18, 2012, 9:42:50 AM5/18/12
to phon...@googlegroups.com
Doh! Didn't realize you were on 1.3. Do you have a copy of the
ChildBrowser code you were using in 1.3? If so I can point you to some
lines you'll need to add.

Simon Mac Donald
http://hi.im/simonmacdonald


Allister

unread,
May 18, 2012, 4:09:14 PM5/18/12
to phonegap
Yep - I have the files. Point way! ; )

On May 18, 2:42 pm, Simon MacDonald <simon.macdon...@gmail.com> wrote:
> Doh! Didn't realize you were on 1.3. Do you have a copy of the
> ChildBrowser code you were using in 1.3? If so I can point you to some
> lines you'll need to add.
>
> Simon Mac Donaldhttp://hi.im/simonmacdonald

Simon MacDonald

unread,
May 18, 2012, 4:14:54 PM5/18/12
to phon...@googlegroups.com
Look for:

webview = new WebView(ctx);
webview.getSettings().setJavaScriptEnabled(true);

and make it:

webview = new WebView(ctx);
webview.setWebChromeClient(new WebChromeClient());
webview.getSettings().setJavaScriptEnabled(true);

and with some luck that'll do it.

Simon Mac Donald
http://hi.im/simonmacdonald

Allister

unread,
May 18, 2012, 4:19:50 PM5/18/12
to phonegap
In the js file?

On May 18, 9:14 pm, Simon MacDonald <simon.macdon...@gmail.com> wrote:
> Look for:
>
>                 webview = new WebView(ctx);
>                 webview.getSettings().setJavaScriptEnabled(true);
>
> and make it:
>
>                 webview = new WebView(ctx);
>                 webview.setWebChromeClient(new WebChromeClient());
>                 webview.getSettings().setJavaScriptEnabled(true);
>
> and with some luck that'll do it.
>

Simon MacDonald

unread,
May 18, 2012, 4:22:55 PM5/18/12
to phon...@googlegroups.com
java

Simon Mac Donald
http://hi.im/simonmacdonald

Allister

unread,
May 19, 2012, 4:10:13 AM5/19/12
to phonegap
getting an error with the following line
webview.setWebChromeClient(new WebChromeClient());

WebChromeClient cannot be resolved to a type

Eclipse suggests some fixes, but am loath to do something that I'm not
sure of the impact. Maybe you could advise?

allister

On May 18, 9:22 pm, Simon MacDonald <simon.macdon...@gmail.com> wrote:
> java

Simon MacDonald

unread,
May 19, 2012, 11:22:23 AM5/19/12
to phon...@googlegroups.com
You need to do the quick fix that says "import android.webkit.WebChromeClient".

Simon Mac Donald
http://hi.im/simonmacdonald


Allister

unread,
May 21, 2012, 3:03:05 AM5/21/12
to phonegap
No joy, I'm afraid Simon.

The java resolved itself properly after the above import, and the
project runs fine. However, it still hasn't solved the issue of being
unable to open the mobile twitter url through a childbrowser.

As I said, I'm using phonegap1.3 and the android plugin files that
came around june last year. I did try cordova, but, with couldn't get
the childbrowser plugin to work.

If there is a know release of the phonegap childbrowser plugin that is
tried and tested and you know will work with a mobile twitter url,
would it be possible to find that online somewhere that I can try - or
is there a cordova release of phongap and cordova plugins that might
work in this scenario?


Thanks
Allister

On May 19, 4:22 pm, Simon MacDonald <simon.macdon...@gmail.com> wrote:
> You need to do the quick fix that says "import android.webkit.WebChromeClient".
>
> Simon Mac Donaldhttp://hi.im/simonmacdonald
> >> >> >> >> > > fine for any other url, for some reason it doesn't liketwitter. Does

Simon MacDonald

unread,
May 21, 2012, 10:02:39 AM5/21/12
to phon...@googlegroups.com
Can you pull together a small project using PG 1.3 and the
ChildBrowser.java you use and send it to me? I'll fix it up and post
the code change for anyone else having this problem on pre 1.5 PG.

Thanks...

Simon Mac Donald
http://hi.im/simonmacdonald


Allister

unread,
May 21, 2012, 11:06:07 AM5/21/12
to phonegap
yep - will do.

I did just discover that whilst
window.plugins.childBrowser.showWebPage("http://twitter.com/#!/
teenstreetde", { showLocationBar: true });
will not open mobile twitter when the site realises it's being viewed
with a mobile browser,

window.plugins.childBrowser.openExternal("http://twitter.com/#!/
teenstreetde");
does open the mobile version of the site, but without any option to
close the browser.

allister

On May 21, 3:02 pm, Simon MacDonald <simon.macdon...@gmail.com> wrote:
> Can you pull together a small project using PG 1.3 and the
> ChildBrowser.java you use and send it to me? I'll fix it up and post
> the code change for anyone else having this problem on pre 1.5 PG.
>
> Thanks...
>
> Simon Mac Donaldhttp://hi.im/simonmacdonald
>
>
>
>
>
>
>
> On Mon, May 21, 2012 at 3:03 AM, Allister <allister.fug...@om.org> wrote:
> > No joy, I'm afraid Simon.
>
> > The java resolved itself properly after the above import, and the
> > project runs fine. However, it still hasn't solved the issue of being
> > unable to open the mobiletwitterurl through a childbrowser.
Reply all
Reply to author
Forward
0 new messages