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. About getting log messages

Hi All,
        I want to know how to get log by using logcat binary?
        i have built dalvikvm binary on my ppc64-linux m/c but while running
        it is giving me seg fault ,so i want to observe log ,i have android
        kernel running on my system but i dont know which kernel module do i
need to
        enable in order to see the log in /dev/log dir?
        can anybody guide me on this?

Regards,
DJ
--~--~---------~--~----~------------~-------~--~----~
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

2. Problem in running android 1.5 preview sdk on mac os

Hi,

I have add
I have set the variable ANDROID_SDK_ROOT and add
":/Users/lucius/Programs/android-sdk-mac_x86-1.5_pre/tools" to my
$PATH

$ echo $ANDROID_SDK_ROOT
/Users/lucius/Programs/android-sdk-mac_x86-1.5_pre

but when I run the emulator, I get this error:

$ emulator
emulator: ERROR: You did not provide the name of an Android Virtual Device
with the '-avd <name>' option. Read -help-avd for more information.

If you *really* want to *NOT* run an AVD, consider using '-data <file>'
to specify a data partition image file (I hope you know what you're doing).

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

3. kernel feature for 2.6.29 based Android

4. "Kernel panic - not syncing: No init found. Try passing init= option to kernel."

5. How Delete SMS from inbox programmatically OR discard it before received in inbox

6. Rings Extended obsoleted by new builds?

7. Should i use master or cupcake branches?