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 8232495
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T17:51:03+00:00 2026-06-07T17:51:03+00:00

Hey there Stackoverflow! I’m trying to create an application that uses a WebView to

  • 0

Hey there Stackoverflow!

I’m trying to create an application that uses a WebView to display a JavaScript widget but I seem to have hit a wall in which I cannot get the widget to display at all. I’ve done a fair amount of research and I think what I’m trying to do is possible.

This is my main activity

public class WebViewAppTestActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    //grab the webview
    WebView webview = (WebView) findViewById(R.id.webview);

  //grab the webview settings
    WebSettings websettings = webview.getSettings();

    //enable javascript
    websettings.setJavaScriptEnabled(true);

    //add a js interface to display the widgets
    webview.addJavascriptInterface(new JavaScriptInterface(this), "Android");

    //load a webpage
    webview.loadUrl("file:///android_asset/javascript/index.html");


}

}

It loads the file index.html which looks like this

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width; user-scalable=0;" />
<title>WebView test!</title>
</head>
<body>
<h1>MyHTML</h1>

<div id="panel">
<section class="episode"></section>
</div>

<script src="https://sourceurl1.js" />
<script src="https://sourceurl2.js" />
<script src="https://sourceurl3.js" />
<script src="https://sourceurl4.js" />

<script src="./widget.js" />
<script src="./top-episodes.js" />
<script>
  var TopEpisodes = new Company.TopEpisodes({
  $element: $('#panel section.episodes')
  });
  TopEpisodes.init({
         mode      : 'realtime',
         range     : { from: 1341911040, to: 1341907200 },
         path      : ["4FB159EB613033AA710006DF"],
         isEpisode : true
  });
</script>
</html>

</body>
</html>

The only thing that displays when I test my application (Nexus S 4G ICS 4.0.4) is the MyHTML header on a blank white screen. Internet access is enabled in the xml.

Is there something else I need to enable for the WebView settings, or does something look really wrong with my HTML file? Do I need to do something with the addJavaScriptInterface method/within a JS interface?

Anyways I am very stuck and open to any suggestions! Thank you for your time!

EDIT There haven’t been any response on this question for a couple days, let me know if there is anything I can do to clarify this question or any other details that would help! Or if it is even possible. Thank you!

  • 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-06-07T17:51:07+00:00Added an answer on June 7, 2026 at 5:51 pm

    So I’ve decided to go a different direction with my application due to my lack of experience with both HTML and Javascript.

    I am instead going to develop the widget natively in Java using this chart library: http://achartengine.org/ and then update the data using an HttpClient rather than creating it within a WebView in Javascript, because I think that this solution will be easier and quicker for an Android application.

    Thank you all for your time!

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

Sidebar

Related Questions

Hey there. I'm trying to write a small program that will read the four
Hey there, new to AJAX, JS.. Im trying to add to a Javascript/Ajax search
Hey there, I'm at the moment trying to make a product management application. The
Hey there, trying to install a ruby gem but I keep getting the following
Hey there. I have a c# application that parses txt files and imports the
Hey there, i am trying to make a little app that will serve multiple
hey there i want to change some css attributes from javascript but i cant
Hey there, I am trying to get my signout button to work. This is
Hey there, I'm trying to validate a form with Zend_Validate and Zend_Form. My element:
hey there, i have a div that expands when the page is loaded, now

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.