Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6359587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:32:17+00:00 2026-05-24T23:32:17+00:00

I try to load HTML5 game from internet and show it in my WebView

  • 0

I try to load HTML5 game from internet and show it in my WebView but when I try to do that I can’t load the game, my monitor is black and there is only one line (about 30px high) that is on my screen this is my code

public class BrowserGame extends MenuHandler {

    @Override
    public void onCreate(Bundle icicle) {
        super.onCreate(icicle);
        setContentView(R.layout.browsergame);

        WebView browser = (WebView)findViewById(R.id.webGame);
        browser.setFocusableInTouchMode(false);

        browser.setWebViewClient(new WebViewClient(){
            @Override  
            public boolean shouldOverrideUrlLoading(WebView view, String url)  
            {
                view.loadUrl(url);
                return true;  
            }
        });

        Bundle game = getIntent().getExtras();
        String gameURL = game.getString("gameURL");

        browser.loadUrl(gameURL);
    }
}

When I try same link on mobile browser it shows the game.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T23:32:18+00:00Added an answer on May 24, 2026 at 11:32 pm

    The Game you try to load/play in your WebView is not a pure HTML5 application, but a simple JavaScript game.

    To make this work in your own WebView, you’ll need to activate JavaScript for this WebView:

    WebView myWebView = (WebView) findViewById(R.id.webview);
    WebSettings webSettings = myWebView.getSettings();
    webSettings.setJavaScriptEnabled(true);
    

    In my test-case, this does not work either. The blue line you see is the loader of the Game. LogCat is reporting an Error for the game.js-script:

    WARN/webview(1208): Miss a drag as we are waiting for WebCore's response for touch down.
    ERROR/Web Console(1208): TypeError: Result of expression 'event' [undefined] is not an object. at http://m.spacemonsters.co.uk/galactians/game.js:261
    

    This only shows up when using a WebView, Androids standard browser does not throw this error. This Error is thrown when you click on the Game. It’s also thrown in Androids standard browser, so it might not be the root of the problem.

    Also, there seams to be a difference in the way how the standard Android Browser (which can play the game) and the WebView handle and process JavaScript. There are some workarounds posted here, see if one applies to your situation.


    Fun Fact: There is a Bug in the Game which makes it very easy to get a damn high score. You can use the P-key to pause the game. In pause mode, you can still move the ship and shots are generated (you simply don’t see them). After you hit P again, your shots fly out.

    This also makes it very easy to avoid being hit by an enemy laser-shot 😉

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I try to load a loginView in my app delegate but it only shows
while creating a video player using html5 i try to load the video from
I try to load a node only to face the EInvalidPointer error on Delphi.
Suppose there is a live WAV stream that can be reached at a certain
here are some quotes from the dev reference that after reading can't get my
I'm getting SIGSEGV signals when I try to load HTML into a WebView with
The HTML5 draft specifies (at the moment at least), that the URI about:legacy-compat can
I did try samples, demos from Google codes and other resources with WebView ,
I try to load files in different categories according to theis file name. Till
When I try to load the following page in IE7 & IE8 I receive

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.