Browser Application: loading asset html files

by Kumaravel Kandasami » Sat, 14 Feb 2009 05:54:54 GMT


Sponsored Links
 I have html/css/js files in my asset directory. In the MAIN activity class
I am redirecting the display of the html files in my asset directory to the
browser application using Intents.

The browser application is not loading the html page, however if I change
the code to use external URL it works fine.

Not Working:

startActivity (new Intent(Intent.ACTION_VIEW,
Uri.parse("file:///android_asset/popup.htm")));

Working:

startActivity (new Intent(Intent.ACTION_VIEW, Uri.parse("
 http://www.saisk.com ")));


I am assuming the Intent are not mapped to the 'scheme' in the url (file
versu http). Anyone have other suggestions.


Thank You.

Kumar    _/|\_
www.saisk.com
ku...@saisk.com
"making a profound difference with knowledge and creativity..."

--~--~---------~--~----~------------~-------~--~----~



Browser Application: loading asset html files

by Mark Murphy » Sat, 14 Feb 2009 06:53:59 GMT


 


This is correct behavior.


Browser cannot load file:/// URLs in general, let alone from inside the
packaged assets of an arbitrary application that isn't the Browser itself.

A URL of file:///android_asset/popup.htm will work OK for an embedded
WebView, though.

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com 
_The Busy Coder's Guide to Android Development_ Version 2.0 Published!

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Browser Application: loading asset html files

by Fred Grott(shareme) » Sat, 14 Feb 2009 07:51:07 GMT


 Komar there i s a tutorial on webview I believe at anddv.org

If you still need poitners..speak up as there are a few of us webview
adventuers around



On Feb 13, 3:54pm, Kumaravel Kandasami


--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. first app - please check and tell suggestions

I tried the app and well.
My camera can't autofocus the picture I want to take (not to mention
that my camera even doesn't want to take a picture at first) but
suddenly, it took a picture.
And then well, I set the app for German as my native language and
English as the foreign language but in the game, it English was the
native language and Spain the foreign language. (it was Spain I
think?).

So still buggy it seems, but it's a great idea! So please go on! ;)

For info: I have a HTC Hero.

Ritchie Flick

--

2. Will Android 2.0 be open source?

Until such time, I am going to remove Verizon as an available carrier
for my Applications.





> > 

3. Android Zii EGG opinions

4. Ramos W7

5. How many people do you know that uses a cellphone?

6. Feature - What does everyone think of this!

7. NullPointerException android executable (Ubuntu)