开发者

Arabic language in android [closed]

Closed. This question need开发者_JS百科s to be more focused. It is not currently accepting answers.

Want to improve this question? Update the question so it focuses on one problem only by editing this post.

Closed 8 years ago.

Improve this question

android still not fully support Arabic language even in last version 2.3 and maybe not in 3.0 also

any way i am programmer if i want to make it Arabic support how to start to make it fully support Arabic ?

because i found some the companies like Samsung and HTC add fully Arabic support to there devices this mean every body if he has a good knowledge with the system can add support.


Android 3.0 Honeycomb has official native support for Arabic.

source: xda-developers, http://bit.ly/honeycomb-arabic , ArDroid

As for smart phones, CyanogenMod 7 has decent Arabic support.


If you want arabic on your Android device you can use CyanogenMod 7 based on Android gingerbread(2.3) they use arabic shaper in their rom soyou can read arabic everywhere and in the latest version of cyanogen they added an arabic keyboard.

Companies like HTC and samsaung... made special arabic room for devices exported to MEA , but It does not supported well, arabic OTA updates doesn't come 90%.


I found a couple projects which attempt that, maybe you could look at those and see what exactly needs to be done

https://sites.google.com/a/ut.utm.edu/arabic-android/


You can use Alefonizer .. its a lib renders arabic characters in android devices that dont support Arabic

here is a smaple

package org.alefon.com;


import www.alefon.com.alefonizerArarbic.AlfnFixText;
import www.alefon.com.alefonizerArarbic.AlfnLining;
import android.app.Activity;
import android.os.Bundle;
import android.view.ViewTreeObserver;
import android.view.ViewTreeObserver.OnGlobalLayoutListener;
import android.widget.TextView;



public class MainActivity extends Activity {
    private TextView tv;
private AlfnFixText alfntx;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);  
        alfntx = new AlfnFixText(true); 
        tv = (TextView) findViewById(R.id.tx); 
        String text = "قال ابن رشد:الله ليمكن ٔان يعطينا عقول ويعطينا شرأيع مخالفة لها";   

        tv.setText(text); 

        ViewTreeObserver vto = tv.getViewTreeObserver(); 
        vto.addOnGlobalLayoutListener(new OnGlobalLayoutListener() { 
            @Override
            public void onGlobalLayout() {

                AlfnLining alflining = new AlfnLining();
                String rlines = alflining.getTextLines(tv.getWidth(),
                        tv.getPaint(), tv.getText().toString(), true);
                if (rlines != null) {
                    String lli[] = rlines.split("\n");
                    String fn = "";
                    for (String st : lli) {

                        try {
                            st = alfntx.getFixedText(st);
                        } catch (Exception e) {

                            e.printStackTrace();
                        }
                        fn += st + "\n";
                    }
                    tv.setText(fn);
                }
                ViewTreeObserver obs = tv.getViewTreeObserver();
                obs.removeGlobalOnLayoutListener(this);
            }
        });
    }

}

Just remember that you would need to use a font that contains Arabic character & OTL for Arabic ..i.e. Arial ..

====== update =======

Android studio use UTF-8 as file encoding.. but you can change it see screenshot:

Arabic language in android [closed]

Good luck,

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