Solved

Android application support RTL

Posted on 2011-03-02
7
1,882 Views
Last Modified: 2012-05-11
Hi,
 I have developet Android application which display RSS news

 I'm using the Radio buttons & Test View

 how do I set the application to suopport RTL Direction ??

Thanks
0
Comment
Question by:madmare
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 17

Expert Comment

by:Dejan Pažin
ID: 35029282

I guess you need Arabic locales for that. If you compare the android version 2.2 and 2.3, you will notice that 2.3 has Arabic support, while 2.2 does not:

http://developer.android.com/sdk/android-2.2.html

http://developer.android.com/sdk/android-2.3.html

There are suggestions to use webkit control, see here:

http://stackoverflow.com/questions/2584245/android-rtl-support-digits-embedded-in-a-right-to-left-sentence-hebrew
0
 

Author Comment

by:madmare
ID: 35047384
i need Hebrew, not arabic

 is it the same ?
0
 
LVL 17

Expert Comment

by:Dejan Pažin
ID: 35053871

Yes.
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

Author Comment

by:madmare
ID: 35098898
I don't have any problem with the fonts, all what i need that the fonts in TextView be aligned to the rigth

0
 
LVL 17

Expert Comment

by:Dejan Pažin
ID: 35106061

I am not sure I understand now. I thought you needed RTL support?

To justify text to the right try this:

tv.setGravity(Gravity.RIGHT);
0
 

Author Comment

by:madmare
ID: 35106137
unfortunatly it still aligned to the left after I had inserted the: tv.setGravity(Gravity.RIGHT);

0
 
LVL 17

Accepted Solution

by:
Dejan Pažin earned 500 total points
ID: 35117557
Here is a sample that works, try it:

public class MyActivity extends Activity
{
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        LinearLayout layout = new LinearLayout(this);
        TextView tv  = new TextView(this);
        tv.setText("test");
        tv.setGravity(Gravity.RIGHT);
        tv.setBackgroundColor(Color.WHITE);
        LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
        layout.addView(tv, lp);
        setContentView(layout);
    }
}
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Monitoring mobile application usage on iPhone 1 35
Protecting a SKY 4.0 (Android) devise 15 167
Can Live bindings change TGrid Cell Colour ? 1 64
Cisco Anyconnect for Android 6 62
As the title indicates, I have done this before. It chills me everytime I update the OS on my phone, (http://www.experts-exchange.com/articles/18084/Upgrading-to-Android-5-0-Lollipop.html) because one time I did this and I essentially had a bricked …
A short article about problems I had with the new location API and permissions in Marshmallow
This video is in connection to the article "The case of a missing mobile phone (https://www.experts-exchange.com/articles/28474/The-Case-of-a-Missing-Mobile-Phone.html)". It will help one to understand clearly the steps to track a lost android phone.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question