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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:13:00+00:00 2026-06-13T13:13:00+00:00

I am working on EPUB reader for the company using JavaScript, the application runs

  • 0

I am working on EPUB reader for the company using JavaScript, the application runs well on Android 2.2, but when i try it on ICS & HoneyCom, the JavaScript doesn’t work well. The first problem i faced, the WebView doesn’t load JS files (Unknown Error -6), so i used this solution:

@TargetApi(11)
@Override
public WebResourceResponse shouldInterceptRequest(WebView view, String url) {
    Log.d("shouldInterceptRequest", url);

    InputStream stream = inputStreamForAndroidResource(url);
    if (stream != null) {
        return new WebResourceResponse("text/javascript", "utf-8", stream);
    }
    return super.shouldInterceptRequest(view, url);
}

private InputStream inputStreamForAndroidResource(String url) {
    final String ANDROID_ASSET = "file:///android_asset/";

    if (url.contains(ANDROID_ASSET)) {
        // url = url.replaceFirst(ANDROID_ASSET, "");
        String[] f = url.split("/");
        url = "epub/"
                + f[f.length - 1]
                        .substring(0, f[f.length - 1].indexOf("'"));
        try {
            AssetManager assets = mActivity.getAssets();
            Uri uri = Uri.parse(url);
            return assets
                    .open(uri.getPath(), AssetManager.ACCESS_STREAMING);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
    return null;
}

and now i don’t have this error, but the JS still doesn’t work. Does anyone have a solution?

  • 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-13T13:13:01+00:00Added an answer on June 13, 2026 at 1:13 pm

    the only solution I found is the same as the question….

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

Sidebar

Related Questions

So I'm currently working on an ePub reader application, and I've been reading through
Im working on an epub reader for android platform. Not me started the project
Working on a small game using an HTML5 canvas, and javascript. And it's working
I'm working on an epub/mobi which has some embedded videos using the , ,
I have made one application in which I implemented ePub reader which unzips file
I am working on PDF Reader application. if i display pdf file then i
I'm working on epub reader , simply I built the reader structure to get
Currently I'm working on to display Epub content in UIWebview . From this link
Working with H2 I get this error when I try to write a row
Working on the problems on Project Euler to try to learn Clojure. I'm on

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.