2021년 5월 27일 목요일

ExoPlayer - tutorial

exoplayer 링크 


Media Playback on Android with ExoPlayer: Getting Started | raywenderlich.com

처음 시작한다면 여기 

왜? 해야하는지에 대한 설명이 좋다. 생략한 부분도 꽤 있지만 .. 



 UI components - ExoPlayer

전반적인 애기를 다루고 있다. 상세하게 하나하나 다 다루는건 아니지만 

큰 맥락에서는 참고하면 좋은 사이트 


2021년 5월 25일 화요일

kotlin 어노테이션 선언 방법

기존 JAVA

public @Interface Temp{

  String name();

}

그리고 Kotlin

annotation class Temp{

  val name: String

@Temp(name = "MEME")

class Tempest{

}


2021년 5월 22일 토요일

Android Content Providers with link

 Content URIs

<prefix>://<authority>/<data_type>/<id>

authority에는 contactsbrowser 등등 ..

 

Query함수

-안드로이드에서 이미지나 오디오 정보를 알기 위해서 사용

Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder)

uri - application에 접근가능한 주소

projection - 계획이란 의미를 가지고 있다. 얻고자 하는 Data정보를 넣어주자 좀 더 이야기를 한다면

MediaStore를 기반으로 Audio,Image,video ,Download로 세분화

selection  - "${MediaStore.Audio.Media._ID} = ?" 같이 where 역할

selectionArgs - selection ?에 들어가는 value 

Interaction between ContentProvider, other classes, and storage.

Figure 2. Interaction between ContentProvider, other classes, and storage.

DB에 직접적인 CRUD 하는 게 아니라면 (이미지나..,오디오 파일이나..)

ContentProvider로 class확장할 필요 없이 

ContentResolver로 Query로..



Android - Content Providers - Tutorialspoint

ContentProviderSample/MyContentProvider.java at master · iamkavinprabhu/ContentProviderSample (github.com)

android - How can I get only jpg or png images from cursor - Stack Overflow

@BindingAdapter 어떻게..할까

 잊지말자 

Companion Object는

statice 클래스를 만들뿐 그안에 함수까지 static으로 두는 것은 아니다 

그렇다면 Companion Objects 함수는 JVM에서 진짜 static은 아니다 

그럼 어떻게 해야 할까 

여러 방법이 있겠지만 @JvmStatic을 해당 함수에 붙여주자

아니라면 코틀린 파일(kt)을 따로 만들어서 fun을 적어주자 그러면 kotlin은 real static methods  간주한다


여기 사이트에는 2가지 방법이 나오는데 내게는 후자가 간단하다.

Defining Android Binding Adapter in Kotlin | by Herman Cheung | Medium

Databinding에 필요한 XML 문법

 DataBinding을 하면서 xml에 사용해야 할 문구의 필요성을 느꼈다 


  • Mathematical + - / * %
  • String concatenation +
  • Logical && ||
  • Binary & | ^
  • Unary + - ! ~
  • Shift >> >>> <<
  • Comparison == > < >= <= (Note that < needs to be escaped as &lt;)
  • instanceof
  • Grouping ()
  • Literals - character, String, numeric, null
  • Cast
  • Method calls
  • Field access
  • Array access []
  • Ternary operator ?:


2021년 5월 16일 일요일

RecyclerView LifeCylce

 RecyclerView는 3개의 컴포넌트로 이루어진다 

LayoutManager 

item Animator 

Adapter 


apapter는 itemViewType에 따라서 ViewHodler를 생성 

Recycler pool에 요청했지만 없을 경우 

CreateViewHolder에 따라서 생성한다 

RecyclerView pool에서 ViewHolder가 존재하기 때문에 에를들어 프로그레스 UI를 9번째 item에서 나타게 하고 싶으면 아마도 .. ViewType에 position을 매개변수로 한 함수를 사용하면 될 것 같은 느낌이다..  

순서

bindViewHolder -> onViewAttachedToWindow 


(3) RecyclerView ins and outs - Google I/O 2016 - YouTube

Android Recycler View Lifecycle diagrams and notes (landenlabs.com)

Recycler View 제대로 이해하기 - RecyclerView lifecycle (tistory.com)



© 특히하고 특별한
Maira Gall