DOM parsing Android

Go To StackoverFlow.com

3

I want to XML parse to android, here's my xml. when I go to the link of my xml ,it shows me the special characters fine ( Arabic letters).. but when I run my app, it shows me weird characters

<?xml version="1.0" encoding="ISO-8859-6"?>
<music>
  <song>
    <id>1</id>
    <title>  السلام عليكم هلا </title>
    <artist>نعم</artist>
    <duration>4:44</duration>
    <plays>234</plays>
    <thumb_url>http://api.androidhive.info/music/images/adele.png</thumb_url>
  </song>
</music>
2012-04-05 23:17
by AliDeV


1

You can put Font File(Arebic_Font.ttf) into asset folder and write following code to show parsed arebic title into TextView widget.

TextView mTitleTextView = (TextView)findViewById(R.id.title);    
Typeface mTypeface = Typeface.createFromAsset(getAssets(),"Arebic_Font.ttf");
mTitleTextView.setTypeface(getDefaultTypeFace());

Note : There is no need to root the device for new font, only if font is predefined and we have .ttf file of font resource.

2012-04-10 18:35
by Hitesh Patel


0

It is because android support does not include the Arabic font yet. You have to install the font on the rooted device yourself before they display properly. if it is on the standard device, forget it for now.

2012-04-05 23:20
by Win Myo Htet
Ads