백종원의 스테이크 비법 정리본입니다.


1. 시즈닝


1.1 양면에 소금&(굵은)후추가루 넉넉히 뿌리기 (뿌린 후 두드리기)




1.2 칼집 내주기(힘줄 등에)




1.3 양면에 올리브유 바르기(올리브유 없으면 식용유)




1.4 냉장실에 한시간 정도 숙성


2. 시어링


2.1 올리브유는 넉넉히 두르고 연기가 살짝 나려할 때 고기 올리기




2.2 고기 올리고 튀기듯이 굽기(왠만하면 안탐)






2.3 후라이팬을 기울여 옆면도 익혀줌




2.4 탄듯할때까지 굽기


2.5 뒤집은 후 반대쪽도 비슷하게 익히기




2.6 그 뒤에 불을 줄인 후 익히기


2.7 굽기 정도를 생각해서 고기 눌러본 후 꺼내기


  - 엄지+검지를 붙이고 손바닥을 눌러보면 = 레어

  - 엄지+중지를 붙이고 손바닥을 눌러보면 = 미디엄

  - 엄지+약지를 붙이고 손바닥을 눌러보면 = 웰던


3. 레스팅(5~7분)


4. 자르기


내가 보려 정리해보는 도서 목차


핵심만 골라 배우는 안드로이드 스튜디오 3 & 프로그래밍 (닐 스미스/심재철) - Jpub


목차



CHAPTER 1 개요 _ 1


 

CHAPTER 2 안드로이드 스튜디오 개발 환경 구성하기 _ 6


 

CHAPTER 3 안드로이드 스튜디오로 첫 번째 애플리케이션 만들기 _ 28


 

CHAPTER 4 안드로이드 스튜디오 UI 둘러보기 _ 46


 

CHAPTER 5 안드로이드 스튜디오에서 AVD 생성하기 _ 58


 

CHAPTER 6 안드로이드 스튜디오 AVD 에뮬레이터 사용과 구성하기 _ 75


 

CHAPTER 7 실제 안드로이드 장치에서 애플리케이션 테스트하기 _ 86


 

CHAPTER 8 안드로이드 스튜디오 코드 편집기 _ 98


 

CHAPTER 9 안드로이드 아키텍처 개요 _ 111


 

CHAPTER 10 액티비티와 인텐트 개요 _ 117


 

CHAPTER 11 안드로이드 애플리케이션과 액티비티 생명주기 _ 122


 

CHAPTER 12 액티비티 상태 변화 처리하기 _ 128


 

CHAPTER 13 액티비티 상태 변화 예제 _ 138


 

CHAPTER 14 액티비티 상태를 저장하고 복원하기 _ 150


 

CHAPTER 15 안드로이드 뷰, 뷰 그룹, 레이아웃 _ 158


 

CHAPTER 16 안드로이드 스튜디오 레이아웃 편집기 살펴보기 _ 164


 

CHAPTER 17 안드로이드 ConstraintLayout 개요 _ 177


 

CHAPTER 18 안드로이드 스튜디오에서 ConstraintLayout 사용하기 _ 185


 

CHAPTER 19 안드로이드 스튜디오에서 ConstraintLayout 체인과 비율 사용하기 _ 199


 

CHAPTER 20 ConstraintLayout 예제 프로젝트 _ 209


 

CHAPTER 21 직접 XML 레이아웃 작성하기 _ 224


 

CHAPTER 22 ConstraintSet으로 ConstraintLayout 관리하기 _ 230


 

CHAPTER 23 안드로이드 ConstraintSet 예제 프로젝트 _ 238


 

CHAPTER 24 안드로이드 이벤트 처리 개요 _ 247


 

CHAPTER 25 안드로이드 스튜디오의 Instant Run 사용하기 _ 257


 

CHAPTER 26 터치와 다중 터치 이벤트 처리하기 _ 263


 

CHAPTER 27 안드로이드 제스처 감지 클래스로 일반 제스처 처리하기 _ 272


 

CHAPTER 28 커스텀 제스처와 핀치 인식 구현하기 _ 280


 

