본문 바로가기
[android] CONNECTIVITY_ACTION deprecated 에 대한 이야기 - Connectivity 가 변경되었을 때 받을 수 있는 broadcast 는 ConnectivityManager.CONNECTIVITY_ACTION 가 있었다. 그러나 이 녀석은 API 28 (POS) 부터 deprecated 되었다. - 사실 이 녀석은 이미 deprecated 의 징조를 띄고 있었다. targetSdk 24 (NOS) 부터 static receiver 로 받을 수 없게 되었고, targetSdk 26 (OOS) 부터는 background restriction 정책으로 이 녀석을 포함한 다른 녀석들도 static receiver 로 받을 수 없게 되었다. 그리고 결국 API 28 (POS) 부터는 deprecated 된 것이다. deprecated 가 되었기 때문에 사실 target.. 2019. 4. 9.
[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.
[ios] Gallary ( Photo Album) Permission 체크 [ios] Gallary ( Photo Album) Permission 체크 #import "AssetsLibrary/AssetsLibrary.h" // 권한 체크[ALAssetsLibrary authorizationStatus] > kCLAuthorizationStatusDenied // 권한 요청ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];[library enumerateGroupsWithTypes:ALAssetsGroupSavedPhotos usingBlock:^(ALAssetsGroup *group, BOOL *stop) { // do something with success *stop = YES;} failureBlock:^(NSErro.. 2018. 2. 3.
[ios] Camera Permission [ios] Camera Permission @import AVFoundation; // 권한 체크[AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo] == AVAuthorizationStatusAuthorized; // 권한 요청 [AVCaptureDevice requestAccessForMediaType:AVMediaTypeVideo completionHandler:^(BOOL isGranted){ // do something}]; authorizationStatusForMediaType, AVAuthorizationStatusAuthorized, AVCaptureDevice, AVMediaTypeVideo, camera permissi.. 2018. 2. 2.
[ios] block typedef 방법 & param 기입 방법 [ios] block typedef 방법 & param 기입 방법 -block 의 typedef 는 문법이 딱 와닿지 않는다. -typedef 를 할 때는 block 을 함수 포인터라고 생각하고 정의하면 쉽다. -Syntax :typedef returnType (^blockName)(params); Example :typdef void (^MyBlock)(UIView * _Nonnull view); -param 으로 쓸 때는 또 다른 형태가 된다. -Syntax :(returnType (^)(params)) paramName Example :-(void)doSomething:(void (^)(UIView * _Nonnull))block; block typedef, blockname, Example, Pa.. 2017. 12. 17.
[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.
반응형