Go Back   Android Forums > Android Development > Application Development
Application Development Dev lounge for our application developers.

test: Reply
LinkBack Thread Tools
Old July 1st, 2010, 05:50 AM   #1 (permalink)
New Member
Thread Author (OP)
Join Date: Jul 2010
Posts: 1
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default Help in a simple (or not) aplication

Hey everyone!
It's nice to be a new member in this community!

I'm beginner at android development and i start development an application and i need your help, please.
What i want to do is an app that just shows one button, at the end of the button, it should appear a country flag, this country flag must be the flag of the country language of the phone. By clicking in the button. it will open a website in the default mobile language(correspondig to the flag). If we want to open the website in other language, we should click beside the country flag an it will appears other country flags that we can click.
The code to open the website is ok, my biggest dificults are to know the default language of the phone and in function of this, put the flag after the button and make the menu beside the flag in case we want open site in other language. How i would make the mail.xml contains the squeme is other problem.

If someone could help me, i will be very grateful.

IGSG is offline  
Reply With Quote
sponsored links
Old July 1st, 2010, 03:32 PM   #2 (permalink)
Join Date: Sep 2009
Location: Birmingham, UK
Posts: 148
Device(s): G1 (Developer model), HTC Tattoo, Nexus One.
Carrier: Not Provided

Thanks: 1
Thanked 26 Times in 22 Posts

The java.util.Locale class might be of use to you.

Locale | Android Developers)

Locale locale = Locale.getDefault() ;

Log.d(TAG, "Locale getCountry = "+locale.getCountry()) ;
Log.d(TAG, "Locale getDisplayCountry = "+locale.getDisplayCountry()) ;
Log.d(TAG, "Locale getISO3Country = "+locale.getISO3Country()) ;
Log.d(TAG, "Locale getLanguage = "+locale.getLanguage()) ;
Log.d(TAG, "Locale getgetDisplayLanguage = "+locale.getDisplayLanguage()) ;
I get the following results, which are correct for me:

Locale getCountry = GB
Locale getDisplayCountry = United Kingdom
Locale getISO3Country = GBR
Locale getLanguage = en
Locale getgetDisplayLanguage = English
markb is offline  
Reply With Quote
button, flags, menu

Go Back   Android Forums > Android Development > Application Development
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

All times are GMT -5. The time now is 03:23 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.