CHAPTER 29 안드로이드 프래그먼트 개요 _ 295


 

CHAPTER 30 안드로이드 스튜디오에서 프래그먼트 사용하기 ― 예제 프로젝트 _ 305


 

CHAPTER 31 오버플로 메뉴 생성과 관리 _ 323


 

CHAPTER 32 안드로이드 전환 프레임워크 _ 335


 

CHAPTER 33 beginDelayedTransition을 사용한 안드로이드 전환 _ 348


 

CHAPTER 34 안드로이드 장면 전환 구현하기 _ 355


 

CHAPTER 35 플로팅 액션 버튼과 스낵바 사용하기 _ 365


 

CHAPTER 36 탭 인터페이스 생성하기 _ 379


 

CHAPTER 37 RecyclerView와 CardView 사용하기 _ 393


 

CHAPTER 38 RecyclerView와 CardView 예제 프로젝트 _ 399


 

CHAPTER 39 앱 바와 컬랩싱 툴바 레이아웃 사용하기 _ 411


 

CHAPTER 40 내비게이션 드로어 구현하기 _ 421


 

CHAPTER 41 안드로이드 스튜디오 마스터/디테일 플로 _ 430


 

CHAPTER 42 안드로이드 인텐트 개요 _ 444


 

CHAPTER 43 명시적 인텐트 예제 프로젝트 _ 451


 

CHAPTER 44 암시적 인텐트 예제 프로젝트 _ 463


 

CHAPTER 45 브로드캐스트 인텐트와 브로드캐스트 수신자 _ 474


 

CHAPTER 46 스레드와 스레드 핸들러 _ 488


 

CHAPTER 47 스타트 서비스와 바운드 서비스 개요 _ 499


 

CHAPTER 48 스타트 서비스 구현 예제 프로젝트 _ 506


 

CHAPTER 49 로컬 바운드 서비스 예제 프로젝트 _ 518


 

CHAPTER 50 원격 바운드 서비스 예제 프로젝트 _ 529


 

CHAPTER 51 안드로이드 7의 알림 개요 _ 537


 

CHAPTER 52 안드로이드 7 알림의 직접 응답 구현 _ 550


 

CHAPTER 53 안드로이드 스튜디오에서 Firebase 사용하기 _ 559


 

CHAPTER 54 Firebase 원격 알림 사용하기 _ 567


 

CHAPTER 55 안드로이드 7의 다중 창 지원 개요 _ 575


 

CHAPTER 56 다중 창 예제 프로젝트 _ 585


 

CHAPTER 57 안드로이드 SQLite 데이터베이스 개요 _ 593


 

CHAPTER 58 TableLayout과 TableRow 개요 _ 603


 

CHAPTER 59 안드로이드 SQLite 데이터베이스 예제 프로젝트 _ 611


 

CHAPTER 60 콘텐트 제공자 이해하기 _ 622


 

CHAPTER 61 콘텐트 제공자 구현하기 _ 627


 

CHAPTER 62 구글 클라우드 스토리지 액세스하기 _ 643


 

CHAPTER 63 안드로이드 스토리지 액세스 프레임워크 예제 프로젝트 _ 652


 

CHAPTER 64 비디오 재생 구현하기 _ 666


 

CHAPTER 65 카메라 인텐트를 사용한 비디오 녹화와 이미지 캡처 _ 675


 

CHAPTER 66 런타임 퍼미션 요청하기 _ 683


 

CHAPTER 67 안드로이드 오디오 녹음과 재생하기 _ 693


 

CHAPTER 68 구글 맵 API 사용하기 _ 707


 

CHAPTER 69 안드로이드 인쇄 프레임워크 사용하기 _ 727


 

CHAPTER 70 HTML과 웹 콘텐트 인쇄 예제 프로젝트 _ 738


 

CHAPTER 71 안드로이드 커스텀 문서 인쇄 _ 750


 

CHAPTER 72 안드로이드 지문 인증 구현하기 _ 768


 

CHAPTER 73 서로 다른 안드로이드 장치와 화면 처리하기 _ 787


 

CHAPTER 74 안드로이드 애플리케이션 릴리스하기 _ 793


 

