Android

Dialogs (AlertDialog, DialogFragment)

  # Dialogs (android developers) https://developer.android.com/guide/topics/ui/dialogs#java   # AlertDialog (멈춤보단 천천히라도) https://webnautes.tistory.com/1094   예 아니오 다이얼로그 리스트 다이얼로그 입력 창 예제 다중 선택 다이얼로그 로그인 창 다이얼로그 DialogFragment (Activity에서 호출하는 경우) DialogFragment (Fragment 에서 호출하는 경우)         예 아니오 다이얼로그   AlertDialog.Builder dialog = new AlertDialog.Builder(MainActivity.this); dialog.setTitle(“타이틀”); dialog.setMessage(“콘텐트”); dialog.setPositiveButton(“예”, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { Toast.makeText(getApplicationContext(),”예를 선택했습니다.”,Toast.LENGTH_LONG).show(); } }); dialog.setNegativeButton(“아니오”, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { Toast.makeText(getApplicationContext(),”아니오를 선택했습니다.”,Toast.LENGTH_LONG).show(); } }); dialog.show();   <?xml version=”1.0″ encoding=”utf-8″?> <RelativeLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:layout_width=”fill_parent” android:layout_height=”fill_parent”…

Read More
Android

SharedPreferences

  Shared 라는 xml 파일에 저장 (onDestroy에서 사용) SharedPreferences pref = getSharedPreferences(“Shared”, Activity.MODE_PRIVATE); SharedPreferences.Editor editor = pref.edit(); editor.putString(“myText”, value); editor.commit();   불러오기 (OnCreate 에서 사용) SharedPreferences pref = getSharedPreferences(“Shared”, Activity.MODE_PRIVATE); String myText = pref.getGetstring(“myText”, 0);   값 삭제 editor.remove(“myText”);  // myText 라는 키 값 삭제 editor.clear();  // 모두 삭제   // Fragment 는 onCreateView, onDestroyView   [안드로이드] SharedPreference 사용 방법 https://swalloow.tistory.com/59   안드로이드 SharedPreferences 사용법 http://zeany.net/24   홍드로이드 유튜브 (SharedPreferences) https://youtu.be/-2QPmS4OWos   홍드로이드 github https://github.com/hongdroid94  

Read More
Android

Intent

  Intent 로 값 전달하기   // 전달하는 쪽 Intent intent = new Intent(this, ResultActivity.class); myIntent.putExtra(“name”, “Hong gil-dong”); myIntent.putExtra(“age”, 30); startActivity(intent);   // 받는 쪽 Intent intent = getIntent(); Bundle extras = getIntent().getExtras(); String name = extras.getString(“name”); String name = extras.getInt(“age”); or String name = getIntent().getStringExtra(“name”); int age = getIntent().getStringExtra(“age”);   // 키가 있는지 검사 if (intent.hasExtra(“name”)) { }    

Read More
Android

Notification

    public void ShowNotification() { NotificationManager notificationManager = (NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE); // 채널을 생성하고 시스템에 등록 (오레오 API 26 이상부터는 채널 필요) if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { CharSequence name = “My Channel 1”; String description = “My Channel 1 Description”; int importance = NotificationManager.IMPORTANCE_HIGH; // HIGH 옵션은 팝업 표시됨 NotificationChannel channel = new NotificationChannel(“12345”, name, importance); // 12345는 채널 ID channel.setDescription(description); notificationManager.createNotificationChannel(channel); // 채널을 시스템에 등록 } // 알림 생성 NotificationCompat.Builder builder = new NotificationCompat.Builder(this, “12345”) // 12345는 채널 ID .setSmallIcon(R.drawable.ic_launcher_background) .setContentTitle(“My notification”) .setContentText(“Much longer text that cannot fit one line…”)…

Read More
JAVASCRIPT

자바스크립트 기초 강의 (드림코딩 by 엘리)

    2강. script async 와 defer의 차이점   1. 참조 사이트 developer.mozilla.org 공식 (설명이 더 자세함) www.w3schools.com 비공식   2. 콘솔에 출력 console.log(“hello”)   3. async, defer 차이 ————————————————————————- <head> <script src=”main.js”></script> </head> parsing HTML blocked fetching js executing js parsing HTML 단점 : js 파일 용량이 크다면 화면 표시까지 오래 걸릴 수 있음   ——————————————————————– <body> … <script src=”main.js”></script> // body 태그 마지막에 위치 </body> parsing HTML fetching js executing js 단점 : 자바스크립트에 많이 의존적인 사이트라면 의미있는 정보가 표시되기까지 오래걸릴 수 있음.   ————————————————————————————-   <script async…

Read More
[유튜브] 날라리데이브

영어 표현 배우기 [I could use, I don’t want to]

    [VLOG] 리얼 먹방 중 영어 표현 배우기 [WANT 를 사용하지 않은 ~ 하고 싶다]     UNDIES! 속옷 So whatever happened there was… 무슨 일이 있었던 거냐면 So I fucked up. 그래서 망쳤지 뭐. And I wasted the whole scene 그리고 장면을 통째로 날린 거지     But I could surely use a day-off under weather like this. 이런 날씨에는 하루 정도 쉬어도 좋을 것 같아 I could use ~ : ~ 하면 좋겠다 ex. I could use some help here! 도움 좀 주면 좋겠는데! I could surely…

Read More
링크

윈도우용 FFmpeg

  윈도우용 FFmpeg   # 다운로드 방법 ffmpeg 다운로드 사이트 -> 윈도우 아이콘 -> Windows EXE Files -> Windows builds from gyan.dev -> ffmpeg-git-full.7z   1. 파일을 다운로드 한다. 2. C:\ffmpeg 에 압축을 푼다. 3. 관리자 권한으로 실행하고 환경 변수를 등록한다. setx /m PATH “C:\ffmpeg\bin;%PATH%”  4. 컴퓨터를 재시작하고 버전을 확인한다. ffmpeg -version        1. MP3 로 변환 ffmpeg -i testing.m4v -b:a 192K -vn testing.mp3 -b:a 192K 비트레이트:오디오 192K -vn 비디오는 스킵    2. MP3 분할 ffmpeg -i in.m4a -c copy -f segment -segment_time 300 -segment_start_number 1 out%03d.m4a -c copy…

Read More