show html file

Put your problem here if it does not fit any of the other categories.

show html file

Postby soniya » Sun Feb 17, 2008 10:51 am

plz help me....i have html file in raw folder....i want show html file particulat area on screen..
soniya
Senior Developer
Senior Developer
 
Posts: 111
Joined: Mon Jan 14, 2008 1:52 pm
Location: india

Top

Postby plusminus » Sun Feb 17, 2008 1:26 pm

Hello soniya,

the WebView is the widget of your choice:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.         WebView wv = new WebView(this);
  2.  
  3.         wv.loadData("_your_html_code_as_string_here_", "text/html", "utf-8");
Parsed in 0.030 seconds, using GeSHi 1.0.8.4


Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby soniya » Wed Feb 20, 2008 3:37 pm

is possible it display in particular area screen????how??
soniya
Senior Developer
Senior Developer
 
Posts: 111
Joined: Mon Jan 14, 2008 1:52 pm
Location: india

Postby plusminus » Wed Feb 20, 2008 4:28 pm

Its just an 'ordinary' View, you can put it to any place in your xml-layout.

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby soniya » Mon Feb 25, 2008 6:10 pm

i m using new sdk...
i want if i got numeric number, click on and make a call......on webview

i use in html file
<a herf="???????????">0252334455</a>
what is write place of "?????????"
is right????? :?:
is possible??? :?:
if not then plz tel me others way to do that :idea:

1 more question is possible i view Edittext on webview? :?:
soniya
Senior Developer
Senior Developer
 
Posts: 111
Joined: Mon Jan 14, 2008 1:52 pm
Location: india

Postby plusminus » Mon Feb 25, 2008 7:20 pm

Hello soniya

The easiiest way to do that would be using a TextView, because there are pre-made methods:
android.text.util.Linkify
final static boolean addLinks(TextView text, int mask)
Scans the text of the provided TextView and turns all occurrences of the link types indicated in the mask into clickable links.


Masks:
int ALL Bit mask indicating that all available patterns should be matched in methods that take an options mask 7 0x00000007
int EMAIL_ADDRESSES Bit field indicating that email addresses should be matched in methods that take an options mask 2 0x00000002
int PHONE_NUMBERS Bit field indicating that phone numbers should be matched in methods that take an options mask 4 0x00000004
int WEB_URLS Bit field indicating that web URLs should be matched in methods that take an options mask 1 0x00000001


Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Top

Postby soniya » Tue Feb 26, 2008 7:34 am

it's only phone_number and web url....i m also use html tags...plz tel me if is it possible on webview :?:
soniya
Senior Developer
Senior Developer
 
Posts: 111
Joined: Mon Jan 14, 2008 1:52 pm
Location: india

Postby soniya » Tue Feb 26, 2008 6:26 pm

plz tel me if i used
<a herf="???????????">0252334455</a> and click it....
then which is event trigger...
soniya
Senior Developer
Senior Developer
 
Posts: 111
Joined: Mon Jan 14, 2008 1:52 pm
Location: india

Postby plusminus » Tue Feb 26, 2008 6:33 pm

Hello soniya,

maybe:
Syntax: [ Download ] [ Hide ]
  1. <a href="tel:012345">012345</a> 


Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby soniya » Wed Feb 27, 2008 6:26 am

Thanks a lots it's working :lol: :D
soniya
Senior Developer
Senior Developer
 
Posts: 111
Joined: Mon Jan 14, 2008 1:52 pm
Location: india

Postby soniya » Wed Feb 27, 2008 3:54 pm

if on webview i used image from raw folder in zip file

i used<img src="raw/data/0/0/4/0.png">

but is not working...... :cry:

what will be use??
soniya
Senior Developer
Senior Developer
 
Posts: 111
Joined: Mon Jan 14, 2008 1:52 pm
Location: india

Postby soniya » Thu Feb 28, 2008 6:18 am

is possible access image to raw folder on webview?????
soniya
Senior Developer
Senior Developer
 
Posts: 111
Joined: Mon Jan 14, 2008 1:52 pm
Location: india

Postby plusminus » Thu Feb 28, 2008 9:31 am

Hello soniya,

I don't think that is directly possible. But you could copy that file to a folder.

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby soniya » Thu Feb 28, 2008 12:05 pm

copy to /data/data/package/.....
but how to access that???
soniya
Senior Developer
Senior Developer
 
Posts: 111
Joined: Mon Jan 14, 2008 1:52 pm
Location: india

Postby plusminus » Thu Feb 28, 2008 12:46 pm

Hello soniya,

there is even a better way:

The Android SDK provides a custom scheme to load assets from the application's .apk file in WebView. The prefix "file:///android_asset/" will cause WebView to load content from the current application's assets folder. For example, a myimage.gif file in the /assets folder can be used in the html image tag as:
Syntax: [ Download ] [ Hide ]
  1. <img src="file:///android_asset/myimage.gif"> 


Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Top
Next

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 25 guests