CHAPTER 75 구글 플레이 인앱 결제를 애플리케이션에 통합하기 _ 804


 

CHAPTER 76 안드로이드 스튜디오의 그래들 개요 _ 829


 

CHAPTER 77 안드로이드 스튜디오 그래들 빌드 예제 프로젝트 _ 841


 

찾아보기 _ 853 
 ※ 부록 A, B는 독자들의 이해를 위해 옮긴이가 작성한 특별 부록입니다. 
아래의 사이트에서 예제 프로젝트 파일과 함께 무료로 다운로드받으실 수 있습니다.

 

APPENDIX A 코틀린 핵심 파악하기: 개요와 실습 환경 구축


 

APPENDIX B 코틀린 핵심 파악하기: 구성 요소와 문법


 



'Android개발' 카테고리의 다른 글

[Android] DataBinding Library 3  (0) 2018.06.12
[Android] DataBinding Library 2  (0) 2018.06.12
[Android] DataBinding Library 1  (2) 2018.06.12
[Android] 프로세스(process) 및 스레드(thread)  (0) 2018.06.08
[Android] 서비스 (Service)  (0) 2018.06.08

Android 앱 개발을 하면서 서버와 통신을 위해 네트워크 기능을 쓸 경우가 대다수이다.


기존 네트워크 기능을 위해 HttpURLConnectionHttpClient (OS 6.0 부터 삭제) 등이 쓰여왔고, OS 3.0 (API 11) 이후에 


NetworkOnMainThreadException 를 피하고자 Thread, AsyncTask 등을 사용하기도 했다.


그 후 여러 편의성을 제공하는 통신 라이브러리 들이 등작하였다. OkHttp, Volley (설명), Retrofit ... (라이브러리 비교)


그 중에서 최근까지 많이 쓰이고 있는 Retrofit에 대해서 초간단 맛만 보기로 하자.


0. 준비물 : API, Android Studio, 잠시나마 집중하겠다는 마음가짐.


1. API

직접 준비하기 어려울 경우 공개되어 있는 고마운 API들을 찾아서 사용해보자. 

예를 들면 빗썸 OPEN API 같은... 


연습을 위해 https://api.bithumb.com/public/ticker/{currency}를 사용해보자.


2. build.gradle 설정

dependencies에 retrofit 최신버전을 추가한다. (Gson 사용을 위해 Gson 관련 추가한다.)


dependencies {
    compile 'com.google.code.gson:gson:2.8.2'                 // Gson 사용시
    compile 'com.squareup.retrofit2:retrofit:2.3.0'
    compile 'com.squareup.retrofit2:converter-gson:2.3.0'     // Gson 처리시
    compile 'com.squareup.retrofit2:converter-scalars:2.3.0'  // String 처리시
    ...
}


3. Data 클래스 

결과 JSON에 맞춰 Data 클래스를 생성하자. (Json to Java Object 서비스)


public class BithumbTickerData {
    @SerializedName("opening_price")
    public String openingPrice;
    @SerializedName("closing_price")
    public String closingPrice;
    @SerializedName("min_price")
    public String minPrice;
    @SerializedName("max_price")
    public String maxPrice;
    @SerializedName("average_price")
    public String averagePrice;
    @SerializedName("units_traded")
    public String unitsTraded;
    @SerializedName("volume_1day")
    public String volume1day;
    @SerializedName("volume_7day")
    public String volume7day;
    @SerializedName("buy_price")
    public String buyPrice;
    @SerializedName("sell_price")
    public String sellPrice;
    @SerializedName("date")
    public long date;
}

public class BithumbTicker {
    @SerializedName("status")
    public String status;
    @SerializedName("data")
    public BithumbTickerData data;
}


4. interface 생성

API Method 방식 및 Path에 대해서 정의하자.


    public interface OpenApiService {
        @GET("public/ticker/{path}")
        Call tickerInfo(@Path("path") String path);
    }


5.1. Retrofit 초기화

