This file contains hidden or 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
<최상위 build.gradle> | |
buildscript { | |
apply from: 'versions.gradle' | |
repositories { | |
jcenter() | |
google() | |
mavenCentral() |
This file contains hidden or 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 class ApplicationTest extends ApplicationTestCase<Application> { | |
public ApplicationTest() { | |
super(Application.class); | |
} | |
public void testDate(){ | |
System.out.println("Current : " + currentDate()); | |
System.out.println("Diff : " + calculateDiffDate(1489382310900L)); | |
System.out.println("CountTime : " + parseCountTime(40)); | |
System.out.println("CountTime : " + parseCountTime(60 * 1 + 2)); |
This file contains hidden or 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 Bitmap getCircleBitmap(Bitmap bitmap, int strockWidth, int circleColor) { | |
Bitmap output = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Bitmap.Config.ARGB_8888); | |
Canvas canvas = new Canvas(output); | |
Paint paint = new Paint(); | |
Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight()); | |
paint.setAntiAlias(true); | |
canvas.drawARGB(0, 0, 0, 0); | |
paint.setColor(0xFFFFFFFF); | |
int size = (bitmap.getWidth()/2); | |
canvas.drawCircle(size, size, size, paint); |
This file contains hidden or 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 int checkPassword(String password){ | |
String charRegex = "a-zA-Z"; | |
String numRegex = "0-9"; | |
String specialRegex = "\\~`!@#\\$%\\^&\\*\\(\\)\\-+\\|\\{\\}\\[\\];\\\\:'\"<>\\?,./_="; | |
//Number Only, Char Only, Special Only | |
if(Pattern.matches(String.format("^[%s]*$",charRegex), password) || | |
Pattern.matches(String.format("^[%s]*$",numRegex), password) || |
This file contains hidden or 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 final String MAIN_Key = "pref" | |
private void getPreferences(){ | |
SharedPreferences pref = getSharedPreferences(MAIN_Key, MODE_PRIVATE); | |
pref.getString("", ""); | |
} | |
private void savePreferences(){ | |
SharedPreferences pref = getSharedPreferences(MAIN_Key, MODE_PRIVATE); | |
SharedPreferences.Editor editor = pref.edit(); |
This file contains hidden or 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
import java.io.File; | |
import java.io.FileInputStream; | |
import java.io.FileNotFoundException; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.util.zip.ZipEntry; | |
import java.util.zip.ZipOutputStream; | |
public class HZipUtil { | |
This file contains hidden or 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
Environment.getExternalStorageDirectory() |
This file contains hidden or 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 class HThumbnailUtil { | |
public Bitmap getThumbnail(String filePath){ | |
Bitmap bit = ThumbnailUtils.createVideoThumbnail(filePath, android.provider.MediaStore.Video.Thumbnails.FULL_SCREEN_KIND); | |
if(bit == null){ | |
MediaMetadataRetriever m = new MediaMetadataRetriever(); | |
m.setDataSource(filePath); | |
bit = m.getFrameAtTime(); | |
} |
This file contains hidden or 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
http://developer.android.com/guide/components/bound-services.html |
This file contains hidden or 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 class WebViewTestActivity extends ActionBarActivity { | |
private final Handler handler = new Handler(); | |
private WebView webView; | |
private class HyuJSIntreface { | |
@JavascriptInterface | |
public void JStoAndroidSendMessage(final String arg) { // must be final | |
handler.post(new Runnable() { | |
@Override |
NewerOlder