Example usage for java.util Locale KOREA

List of usage examples for java.util Locale KOREA

Introduction

In this page you can find the example usage for java.util Locale KOREA.

Prototype

Locale KOREA

To view the source code for java.util Locale KOREA.

Click Source Link

Document

Useful constant for country.

Usage

From source file:egovframework.rte.tex.com.web.EgovBindingInitializer.java

/**
* initBinder//from   w  ww .  java  2  s .com
* @param binder
* @param request
* @see ??  
*/
public void initBinder(WebDataBinder binder, WebRequest request) {
    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd", Locale.KOREA);
    dateFormat.setLenient(false);
    binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, false));
    binder.registerCustomEditor(String.class, new StringTrimmerEditor(false));
}

From source file:ph.fingra.statisticsweb.controller.CommonController.java

@RequestMapping(method = RequestMethod.POST, value = "/changeLocaleByAjax")
public @ResponseBody String changeLocale(@RequestParam("lang") String lang, HttpServletRequest request,
        HttpServletResponse response) {//from ww w.  j  av a 2s  . c o  m
    LocaleResolver localeResolver = RequestContextUtils.getLocaleResolver(request);
    Locale locale = null;
    if (lang.equals("ko")) {
        locale = Locale.KOREA;
    } else if (lang.equals("cn")) {
        locale = Locale.CHINA;
    } else if (lang.equals("hk")) {
        locale = Locale.TRADITIONAL_CHINESE;
    } else if (lang.equals("ja")) {
        locale = Locale.JAPAN;
    } else {
        locale = Locale.ENGLISH;
    }

    localeResolver.setLocale(request, response, locale);

    return null;
}

From source file:pe.kr.crasy.parse_launch.MainActivity.java

License:asdf

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    mBuilder = new NotificationCompat.Builder(this);
    mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
    mBuilder.setSmallIcon(R.mipmap.ic_download_grey600_36dp);

    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);/*from   w w w  .ja v  a  2 s  .  c o m*/
    actionBar = getSupportActionBar();

    calendar = Calendar.getInstance(Locale.KOREA);

    setTitle("" + calendar.get(Calendar.YEAR) + " " + (calendar.get(Calendar.MONTH) + 1) + " "
            + calendar.get(Calendar.DAY_OF_MONTH) + "? ?");

    FloatingActionButton fabDownload = (FloatingActionButton) findViewById(R.id.Button_Download_All);
    FloatingActionButton fabRemoveData = (FloatingActionButton) findViewById(R.id.Button_Remove_All_Data);
    FloatingActionButton fabShowInCalender = (FloatingActionButton) findViewById(R.id.Button_Show_In_Calender);
    FloatingActionButton fabShowLicense = (FloatingActionButton) findViewById(R.id.Button_Show_Setting);
    famMultipleActionsDown = (FloatingActionsMenu) findViewById(R.id.multiple_actions_down);
    fabDownload.setOnClickListener(new fabOnclickListener());
    fabRemoveData.setOnClickListener(new fabOnclickListener());
    fabShowInCalender.setOnClickListener(new fabOnclickListener());
    fabShowLicense.setOnClickListener(new fabOnclickListener());

    intentFilter = new IntentFilter(); //?   
    intentFilter.addAction(getPackageName() + "Show_Launch_List"); //?  ? ?    
    intentFilter.addAction(DownloadManager.ACTION_DOWNLOAD_COMPLETE); //HWP ??  ??    
    broadcastReceiver = new Show_Launch_List(); //Inner class Show_Launch_List()  
    registerReceiver(broadcastReceiver, intentFilter); //  ?

    ListView Launch_List = (ListView) findViewById(R.id.Launch_List);
    Launch_List_Adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1);
    Launch_List.setAdapter(Launch_List_Adapter);

    RealmResults<LaunchStore> realmResults;
    RealmResults<LaunchList> realmResultsList;
    realm = Realm.getInstance(this);
    realmResults = realm.where(LaunchStore.class).findAll(); // ? ? ?  ?
    Iterator<LaunchStore> iterator = realmResults.iterator();
    Boolean test = false;
    LaunchStore launchstore;
    while (iterator.hasNext()) {
        launchstore = iterator.next();
        if (simpleDateFormat.format(launchstore.getDate()).equals(simpleDateFormat.format(new Date()))) {
            realmResultsList = launchstore.getLaunchList().where().findAll();
            Iterator<LaunchList> launchListIterator = realmResultsList.listIterator();
            while (launchListIterator.hasNext()) {
                Today_Launch.add(launchListIterator.next().getLaunch());
            }
            sendBroadcast(new Intent(getPackageName() + "Show_Launch_List"));
            test = true;
            break;
        }
    }
    if (!test) {
        sharedPreferences = PreferenceManager.getDefaultSharedPreferences(MainActivity.this);
        if ((sharedPreferences.getBoolean("UpdateLaunchOnlyWIFI", true) && isWifi().equals("WIFI"))
                || !sharedPreferences.getBoolean("UpdateLaunchOnlyWIFI", true)) {
            new Thread(new Runnable() { //? ?  
                private Realm realm_2;

                @Override
                public void run() {
                    Log.d("dd", "loaded download");
                    try {
                        realm_2 = Realm.getInstance(getApplicationContext());
                        Document doc = Jsoup.connect(
                                "http://www.sugong.org/main.php?menugrp=060602&master=meal2&act=list&SearchYear=2015&SearchMonth="
                                        + (calendar.get(Calendar.MONTH) + 1) + "&SearchDay="
                                        + calendar.get(Calendar.DAY_OF_MONTH) + "#diary_list")
                                .get();
                        Elements elements = doc.select(".meal_table");
                        String[] strSplit = elements.text().split("? ? ");
                        realm_2.beginTransaction();
                        LaunchStore launchStore = realm_2.createObject(LaunchStore.class);
                        launchStore.setDate(new Date());
                        LaunchList launchList;
                        if (strSplit.length >= 2) { //?  ? 1?
                            strSplit = strSplit[1].split(",");
                            for (String s : strSplit) {
                                Log.d("dd", s.trim());
                                Today_Launch.add(s.trim());
                                launchList = realm_2.createObject(LaunchList.class);
                                launchList.setLaunch(s.trim());
                                launchStore.getLaunchList().add(launchList);
                            }
                        } else {
                            launchList = realm_2.createObject(LaunchList.class);
                            launchList.setLaunch("No Launch Today");
                            launchStore.getLaunchList().add(launchList);
                            Today_Launch.add("No Launch Today");
                        }
                        realm_2.commitTransaction();
                    } catch (IOException e) {
                        Today_Launch.add(" !!!");
                        e.printStackTrace();
                    }

                    sendBroadcast(new Intent(getPackageName() + "Show_Launch_List")); // ?? 
                }
            }).start();
        } else {
            Launch_List_Adapter.clear();
            Launch_List_Adapter.add(
                    "? WI-FI       .");
        }
    }
}

From source file:com.egoists.coco_nut.android.util.EtcUtils.java

public static String getDateString(long millis) {
    String time = null;//from   ww w .  j ava2s  .c om

    if (Locale.getDefault().equals(Locale.KOREA) || Locale.getDefault().equals(Locale.KOREAN)) {
        SimpleDateFormat formatter = new SimpleDateFormat("yyyy/MM/dd a hh:mm", Locale.getDefault());
        time = formatter.format(new Date(millis));
    } else {
        SimpleDateFormat formatter = new SimpleDateFormat("yyyy/MM/dd a hh:mm", Locale.getDefault());
        time = formatter.format(new Date(millis));
    }

    return time;
}

From source file:egovframework.oe1.utl.fcc.service.EgovNumberUtil.java

/**
 * ?? ??    ? 20081212 ??/*  www .  j  av  a2 s. c  o m*/
 * '2008-12-12'  
 * @param srcNumber
 *        - ?
 * @return String
 * @exception MyException
 * @see
 */
public static String getNumToDateCnvr(int srcNumber) {

    String pattern = null;
    String cnvrStr = null;

    String srcStr = String.valueOf(srcNumber);

    // Date ? 8? ? 14? ?
    if (srcStr.length() != 8 && srcStr.length() != 14) {
        throw new IllegalArgumentException("Invalid Number: " + srcStr + " Length=" + srcStr.trim().length());
    }

    if (srcStr.length() == 8) {

        pattern = "yyyyMMdd";

    } else if (srcStr.length() == 14) {

        pattern = "yyyyMMddhhmmss";
    }

    SimpleDateFormat dateFormatter = new SimpleDateFormat(pattern, Locale.KOREA);

    Date cnvrDate = null;

    try {
        cnvrDate = dateFormatter.parse(srcStr);

    } catch (ParseException e) {

        //log.debug(e.getMessage()); 
        log.trace(e.getMessage());
    }

    cnvrStr = String.format("%1$tY-%1$tm-%1$td", cnvrDate);

    return cnvrStr;

}

