Okhelp.cz

Recepty, články, nápady, programování. Dříve dum-zahrada, finance, internet a know-how.okhelp.cz Pro lepší výsledky hledání používejte i diakritiku.

Locale location Java Android example


Locale lc = Locale.getDefault(); // default now locale on device
	String sCountry = lc.getCountry(); // CZ
	
	lc = new Locale("fr","FR"); //FRANCE .. Locale(language, country);
	String sCountry2 = lc.getDisplayCountry(); // Francie

	 Locale locale = Locale.GERMAN;					    
	 String sCountry3 = locale.getDisplayCountry(); // ""

 Locale locale = Locale.GERMAN;
 DateFormat formatter = new SimpleDateFormat("HH:mm:ss zzzz", locale);
 String s = formatter.format(new Date());//13:40:39 GMT+00:00					


// array of locales   
 Locale[] locales = { new Locale("fr", "FR"), new Locale("de", "DE"),
				        new Locale("en", "US") };


Locale locale = Locale.US;

// for date
DateFormat dateFormatterEurope = DateFormat.getDateInstance(DateFormat.DEFAULT,
					Locale.GERMANY);
Calendar myCalendar = Calendar.getInstance();
String sDate = dateFormatterEurope.format(myCalendar.getTime());

        final byte[] langBytes = locale.getLanguage().getBytes(Charsets.US_ASCII);
        
// UTF-8 most widely used text format for to properly display of text
        final Charset utfEncoding = Charsets.UTF_8;
        String text = "ěščřžýáíéůú"; 
        final byte[] textBytes = text.getBytes(utfEncoding);


// other Locale
CANADA
CANADA_FRENCH
CHINA
CHINESE
ENGLISH
FRANCE
FRENCH
GERMAN
GERMANY
ITALIAN
ITALY
JAPAN
JAPANESE
KOREA
KOREAN
PRC // Locale constant for zh_CN. 
ROOT // Locale constant for the root locale. 
SIMPLIFIED_CHINESE
TAIWAN
TRADITIONAL_CHINESE Locale constant for zh_TW. 
UK
US

396LW NO topic_id




AD

Další témata ....(Topics)


314

Importing google-play-service library project to workspace issue | importing-google-play-service-library-project-to-workspace-issue


Try two way in Eclipse IDE:

1.) Import the library project into your Eclipse workspace.
Click File > Import,
select Android > Existing Android Code into Workspace, and browse to the copy of the library project to import it.
If project not visible with checkbox try next step as see below.

2.) Click
File > New > Other
select Android > Existing Android Code into Workspace, and browse to the copy of the library project to import it.
11

Number convert int to string Java Android example code | number


Convert number int to string Android Java example source code.

int n = 0;

try {
    n = Integer.parseInt("21"));
} catch(NumberFormatException e) {
   System.out.println("Could not parse " + e);
} 
// int to string
String s = String.valueOf(24);
246

Snow Text Effects Paint.NET | snow-text-effects-paint-net


For some graphics you can use Paint.NET editor.
//www.getpaint.net/
How create Snow Effects on Text by 1 minute show this video: