0

I need to set Arabic text in TextSymbol in android. Here is my code

TextSymbol txtSymbol = new TextSymbol(24, "مرحبا", Color.BLUE);
Point pt = new Point(-293826, 7574114);
Graphic gr = new Graphic(pt, txtSymbol);
GraphicsLayer gl = new GraphicsLayer();
mMapView.addLayer(gl);
gl.addGraphic(gr);

Note: there is method setFontFamily(), I tried with some font, but not working. The is issue is for right to left direction language, like Arabic, Hebrew etc..

Sohrab Alam
  • 111
  • 4

1 Answers1

0

Please try this way convert Arabic text into UTF-8

   String input = "مرحبا";
   String arabicString= new String (input.getBytes("UTF8")); 

    TextSymbol txtSymbol = new TextSymbol(24, arabicString, Color.BLUE);
    Point pt = new Point(-293826, 7574114);
    Graphic gr = new Graphic(pt, txtSymbol);
    GraphicsLayer gl = new GraphicsLayer();
    mMapView.addLayer(gl);
    gl.addGraphic(gr);
Ganesh Gudghe
  • 1,327
  • 1
  • 17
  • 41