Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Android™ Runtime Development

Reply
New Contributor
aquinzain
Posts: 3
Registered: ‎02-18-2013
My Device: Z10
My Carrier: Orange

Re: Google Maps in webview

Ok thanks for your reply, that could be a temp fix for this issue.

Can you explain a bit more with a code sample how you detect the error to reload the webview ?

 

Regards,

Antoine

Please use plain text.
New Contributor
Michae_T_Kelly
Posts: 5
Registered: ‎07-06-2010
My Device: Curve 8530
My Carrier: Verizon

Re: Google Maps in webview

I have a custom WebChromeClient:

 

public class MyWebChromeClient extends WebChromeClient

{

 

    // Other methods implemented as needed

 

    @Override

    public boolean onConsoleMessage( ConsoleMessage message)

    {

        if ( message == null )

        {

            return super.onConsoleMessage( message );

        }

 

        String messageString = message.message();

 

        if ( messageString != null )

        {

            if ( messageString.contains( "Uncaught TypeError" ) )

            {

                if ( this.mCallback != null )

                {

                    this.mCallback.blackBerry10Error();

                }

            }

        }

    }

}

 

mCallback is a special interface that the fragment implements that allows it to register to the custom WebChromeClient.  Implementation of this is straightforward.  The final piece is in the blackBerry10Error method in the fragment:

 

@Override

public void blackBerry10Error()

{

    if ( this.mWebView != null )

    {

        this.mWebView.reload();

    }

}

 

As I said, very hackish, but it gets the webview to keep reloading until it actually gets it right.

Please use plain text.
Regular Contributor
_NishantShah
Posts: 76
Registered: ‎07-31-2012
My Device: Blackberry
My Carrier: Vodafone

Re: Google Maps in webview

Thanks guys, it works pretty fine.

 

Regards,

Nishant Shah

Please use plain text.
New Member
yangxi
Posts: 1
Registered: ‎05-23-2013
My Device: I am a android developer
My Carrier: I am a android developer

Re: Google Maps in webview

hello,

I am porting an existing android application on the new backberry 10 OS , I am stucked by the google map,I want to add multiple markers on the google map, and add click event on the marker,I have tried to use the google map JavaScript V3 in the app, the app crashed when run on the blackberry 10 device,but it is normal when run on the android 2.3 and up.I need your help,look forward to your reply.

Please use plain text.
Developer
sujachristy
Posts: 63
Registered: ‎12-10-2012
My Device: Blackberry 9900
My Carrier: Vodafone-in

Re: Google Maps in webview

It must be problem with maps key I think. I had the same trouble before.. When you create keystore by signing you need to generate a new depending on that keystore otherwise you app wont work. May be that's the problem
_______________________________________________________
Help is available everywhere but you have to look at the correct place.
By Me :-)
Please use plain text.