Retrofit 생성 후 사용할 interface를 통해 서비스를 만들자. (Response를 String 형태로 받고 싶다면 ScalarsConverterFactory 사용)


        Retrofit retrofit = new Retrofit.Builder()
                .baseUrl("https://api.bithumb.com/")
                .addConverterFactory(GsonConverterFactory.create())        // Gson 처리시
                //.addConverterFactory(ScalarsConverterFactory.create())  // String 등 처리시
                .build();
        OpenApiService openApiService = retrofit.create(OpenApiService.class);


5.2. Call 생성

만들어 둔 interface를 호출하는 Call을 생성하자.


        Call tickerInfo = openApiService.tickerInfo("BTC");


5.3. Callback 정의

enqueue() 를 통해 Callback에 대해서 정의하자.


        tickerInfo.enqueue(new Callback() {
            @Override
            public void onResponse(Call call, Response response) {
                Toast.makeText(TestMainActivity.this, response.body().toString(), Toast.LENGTH_SHORT).show();
            }

            @Override
            public void onFailure(Call call, Throwable t) {
                Toast.makeText(TestMainActivity.this, t.toString(), Toast.LENGTH_SHORT).show();
            }
        });


이상으로 간단하게 Retrofit 시식을 마칠까 한다.




Retrofit 로그 보는 법과 Proguard 설정에 대해서 추가한다.


6. 로그 보는 법

build.gradle에 아래와 같이 추가한다.


dependencies {
        compile 'com.squareup.okhttp3:logging-interceptor:3.9.1'
        ...
}


그리고 Retrofit 초기화 하는 부분에 아래와 같이 추가한다.


        HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();
        interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
        OkHttpClient client = new OkHttpClient.Builder().addInterceptor(interceptor).build();

        Retrofit.Builder retrofitBuilder = new Retrofit.Builder().baseUrl(url);

        if(BuildConfig.DEBUG) {
            retrofitBuilder.client(client);
        }

        if(!isString) {
            retrofitBuilder.addConverterFactory(GsonConverterFactory.create());
        } else {
            retrofitBuilder.addConverterFactory(ScalarsConverterFactory.create());
        }
        Retrofit retrofit = retrofitBuilder.build();


기존과 비교했을 때 OkhttpClient 라는 놈을 Retrofit Builder에 추가하는 모습이 보인다.

개인적으로 디버그 모드일때만 로그를 보기 위해 BuildConfig.DEBUG 로 분기 처리를 하였다.

그리고 로그 수준은 아래와 같다.


