Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DOM parsing Android

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>
like image 933
AliDeV Avatar asked Feb 15 '26 18:02

AliDeV


1 Answers

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.

like image 198
Hitesh Patel Avatar answered Feb 18 '26 07:02

Hitesh Patel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!