본문 바로가기
[RxJava] #8 테스팅과 Flowable 8.1. JUnit 5 활용 -JUnit 5 의 가장 큰 특징은 모듈화.JUnit 4 까지는 단일 jar 파일로 구성되었다. -JUnit 5 = JUnit Platform + JUnit Jupiter + JUnit Vintage 처음 JUnit 5 를 활용하는 개발자는 Jupiter 만 참조하면 된다, Jupiter 는 내부적으로 JUnit Platform 을 의존한다.JUnit Vintage 는 JUnit 3 혹은 JUnit 4 에서 작성한 테스트 코드를 JUnit 5 로 실행할 때 필요하다. -다음과 같이 gradle 에 설정이 필요하다.// Version 은 알아서 최신으로! testCompile ‘org.junit.jupiter:junit-jupiter-api:5.0.0-RC2’testRuntim.. 2019. 6. 12.
[RxJava] #7 디버깅과 예외 처리 7.1. 디버깅 7.1.1. doOnNext(), doOnComplete(), doOnError() 함수 - onNext, onError, onComplete 에 대해 doOnNext(), doOnComplete(), doOnError() 가 매핑된다. 7.1.2. doOnEach() 함수 - doOnEach 는 onNext, onComplete, onError 이벤트를 한번에 처리할 수 있어 편하다. noti.isOnNext(), noti.isOnComplete(), noti.isOnError() 를 통해 상태를 조회할 수 있다. onNext() 함수의 경우 getValue() 호출하면 발행한 값을 얻을 수 있고, onError() 함수의 경우 getError() 함수를 호출하면 Throwable 객체.. 2019. 6. 11.
[RxJava] #4 리액티브 연산자의 활용 4.1. 생성 연산자 -생성 연산자의 역할은 데이터 흐름을 만드는 것이다.간단하게 Observable, Single, Maybe 객체 등을 만든다고 생각하면 된다. 4.1.1. interval() 함수 -일정 시간 간격으로 데이터 흐름을 생성한다.주어진 시간 간격으로 0부터 1씩 증가하는 Long 객체를 반환한다. -interval() 함수는 기본적으로 영원히 지속 실행되기 때문에 폴링 용도로 많이 사용된다.수행은 RxComputationalThreadPool 에서 수행된다.interval 값이 초기 지연값으로도 활용된다. 4.1.2. timer() 함수 -interval 함수와 유사하지만 한 번만 실행하는 함수.일정 시간이 지난 후에 한 개의 데이터를 발행하고 onComplete() 이벤트가 발생한다... 2019. 6. 5.
[Android] SMS Retriever API - SMS 권한 없이 인증번호 읽어오기! [Android] SMS Retriever API - SMS 권한 없이 인증번호 읽어오기! https://developers.google.com/identity/sms-retriever/ -SMS Retriever API 를 사용하면 SMS Permission 이 없어도 인증번호를 읽어올 수 있다.덧붙여 SMS Retriever API 는 SMS Verification 에 대한 녀석으로 권한 없이 “PhoneNumber” 까지도 얻어올 수 있다.그러나 예상했겠지만, 아무것도 하지 않고 그냥 읽어올 수 있는 것은 아니다. 우선 SMS 정보 읽어오기의 Key Idea 는.. Server 에서 인증코드를 내려줄 때 특정 Hash 값을 함께 내려주고, ( app 의 package name 과 sign key 조.. 2019. 1. 18.
[ruby] download and parse to json [ruby] download and parse to json require "rubygems"require "json"require "net/http"require "uri" uri = URI.parse("http://address") http = Net::HTTP.new(uri.host, uri.port)request = Net::HTTP::Get.new(uri.request_uri) response = http.request(request) if response.code == "200" result = JSON.parse(response.body) result.each do |doc| puts doc["id"] #reference properties like this puts doc # this is.. 2018. 4. 3.
[Kotlin Tutorial] Kotlin 소개 - Kotlin : what and why [Kotlin Tutorial] Kotlin 소개 - Kotlin : what and why 참조 : Kotlin in Action -Kotlin 은 Java platform 을 targeting 한 새로운 프로그래밍 언어.Java 코드와 함께 쓰일 수 있다.Android 개발 뿐만 아니라 Server-side 개발에도 쓰일 수 있다. -Java 의 iib, framework 와 함께 쓰일 수 있고, Java 와 비교해 Performance 도 거의 동일하다. 1.1. A Taste of Kotlin -http://try.kotl.in 을 통해 코드 실습을 할 수 있다. -data class Person(val name: String, val age: Int? = null) fun main(args: A.. 2017. 7. 12.
[android] CircularRevealEffect Basic Simple Example [android] Circular Reveal Effect Basic Simple Example - API Level 21 에 등장! ( 5.0, MOS ) - Animator animator = ViewAnimationUtils.createCircularReveal( shape, // animation target view shape.getWidth(), // circle center x 0, // circle center y 0, // circle start radius (float) Math.hypot(shape.getWidth(), shape.getHeight())); // circle end radiusanimator.setInterpolator(new AccelerateDecelerateInt.. 2017. 5. 24.
[Java] Condition 은 어떻게 쓰는걸까? 예를 통해 함 보자. - Condition 에 대해 예로 잘 등장하는 코드는 아래와 같다. ( Oracle Java Doc 에 나와 있는 코드 ) /** * 이 Buffer 는 array index 재배치를 하지 않고, front 와 rear 값을 두고 control 해서 rear < front 일수도 있는 형태이다. */ public class BoundedBuffer { private final String[] buffer; private final int capacity; private int front; private int rear; private int count; private final Lock lock = new ReentrantLock(); private final Condition notFull = loc.. 2017. 5. 12.
[iOS] keyboard type 바꾸기 [iOS] keyboard type 바꾸기 -UIKeyboardType enum 으로 다음과 같은 것들이 정의된다. typedef NS_ENUM(NSInteger, UIKeyboardType) { UIKeyboardTypeDefault, UIKeyboardTypeASCIICapable, UIKeyboardTypeNumbersAndPunctuation, UIKeyboardTypeURL, UIKeyboardTypeNumberPad, UIKeyboardTypePhonePad, UIKeyboardTypeNamePhonePad, UIKeyboardTypeEmailAddress, UIKeyboardTypeDecimalPad NS_ENUM_AVAILABLE_IOS(4_1), UIKeyboardTypeTwitter N.. 2016. 9. 19.
반응형