public final class HttpLoggingInterceptor implements Interceptor {
   ...
  public enum Level {
    /** No logs. */
    NONE,
    /**
     * Logs request and response lines.
     *
     * 

Example: *

{@code
     * --> POST /greeting http/1.1 (3-byte body)
     *
     * <-- 200 OK (22ms, 6-byte body)
     * }
*/ BASIC, /** * Logs request and response lines and their respective headers. * *

Example: *

{@code
     * --> POST /greeting http/1.1
     * Host: example.com
     * Content-Type: plain/text
     * Content-Length: 3
     * --> END POST
     *
     * <-- 200 OK (22ms)
     * Content-Type: plain/text
     * Content-Length: 6
     * <-- END HTTP
     * }
*/ HEADERS, /** * Logs request and response lines and their respective headers and bodies (if present). * *

Example: *

{@code
     * --> POST /greeting http/1.1
     * Host: example.com
     * Content-Type: plain/text
     * Content-Length: 3
     *
     * Hi?
     * --> END POST
     *
     * <-- 200 OK (22ms)
     * Content-Type: plain/text
     * Content-Length: 6
     *
     * Hello!
     * <-- END HTTP
     * }
*/ BODY }

위 소스를 보면 로그 레벨은 NONE, BASIC, HEADERS, BODY 로 이루어져 있다. 필요에 따라 설정하면 된다.

- NONE : No logs.

- BASIC : Logs request and response lines.

- HEADERS : Logs request and response lines and their respective headers.

- BODY : Logs request and response lines and their respective headers and bodies (if present).


위와 같이 하였을 때 로그는 아래와 같이 떨어진다.


12-26 17:53:03.411 15500-15624/com.test.testblabla D/OkHttp: --> GET https://api.bithumb.com/public/ticker/BTC
12-26 17:53:03.411 15500-15624/com.test.testblabla D/OkHttp: --> END GET
12-26 17:53:04.101 15500-15624/com.test.testblabla D/OkHttp: <-- 200 https://api.bithumb.com/public/ticker/BTC (693ms)
12-26 17:53:04.101 15500-15624/com.test.testblabla D/OkHttp: date: Tue, 26 Dec 2017 08:53:04 GMT
12-26 17:53:04.101 15500-15624/com.test.testblabla D/OkHttp: content-type: application/json
12-26 17:53:04.101 15500-15624/com.test.testblabla D/OkHttp: set-cookie: __cfduid=dd24fcf80c27cf456c60e275644e40a0e1514278384; expires=Wed, 26-Dec-18 08:53:04 GMT; path=/; domain=.bithumb.com; HttpOnly
12-26 17:53:04.101 15500-15624/com.test.testblabla D/OkHttp: access-control-allow-origin: *
12-26 17:53:04.101 15500-15624/com.test.testblabla D/OkHttp: access-control-allow-methods: *
12-26 17:53:04.101 15500-15624/com.test.testblabla D/OkHttp: access-control-allow-headers: *
12-26 17:53:04.101 15500-15624/com.test.testblabla D/OkHttp: set-cookie: ci_session=a%3A5%3A%7Bs%3A10%3A%22session_id%22%3Bs%3A32%3A%22cf7e414ece7af81b8a35a0cdcaccd317%22%3Bs%3A10%3A%22ip_address%22%3Bs%3A12%3A%221.227.62.114%22%3Bs%3A10%3A%22user_agent%22%3Bs%3A12%3A%22okhttp%2F3.9.1%22%3Bs%3A13%3A%22last_activity%22%3Bi%3A1514278384%3Bs%3A9%3A%22user_data%22%3Bs%3A0%3A%22%22%3B%7D4ca3239efcb6f4f81c5c8703401ade3bbef4e9fd; expires=Tue, 26-Dec-2017 10:53:04 GMT; Max-Age=7200; path=/
12-26 17:53:04.101 15500-15624/com.test.testblabla D/OkHttp: server: cloudflare-nginx
12-26 17:53:04.101 15500-15624/com.test.testblabla D/OkHttp: cf-ray: 3d32cec0fef194b7-NRT
12-26 17:53:04.101 15500-15624/com.test.testblabla D/OkHttp: {"status":"0000","data":{"opening_price":"19157000","closing_price":"20632000","min_price":"18853000","max_price":"21400000","average_price":"19977707.8742","units_traded":"26050.76859352","volume_1day":"26050.76859352","volume_7day":"176662.05473862","buy_price":"20620000","sell_price":"20623000","date":"1514278384536"}}
12-26 17:53:04.101 15500-15624/com.test.testblabla D/OkHttp: <-- END HTTP (323-byte body)

참조링크1 : https://github.com/square/okhttp/tree/master/okhttp-logging-interceptor

참조링크2 : https://stackoverflow.com/questions/32514410/logging-with-retrofit-2


7. Progaurd 설정

앱을 실제 signed release apk 만들시 Progaurd 사용하는데, 이때 Retrofit 사용시 아래와 같이 proguard.pro 파일에 추가해준다.


# Platform calls Class.forName on types which do not exist on Android to determine platform.
-dontnote retrofit2.Platform
# Platform used when running on Java 8 VMs. Will not be used at runtime.
-dontwarn retrofit2.Platform$Java8
# Retain generic type information for use by reflection by converters and adapters.
-keepattributes Signature
# Retain declared checked exceptions for use by a Proxy instance.
-keepattributes Exceptions


Retrofit 로그에서 문제가 될시 아래도 추가해 보자.


-dontwarn okhttp3.**
-dontwarn okio.**
-dontwarn javax.annotation.**
# A resource is loaded with a relative path so the package of this class must be preserved.
-keepnames class okhttp3.internal.publicsuffix.PublicSuffixDatabase

참조링크1 : http://square.github.io/retrofit/

참조링크2 : https://github.com/square/okhttp

+ Recent posts