×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Apr 2011
    Posts
    17

    Exclamation some arabic symbols non writing in 3d edition devices



    hi my friends
    I am trying to write text in arabic and send it by sms in j2me
    my problem is some the symbol unable to write on the devices of 3d edition
    why???
    and I can write that in other emulator as that in any emulator in netbeans
    why??
    the char as like ً and ُ and ْ an other;
    please any one help me to write any symbol in any devices and send it to any devices possible read it

    Last edited by iraqy2010; 2011-12-14 at 16:40.

  2. #2
    Nokia Developer Champion
    Join Date
    Mar 2003
    Location
    Finland
    Posts
    9,545

    Re: some arabic symbols non writing in 3d edition devices

    How are you encoding the symbol/glyph you send, before/as you send it? Have you checked the receiving device that it has a font that can actually disply that symbol/glyph properly?

    If you don't use your own J2ME app, but the built-in Messaging app to send it, does it work then? What's the character/text encoding setting for text messages in/for the built-in Messaging application on the phone? E.g., on the N8, the possible options for character encoding is "Reduced support" or "Full support". I think with "Reduced support", the encoding is the default, 7-bit "SMS alphabet" (might also vary based on the phone's firmware language), but with "Full support" it is Unicode (UCS-2).

    You may also need to post relevant pieces of your source code as well as device details (which devices models and on which firmware version things work, and on which it doesn't).

    Read also http://www.joelonsoftware.com/articles/Unicode.html

  3. #3
    Registered User
    Join Date
    Apr 2011
    Posts
    17

    Re: some arabic symbols non writing in 3d edition devices

    thanks petrib for your replay
    I am new programmer in j2me and I find difficult to understanding the subject of //www.joelonsoftware.com/articles/Unicode.html
    pleas hint me on example for that
    my regards

  4. #4
    Nokia Developer Expert
    Join Date
    Aug 2007
    Posts
    1,595

    Re: some arabic symbols non writing in 3d edition devices

    Hello iraqy2010,

    can you provide more information on this by answering the questions by petrib please?

    How are you encoding the symbol/glyph you send, before/as you send it?

    Have you checked the receiving device that it has a font that can actually disply that symbol/glyph properly?

    If you don't use your own J2ME app, but the built-in Messaging app to send it, does it work then?
    ..

    You may also need to post relevant pieces of your source code as well as device details (which devices models and on which firmware version things work, and on which it doesn't).
    Regards,
    r2j7
    [URL="http://library.forum.nokia.com/java"][B] >>> Java Developer's Library <<<[/B][/URL]
    [URL="https://www.developer.nokia.com/Resources/Support/Technical_support.xhtml"] [B]>>> Technical Support for Java ME development <<<[/B][/URL]
    [URL="https://publish.ovi.com/info/"][B]>>> Nokia Publish: reach millions of Nokia users worldwide through Nokia Store <<<[/B][/URL]

  5. #5
    Registered User
    Join Date
    Apr 2011
    Posts
    17

    Re: some arabic symbols non writing in 3d edition devices

    hello my friends
    my code is the followed
    Code:
     import javax.microedition.lcdui.Canvas;import =
    javax.microedition.lcdui.Font;import javax.microedition.lcdui.Graphics; =
    public =
    class =
    CustomInputCanvas extends Canvas implements Runnable{		static final char[] KEY_NUM1_CHARS =3D new char[]{'.', '?', '!'};	static final char[] KEY_NUM2_CHARS =3D new char[]{'a', 'b', 'c'};	static final char[] KEY_NUM3_CHARS =3D new char[]{'d', 'e', 'f'};	static final char[] KEY_NUM4_CHARS =3D new char[]{'g', 'h', 'i'};	static final char[] KEY_NUM5_CHARS =3D new char[]{'j', 'k', 'l'};	static final char[] KEY_NUM6_CHARS =3D new char[]{'m', 'n', 'o'};	static final char[] KEY_NUM7_CHARS =3D new char[]{'p', 'q', 'r', 's'};	static final char[] KEY_NUM8_CHARS =3D new char[]{'t', 'u', 'v'};	static final char[] KEY_NUM9_CHARS =3D new char[]{'w', 'x', 'y', 'z'};	static final char[] KEY_NUM0_CHARS =3D new char[]{' =
    '};		int clearKeyCode =3D Integer.MIN_VALUE;		StringBuffer currentText =3D new StringBuffer();	String currentString =3D =
    new String();		int lastPressedKey =3D Integer.MIN_VALUE;	int currentKeyStep =3D 0;		Font inputFont =3D null;	int inputWidth =3D 0;	int inputHeight =3D 0;	int inputTranslationX =3D 0;		long lastKeyTimestamp =3D 0;	long maxKeyDelay =3D 500L;		int caretIndex =3D 0;	int caretLeft =3D 0;	boolean caretBlinkOn =3D true;	long caretBlinkDelay =3D 500L;	long lastCaretBlink =3D 0;		boolean goToNextChar =3D true;		=
    public =
    CustomInputCanvas()	{		new Thread(this).start();				inputFont =3D Font.getDefaultFont();				inputWidth =3D getWidth();				inputHeight =3D inputFont.getHeight();	}		public char[] getChars(int key)	{		switch(key)		{		case Canvas.KEY_NUM1: return KEY_NUM1_CHARS;		case Canvas.KEY_NUM2: return KEY_NUM2_CHARS;		case Canvas.KEY_NUM3: return KEY_NUM3_CHARS;		case Canvas.KEY_NUM4: return KEY_NUM4_CHARS;		case Canvas.KEY_NUM5: return KEY_NUM5_CHARS;		case Canvas.KEY_NUM6: return KEY_NUM6_CHARS;		case Canvas.KEY_NUM7: return KEY_NUM7_CHARS;		case Canvas.KEY_NUM8: return KEY_NUM8_CHARS;		case Canvas.KEY_NUM9: return KEY_NUM9_CHARS;		case Canvas.KEY_NUM0: return KEY_NUM0_CHARS;		}		return null;	}	boolean isClearKey(int key)	{		return key =3D=3D -8;	}		void clearChar()	{		if(currentText.length() > 0 && caretIndex > 0)		{			caretIndex--;						=
    currentText.deleteCharAt(caretIndex);						currentString =
    =3D currentText.toString();		}	}	void updateCaretPosition()	{		caretLeft =3D inputFont.substringWidth(currentString, 0, caretIndex);				if(caretLeft + inputTranslationX < 0)		{			inputTranslationX =3D - caretLeft;		=
    }		else if(caretLeft + inputTranslationX > =
    inputWidth)		{			inputTranslationX =3D =
    inputWidth - caretLeft;		}	}	public void keyPressed(int key)	{		int gameAction =3D getGameAction(key);				System.out.println("KEY: =
    " + key + ", " + =
    gameAction);				=
    if(isClearKey(key))		{			clearChar();						updateCaretPosition();						goToNextChar =3D true;		}		else if(key >=3D KEY_NUM0 && key <=3D =
    KEY_NUM9)		{			writeKeyPressed(key);		}		else if(gameAction =3D=3D Canvas.LEFT)		{			if(caretIndex > 0)			{				caretIndex--;								=
    updateCaretPosition();								goToNextChar =
    =3D true;			}		}		else if(gameAction =3D=3D Canvas.RIGHT)		{			if(caretIndex < currentText.length())			{				if(goToNextChar)					caretIndex++;								=
    updateCaretPosition();								goToNextChar =
    =3D true;			}		}	}	public void writeKeyPressed(int key)	{		if(goToNextChar || key !=3D lastPressedKey)		{			goToNextChar =3D true;						lastPressedKey =
    =3D key;						currentKeyStep =3D 0;		}		else		{			currentKeyStep++;		} 		char[] chars =3D getChars(key);				if(chars !=3D null)		{			if(currentKeyStep >=3D chars.length)			{				currentKeyStep -=3D chars.length;			}			if(goToNextChar)			{				currentText.insert(caretIndex, chars[currentKeyStep]);								caretIndex++;			}			else			{				currentText.setCharAt(caretIndex - 1, chars[currentKeyStep]);			}			currentString =3D currentText.toString();						updateCaretPosition();						lastKeyTimestamp =3D System.currentTimeMillis();						goToNextChar =3D false;		}	}		public void checkTimestamps()	{		long currentTime =3D System.currentTimeMillis();				if(lastCaretBlink + caretBlinkDelay < =
    currentTime)		{			caretBlinkOn =3D =
    !caretBlinkOn;						lastCaretBlink =3D currentTime;		}				if(!goToNextChar && lastKeyTimestamp + =
    maxKeyDelay < currentTime)		{			goToNextChar =3D true;		}	}		public void run()	{		while(true)		=
    {			=
    checkTimestamps();						repaint();						try			{				synchronized(this)				=
    {					wait(50L);				}			}			catch(Exception e)			{				e.printStackTrace();			}		}	}		public void paint(Graphics g)	{		g.setFont(inputFont);				g.setColor(0xffffff);				g.fillRect(0, 0, getWidth(), getHeight());				g.setColor(0x000000);				g.translate(inputTranslationX, 0);				g.drawString(currentString, 0, 0, Graphics.LEFT | Graphics.TOP);				if(caretBlinkOn && goToNextChar)		{			g.drawLine(caretLeft, 0, caretLeft, inputHeight);		}		g.translate(- inputTranslationX, 0);	}}
    that code in this site

    I want to edit it and replace
    Code:
    {'a', 'b', 'c'};
    to
    Code:
    {'ُ ', 'ٌ ', 'ِ'};
    but not appear
    how to me do that
    and about questions of petrib ,I dont know how to check the receiving device that it has a font that can actually disply that symbol/glyph properly
    how to me do that???
    I am new on the programming and i need help u

Similar Threads

  1. Problem in Arabic writing
    By NMMA in forum Qt
    Replies: 12
    Last Post: 2010-06-11, 15:09
  2. Symbols for S60 5th Edition 1.0 SDK
    By catharsis in forum Symbian Tools & SDKs
    Replies: 0
    Last Post: 2009-12-10, 11:11
  3. A problem with writing Arabic ?
    By elshorbagy76 in forum [Archived] Flash Lite on Nokia Devices
    Replies: 5
    Last Post: 2009-08-31, 13:58
  4. font to display arabic accent symbols
    By netlogins in forum Symbian User Interface
    Replies: 7
    Last Post: 2006-09-25, 07:10
  5. 3rd edition linking problem: undef symbols (win32)
    By kernj in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2006-07-20, 22:23

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •