This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- For holo theme --> | |
<drawable name="screen_background_holo_light">#fff3f3f3</drawable> | |
<drawable name="screen_background_holo_dark">#ff000000</drawable> | |
<color name="background_holo_dark">#ff000000</color> | |
<color name="background_holo_light">#fff3f3f3</color> | |
<color name="bright_foreground_holo_dark">@android:color/background_holo_light</color> | |
<color name="bright_foreground_holo_light">@android:color/background_holo_dark</color> | |
<color name="bright_foreground_disabled_holo_dark">#ff4c4c4c</color> | |
<color name="bright_foreground_disabled_holo_light">#ffb2b2b2</color> | |
<color name="bright_foreground_inverse_holo_dark">@android:color/bright_foreground_holo_light</color> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE); | |
if (imm.isAcceptingText()) { | |
writeToLog("Software Keyboard was shown"); | |
} else { | |
writeToLog("Software Keyboard was not shown"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PackageManager pm = getPackageManager(); | |
ComponentName newComposer = new ComponentName(getApplicationContext(), ComposerActivity.class); | |
pm.setComponentEnabledSetting( | |
newComposer, | |
is_new_composer ? PackageManager.COMPONENT_ENABLED_STATE_ENABLED : PackageManager.COMPONENT_ENABLED_STATE_DISABLED, | |
PackageManager.DONT_KILL_APP); | |
ComponentName oldComposer = new ComponentName(getApplicationContext(), SendSMSActivity.class); | |
pm.setComponentEnabledSetting( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public boolean isPhoneNumber(String number) { | |
if (number == null || TextUtils.isEmpty(number)) { | |
return false; | |
} | |
// return Pattern.matches(PHONE_NUMBER_PATTERN, number.replace("-", "")); | |
return android.util.Patterns.PHONE.matcher(number).matches(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static boolean hasPermission(Context context, String permission) { | |
int res = context.checkCallingOrSelfPermission(permission); | |
return (res == PackageManager.PERMISSION_GRANTED); | |
} | |
@SuppressLint("NewApi") | |
public static String getUserDisplayName(Context context) { | |
if (Build.VERSION.SDK_INT < 14) return ""; | |
if (!hasPermission(context, "android.permission.READ_PROFILE")) return ""; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Copyright (C) 2013-2014. Jongin Oh | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@SuppressLint("NewApi") | |
public class ContactsActivity extends ActionBarActivity implements View.OnClickListener, AdapterView.OnItemClickListener, SearchView.OnQueryTextListener, SearchView.OnCloseListener { | |
@SuppressLint("NewApi") | |
@Override | |
public boolean onCreateOptionsMenu(Menu menu) { | |
// Inflate the menu; this adds items to the action bar if it is present. | |
getMenuInflater().inflate(R.menu.contacts, menu); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// from: http://www.senun.com/Left/Programming/Java/Jsp/jsp_syntax_hangul.htm | |
// 유니코드를 한글코드로 변환 | |
protected String uni2ksc (String Unicodestr) throws UnsupportedEncodingException { | |
return new String (Unicodestr.getBytes("8859_1"),"KSC5601"); | |
} | |
// 한글코드를 유니코드로 변환 | |
protected String ksc2uni(String str) throws UnsupportedEncodingException { | |
return new String( str.getBytes("KSC5601"), "8859_1"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* (1)Get tweets by search keyword and (2)Stemming(Korean), (3)save to mysql finally | |
*/ | |
var Promise = require('bluebird'); | |
var TwitterKoreanText = require('twtkrjs'); | |
var twitterKoreanText = new TwitterKoreanText({ | |
stemmer: true, // (optional default: true) | |
normalizer: true, // (optional default: true) |
OlderNewer