From source file:com.egoists.coco_nut.android.util.EtcUtils.java

public static String getSimpleDateString(long millis) {
    String time = null;//from  w ww .java2  s  .c  o m

    if (Locale.getDefault().equals(Locale.KOREA) || Locale.getDefault().equals(Locale.KOREAN)) {
        SimpleDateFormat formatter = new SimpleDateFormat("yyyy M d? a h mm",
                Locale.getDefault());
        time = formatter.format(new Date(millis));
    } else {
        time = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.SHORT, Locale.getDefault())
                .format(new Date(millis));
    }

    return time;
}

From source file:com.nbplus.vbroadlauncher.BaseActivity.java

@Override
public void onInit(int status) {
    Log.d(TAG, "> TTS onInit()");

    LauncherSettings.getInstance(this).setIsCheckedTTSEngine(true);
    if (status != TextToSpeech.SUCCESS) {
        Log.e(TAG, String.format("TextToSpeechManager.onInit(%d) fail!", status));
        Log.d(TAG, "   ??.... ? ??...");
        if (mcheckText2SpeechLister != null) {
            mcheckText2SpeechLister.onCheckResult(null);
            if (mText2Speech != null)
                mText2Speech.shutdown();
            mText2Speech = null;//from   ww  w. j  av  a 2s  .c o m
        }
        showText2SpeechAlertDialog();
    } else {
        int result = mText2Speech.setLanguage(Locale.KOREA);
        if (result == TextToSpeech.LANG_MISSING_DATA || result == TextToSpeech.LANG_NOT_SUPPORTED) {
            Log.e(TAG, String.format("TextToSpeech.setLanguage(%s) fail!", Locale.KOREA.getDisplayName()));
            Log.d(TAG, "   ??.... ? ??...");
            if (mcheckText2SpeechLister != null) {
                mcheckText2SpeechLister.onCheckResult(null);
                if (mText2Speech != null)
                    mText2Speech.shutdown();
                mText2Speech = null;
            }
            showText2SpeechAlertDialog();
        } else {
            if (mcheckText2SpeechLister != null) {
                mcheckText2SpeechLister.onCheckResult(mText2Speech);
            } else {
                if (mcheckText2SpeechLister != null) {
                    mcheckText2SpeechLister.onCheckResult(null);
                    if (mText2Speech != null)
                        mText2Speech.shutdown();
                    mText2Speech = null;
                }
            }
        }
    }
}

From source file:com.seongil.avatarpicker.AbstractAvatarPicker.java

private void createTempFile() {
    final File directory = getDirectoryFile();
    final String timeStamp = new SimpleDateFormat(TIMESTAMP_FORMAT, Locale.KOREA).format(new Date());
    try {//from  w  w w  . j  a  v a2  s.co m
        File tempFile = File.createTempFile(timeStamp, ".jpeg", directory);
        mUri = FileProvider.getUriForFile(getContext(), getFileProviderAuthorities(), tempFile);
    } catch (IllegalArgumentException | IOException e) {
        showToastMsg(e.getMessage());
    }
}

From source file:com.example.seonoh2.smarttoliet01.beacon.RecoMonitoringActivity.java

@Override
public void didDetermineStateForRegion(RECOBeaconRegionState recoRegionState, RECOBeaconRegion recoRegion) {
    Log.i("RecoMonitoringActivity", "didDetermineStateForRegion()");
    Log.i("RecoMonitoringActivity",
            "region: " + recoRegion.getUniqueIdentifier() + ", state: " + recoRegionState.toString());

    if (mInitialSetting) {
        mMonitoringListAdapter.updateRegion(recoRegion, recoRegionState, 0,
                new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.KOREA).format(new Date()));
        mMonitoringListAdapter.notifyDataSetChanged();
    }//from   w w w .  j  ava  2 s.c o m

    mInitialSetting = false;
    //Write the code when the state of the monitored region is changed
}

From source file:com.kth.baasio.baassample.utils.EtcUtils.java

public static String getSimpleDateString(long millis) {
    String time = null;/*from   w  w  w.ja  va 2s  . c o  m*/

    if (Locale.getDefault().equals(Locale.KOREA) || Locale.getDefault().equals(Locale.KOREAN)) {
        SimpleDateFormat formatter = new SimpleDateFormat("M d? a h mm", Locale.getDefault());
        time = formatter.format(new Date(millis));
    } else {
        time = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.SHORT, Locale.getDefault())
                .format(new Date(millis));
    }

    return time;
}