Load CSS Styles in a Textview

by And-Rider » Thu, 22 Apr 2010 12:50:05 GMT


Sponsored Links
 Is it possible to display Css style tags in a text view..? The method
Html.fromhtml() converts only html tags to a spanned string but not
the Css styles

--



Load CSS Styles in a Textview

by patbenatar » Thu, 22 Apr 2010 15:18:40 GMT


 To answer your question, nope. Html.fromHtml() is exactly that: HTML.
Some sort of HtmlAndCss.fromMarkup() or something would be really
useful for lazy UI designers but you need to keep in mind that using
things like HTML and CSS in a application built for a certain set of
devices running a certain system just won't feel native to your users--
and native apps are something users tend to prefer.

Try searching first next time, CSS questions pop up all the time on
this group..

-Nick






>


Sponsored Links


Load CSS Styles in a Textview

by patbenatar » Thu, 22 Apr 2010 15:37:17 GMT


 Oh, also: there is the WebView option, although I don't like
advocating this--again, not native. For example the DropBox
application--I downloaded and installed it and finally launched it to
see a WebView: "WTF? I could have quickly gone to dropbox.com in
Browser for this."







> >



Other Threads

1. Get the GPS when I access a website by Android phone

Hi,everyone

I have a problem not about  a Android application,
but How to get the location (GPS,lat,lon that is enough) when the Android
user access my website or click a button on my site.
Of course , when user access mysite by normal 3G phone(NOT smartphone),
There is a admonition pop out just as ('This website well get you GPS
information, is that will be OK ?'),
and then you have a choose,Yes or No.
When you choose Yes ,my webserver will get your GPS (lat,lon)information,And
then I will know Where
you are (NOT very exactily,but probrablly).
It works very well on normal 3G phone.

Here is my example: (I live in Japan)


*sendGPS.html* //You can push the button you fit with (you are a au user,or
softbank user,or NTT DOcomo user )
--------------------------------------------------------------------------------
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "
http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="ja" xml:lang="ja">
<head>
   <meta http-equiv="Content-Type" content="application/xhtml+xml ;
charset=Shift_JIS" />
   <meta http-equiv="Content-Style-Type"  content="text/css" />
   <meta name="description" content="isntruction" />
   <title>title</title>
</head>
<body>

<!-- GPS for AU -->
<a
href="device:gpsone?url=getgps.php&amp;ver=1&amp;datum=0&amp;unit=0&amp;area=au">AU:get
your location</a><br />
<!-- GPS for Softbank User -->
<a href="location:auto?url=getgps.php&area=softbank">Softbank:get your
location</a><br />
<!-- GPS for Docomo User -->
<a href="getgps.php?area=docomo" lcs>Docomo:get your location</a><br />
</body>
</html>
---------------------------------------------------------------------------------------------------------

and then I will get your GPS information any do some anylization.
Here is the
* getgps.php //i get your location and echo them.*
**
---------------------------------------------------------------------------------------------------------

<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "
http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="ja" xml:lang="ja">
<head>
   <meta http-equiv="Content-Type" content="application/xhtml+xml ;
charset=Shift_JIS" />
   <meta http-equiv="Content-Style-Type"  content="text/css" />
   <meta name="description" content="instrction" />
   <title>title</title>
</head>
<body>

<?php
//a phone from au
if($_GET['area']=='au'){
 $lat = $_GET{'lat'};
 $lon = $_GET{'lon'};
 $datum = $_GET{'datum'};
 $unit = $_GET{'unit'};



 $result = "lat " . $lat . "<br>\n"
  . "lon " . $lon . "<br>\n"
  . "datum " . $datum . "<br>\n"
  . "unit " . $unit;

 echo $result;

}
//a phone from softbank
elseif($_GET['area']=='softbank'){
 $pos = $_GET['pos'];


 $pos_arr = explode("E", $pos);

 $lat = str_replace("N", "", $pos_arr[0]);
 $lon = $pos_arr[1];

 $lon_arr = explode('.', $lon);
 $lat_arr = explode('.', $lat);

 $lon = intval($lon_arr[0]) + intval($lon_arr[1]) / 60 +
(intval($lon_arr[2]) + intval($lon_arr[3]) / 1000) / 3600;
 $lat = intval($lat_arr[0]) + intval($lat_arr[1]) / 60 +
(intval($lat_arr[2]) + intval($lat_arr[3]) / 1000) / 3600;

 $result = "lat " . $lat . "<br>\n"
  . "lon " . $lon . "<br>\n";

 echo $result;
}
//a phone from NTT docomo
elseif($_GET['area']=='docomo'){
 echo $pos = $_GET['pos'];
 $lat = $_GET['lat'];
 $lon = $_GET['lon'];
 $geo = $_GET['geo'];
 $xacc = $_GET{'x-acc'};

 $result = "lat " . $lat . "<br>\n"
  . "lon " . $lon . "<br>\n"
  . "geo " . $geo . "<br>\n"
  . "xacc " . $xacc;

 echo $result;


}

?>
</body>
</html>


---------------------------------------------------------------------------------------------------------

BUT HOW about a Android or iphone.

*How to get the GPS from Android or iphone user?*

Gould any kindly one help me ?

thank you very much.

-- 

2. How to discover and connect a particular type of BluetoothDevice

Hello All,

I am currently in process of developing a Bluetooth Application. Where
I have various options including connecting to A2DP, HF devices,
sending vCard, vCalendar etc.

So as par my requirement, for particular action, I want to discover
that type of device and then connect and do the operation.
As I am new to Android Bluetooth APIs, and hence I am unable to find
out any solution for this yet.

Please provide me information for doing this.

Thanks in advance,
Suresh Pal

-- 

3. Integrating Barcode Scanner

4. Linux Kernel Motion Events

5. Regarding survey of android..

6. Any existed support for ZigBee module?

7. Calendar shows events advanced by 30 mim