2

This is kind of a shot in the dark, but... I know we have WebView exposed. I was wondering if there is anyway we could use / embed firefox's renderer in an Android app?

I have an .mht file which neither works in androids default browser, dolphin, or opera. But mysteriously works in firefox mobile.

Is there any way this is possible?

Lukas Knuth
  • 25,449
  • 15
  • 83
  • 111
Authman Apatira
  • 3,994
  • 1
  • 26
  • 33
  • 1
    Probably better to convert your .mht to a more popular format for example .html – yorkw Jan 10 '12 at 21:40
  • Tru this answer [In android, How can I force open a URI using a specific browser, without popping up the 'choose browser' list?][1] [1]: http://stackoverflow.com/questions/6788395/in-android-how-can-i-force-open-a-uri-using-a-specific-browser-without-popping – daveD Jan 10 '12 at 22:03
  • Try this answer [In android, How can I force open a URI using a specific browser, without popping up the 'choose browser' list?][1] [1]: http://stackoverflow.com/questions/6788395/in-android-how-can-i-force-open-a-uri-using-a-specific-browser-without-popping – daveD Jan 10 '12 at 22:05

1 Answers1

3

So, the "features"-site of the mobile Firefox reads:

The mobile Firefox is built on the same browser engine as the desktop version, yet optimized for browsing on a mobile device.

Since the desktop-version of Firefox uses Mozilla's own Gecko-engine for rendering, this will be it.

There are docs on how to embed the Gecko engine in your project (and an older question: How can I embed firefox in a GUI application?), but those target the use in desktop-applications (which normally have more resources for use) and are not available as a Java library/binding.

Since Mozilla is an OpenSource-company, the sources for the Mobile Firefox are public and build-instructions can be found here. Although you can play around with it and see if you can isolate only the rendering-engine part to use it in your application.

Another option would be putting all those files (which are bundled in your .mht-file) in the /res/raw-folder and use them with a normal WebView.

Community
  • 1
  • 1
Lukas Knuth
  • 25,449
  • 15
  • 83
  • 111
  • Yea, I've actually already decompiled the .mht to its assets. The main issue is that this web app makes use of XMLHttpRequest object to load local resources, and all browsers block that---even if the originating script is local. Firefox and IE seem to be the only major browsers that allow for that locally. IE is out of the question on Android, so I figured Firefox Mobile. If the client would allow me to edit the webapp and included the ajax loaded resources it would be nice; but for this solution, I need to run the webapp as-is. – Authman Apatira Jan 10 '12 at 22:37
  • Why do you need to load local resources with AJAX? – Lukas Knuth Jan 11 '12 at 18:48
  • The (uneditable) .mht webapp loads some resources with ajax, and once converted to mht, even when unpacked, everything becomes local. – Authman Apatira Jan 11 '12 at 18:51