Is it possible to create your own WebView and make PhoneGap work on it on Android?

640 views
Skip to first unread message

Junya Ishihara

unread,
Feb 9, 2012, 5:29:23 AM2/9/12
to phonegap
Is it possible to create your own WebView(not the one that DroidGap
provides) and make PhoneGap work on it on Android?

I have an existing Android project which has my own WebView. I want to
extend that WebView so that PhoneGap can be used on it.

What I want to do is similar to:

Cleavage
http://blogs.nitobi.com/jesse/2010/04/20/introducing-iphone-cleavage/

but on Android.

I tried the following code, but PhoneGap did now work and got
java.lang.NullPointerException at com.phonegap.DroidGap
$1$1.run(DroidGap.java:479)

Any help, advice, hint is appreciated.

===

import android.app.Activity;
import android.os.Bundle;
import com.phonegap.*;
import android.webkit.WebView;

public class MyWebViewActivity extends DroidGap {
private WebView webView;

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.my_web_view_activity);
webView = (WebView) findViewById(R.id.web_view);

appView = webView;

super.loadUrl("file:///android_asset/www/index.html");
}
}

Simon MacDonald

unread,
Feb 9, 2012, 6:48:10 AM2/9/12
to phon...@googlegroups.com
That type of functionality is being worked on for the 1.5 release.

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

Junya Ishihara

unread,
Feb 9, 2012, 11:40:41 AM2/9/12
to phonegap
When will 1.5 be released?

On Feb 9, 8:48 pm, Simon MacDonald <simon.macdon...@gmail.com> wrote:
> That type of functionality is being worked on for the 1.5 release.
>
> Simon Mac Donaldhttp://hi.im/simonmacdonald

Simon MacDonald

unread,
Feb 9, 2012, 12:21:16 PM2/9/12
to phon...@googlegroups.com
Late February or early March is the current target. 

Bryan Stern

unread,
Apr 11, 2012, 5:42:11 PM4/11/12
to phon...@googlegroups.com
Hi Simon,

Any update on this? I'm going through the documentation and I'm not seeing any mention of this feature.

Best Regards,
Bryan

> > 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 towww.phonegap.com

--
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

Simon MacDonald

unread,
Apr 11, 2012, 10:27:03 PM4/11/12
to phon...@googlegroups.com
Joe continues to work on it. We got tied up with the Cordova rename
and common JS code. I believe there will be more focus on it for
1.7/1.8.

>>> > > 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
>>> > > towww.phonegap.com
>>>
>>> --
>>> 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
>>
>>

> --
> 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

Collin Forrester

unread,
May 17, 2012, 3:57:02 PM5/17/12
to phon...@googlegroups.com
I know the last update was only about a month ago, but I'm following this closely as we currently have an app with a webView, and we'd like to expose the PhoneGap functionality.  Right now it's not possible without heavy modifications to DroidGap.java.

Any updates?


>>> > > 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
>>> > > towww.phonegap.com
>>>
>>> --
>>> 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


>>> 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
>>
>>
> --
> 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

elsigh

unread,
May 17, 2012, 4:04:30 PM5/17/12
to phon...@googlegroups.com
Out of curiosity, does your custom web view achieve any better performance on Android in any magic way?

Signed,
DesperateForBettaDroidPerf =)

Collin Forrester

unread,
May 17, 2012, 4:07:41 PM5/17/12
to phon...@googlegroups.com
Sadly, no.  Our customers wanted some additional functionality (menu bar, logos, etc).  I'm trying to do the same thing in iOS too.

jcesarmobile

unread,
May 18, 2012, 8:50:39 AM5/18/12
to phon...@googlegroups.com
In iOs it's possible, I have just used it that way, on the phonegap installer you have a HOWTO. (using phonegap as a component.pdf)

Collin Forrester

unread,
May 18, 2012, 8:54:01 AM5/18/12
to phon...@googlegroups.com
That's good news... I think I have tried following those steps before but kept getting caught up.  Did you add components via and .xib file or in code?

Simon MacDonald

unread,
May 18, 2012, 8:53:33 AM5/18/12
to phon...@googlegroups.com
Hey Collin,

It is still being worked on but it is not quite ready yet.

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


>>>> >>> > > 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
>>>> >>> > > towww.phonegap.com
>>>> >>>
>>>> >>> --
>>>> >>> 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
>>>> >>
>>>> >>
>>>> > --
>>>> > 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
>
> --
> 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

Collin Forrester

unread,
May 18, 2012, 8:56:10 AM5/18/12
to phon...@googlegroups.com
@Simon,  thanks!  
>>>> >>> > > phonegap+unsubscribe@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
>>>> >>> > > towww.phonegap.com
>>>> >>>
>>>> >>> --
>>>> >>> 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+unsubscribe@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
>>>> >>
>>>> >>
>>>> > --
>>>> > 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+unsubscribe@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
>
> --
> 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+unsubscribe@googlegroups.com

Bryce Curtis

unread,
May 18, 2012, 2:06:18 PM5/18/12
to phon...@googlegroups.com
The CordovaWebView work is happening in the Android git branch
https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-android.git;a=shortlog;h=refs/heads/CordovaWebView
>> >>>> >>> > > 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
>> >>>> >>> > > towww.phonegap.com
>> >>>> >>>
>> >>>> >>> --
>> >>>> >>> 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
>> >>>> >>
>> >>>> >>
>> >>>> > --
>> >>>> > 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
>> >
>> > --
>> > 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
>
> --
> 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
Reply all
Reply to author
Forward
0 new messages