목록Android (496)
올해는 머신러닝이다.
Dagger2 적용해보기 1. Mvp 패턴만 있는 버전https://github.com/bear2u/MvpBoilerplate 2. Mvp + Dagger2.0 패턴 적용 버전https://github.com/bear2u/Mvp_Dagger2 3. Mvp + Dagger2.11 + Fragment + MultiActivityBinding 까지 적용된 버전입니다.https://github.com/bear2u/Mvp_Dagger2/tree/dagger2.11 ( 브랜치가 2.11로 바뀐 부분입니다. ) 필요하신 분은 받으셔서 바로 위에서 추가적으로 작업하시면 편합니다. 그럼 좋은 하루 되십시요.
@Override public void onLowMemory() { super.onLowMemory(); Glide.get(this).clearMemory(); } @Override public void onTrimMemory(int level) { super.onTrimMemory(level); Glide.get(this).trimMemory(level); } 을 넣어주는 센스~
출처 : https://rongi.github.io/kotlin-blog/rxjava/rx/2017/08/01/error-handling-in-rxjava.html?utm_source=Android+Weekly&utm_campaign=51f4814861-android-weekly-269&utm_medium=email&utm_term=0_4eb677ad19-51f4814861-338106413Once you start writing RxJava code you realize that some things can be done in different ways and sometimes it’s hard to identify best practices right away. Error handling is one..
1down vote어댑터 내부에서 리스너 추가시 포지션 값이 잘못 되는 경우가 많음..아래와 같이 하면 됨...class MyOnClickListener implements View.OnClickListener { @Override public void onClick(View v) { int itemPosition = mRecyclerView.getChildAdapterPosition(v); myResult = results.get(itemPosition); } }And in the adapter@Override public MyAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View v = LayoutInflater.fro..
출처 : http://blog.naver.com/PostView.nhn?blogId=sukjun40&logNo=100171180154 AudioTrack, AudioRecord 클래스를 활용하여 목소리 자동 감지 프로그램을 만들어 보았습니다. 이 소스는 code.google.com 의 sounddemodulation 원본소스 링크http://code.google.com/p/sounddemodulation/downloads/detail?name=AudioDemodulator.zip&can=2&q= 예제를 그대로 가져와 약간만 변형한 것입니다. 녹음 플레이 코드는 대부분 같고 자동으로 녹음저장과 끝을 맺는것만 다릅니다. 따로 녹음 버튼과 녹음 중지 버튼이 있는것이 아니라 목소리가 커지는 시점을 잡아서 저장하..
http://blog.weirdx.io/post/1486
출처 : http://www.journaldev.com/13792/android-gridlayoutmanager-exampleAndroid GridLayoutManagerWe’ve implemented a RecyclerView using a LinearLayoutManager here. Now let’s use a GridLayoutManagerto layout the RecyclerView as a grid.Following is the constructor for a GridLayoutManager.GridLayoutManager (Context context, int spanCount, int orientation, boolean reverseLayout)reverseLayout if set tr..
Image파일 vectorDrawable 대응하기http://pluu.github.io/blog/android/2016/04/11/android-vector/ http://pngtosvg.com/ 여기서 png -> svg 파일로 변경 http://inloop.github.io/svg2android/ 여기서 svg -> drawable파일로 변경 적용해서 사용하기
Android 베타 테스트시 여러가지 방법이 있다. 1. 구글 배타에 등록해서 테스트 한다2. zenkis등을 이용한 CI 방식으로 서버쪽에서 git을 푸시받아 자동으로 apk 배포 한다. 3. deploygate방식으로 스튜디오에서 쉽게 올릴수 있다. (링크 . QR 코드 제공)4. 직접 서버에 올리고 링크 보낸다. 이중에 3번째 방법을 소개하고자 한다. 1. https://deploygate.com/ 에 가서 가입 진행2. https://github.com/DeployGate/gradle-deploygate-plugin/blob/master/README.md 에서 그래들 방식 하나씩 적용.3. http://qiita.com/henteko/items/7ffc8f15223c463683f4 마지막으로 설정..
출처 : http://stackoverflow.com/questions/27963410/cant-create-backup-to-sd-card 메뉴 및 버튼을 둬서 sqliteExport 메소드가 실행되도록 하면 SDcard에 데이터베이스명.sqlite로 저장된다. 이 파일을 FireFox 의 database manager 이용해서 열어보면 쿼리 도 가능하고 csv 저장도 가능하고 기타 등등이 가능하다. permission은 아래와 같다. public void sqliteExport(){ try { File sd = Environment.getExternalStorageDirectory(); File data = Environment.getDataDirectory(); if (sd.canWrite()) {..
안녕하세요, Realm World Tour 참가자/대기자 여러분.이번 Realm World Tour 2017 행사는 여러 도시에서 열리는 Realm 소개 행사로써, 한국에서는 서울과 부산에서 진행됐습니다. 서울에서 진행된 세션 동영상과 슬라이드 링크를 포함한 내용이 https://realm.io/kr/news에 정리되어 올라갔으니 확인해 주세요. --- 강연 영상 및 슬라이드 --- 1. Realm을 소개합니다! - Realm World Tour 2017 Seoul - https://www2.realm.io/e/210132/oducing-realm-would-tour-2017-/2q1vb/35873041 - 회사로서의 Realm과, Realm 모바일 데이터베이스와 Realm 모바일 플랫폼을 소개합니다. ..
유효성 체크https://github.com/Ilhasoft/data-binding-validator
출처 : http://dktfrmaster.blogspot.kr/2016/09/glide.htmlGlide란 무엇인가??구글에서 공개한 이미지 라이브러리기존의 Bump앱이 만들어 사용하던 라이브러리였는데 구글이 Bump앱을 인수하여 라이브러리를 공개웹 상의 이미지를 로드하여 보려주기 위해 고려해야 할 사항들을 미리 구현하여, 사용자가 이용하기 쉽게 만든 라이브러리Glide 추가하기Dependency 추가build.gradle의 dependencies에 다음을 추가한다.compile 'com.github.bumptech.glide:glide:3.7.0' 혹시 maven을 이용한다면 다음을 추가한다. com.github.bumptech.glide glide 3.7.0 aar 기본 이미지 로딩Glide 클래스..
https://github.com/ihsanbal/LoggingInterceptor
FLAG_ACTIVITY_CLEAR_TOP|FLAG_ACTIVITY_SINGLE_TOP 하단에 이미 스택에 있는 activity 일 경우 onCreate 를 방지하기 위해선 필요..
Retrofit 사용시 NumberformatException 발생시.. 간혹 숫자로 변환시 빈값으로 들어오는 경우 뱉는 오류 중 하나가 NumberformatException 이다. 이럴경우 Adapter를 하나 등록하면 된다. public class EmptyStringToNumberTypeAdapter extends TypeAdapter { @Override public void write(JsonWriter jsonWriter, Number number) throws IOException { if (number == null) { jsonWriter.nullValue(); return; } jsonWriter.value(number); } @Override public Number read(Jso..
출처 : http://www.cnblogs.com/zhaoyanjun/p/5535651.htmlButton 防抖处理 button = (Button) findViewById( R.id.bt ) ; RxView.clicks( button ) .throttleFirst( 2 , TimeUnit.SECONDS ) //两秒钟之内只取一个点击事件,防抖操作 .subscribe(new Action1() { @Override public void call(Void aVoid) { Toast.makeText(MainActivity.this, "点击了", Toast.LENGTH_SHORT).show(); } }) ; 按钮的长按时间监听 button = (Button) findViewById( R.id.bt ) ; //监听长按时..
Rx CheetSheet] 다중 터치 방지하기 - throttleFirst() http://kunny.github.io/tip/rx/2016/04/08/rx_cheatsheet_throttle_first/
http://eyeahs.github.io/rxjava/blog/2016/10/11/rxjava-wiki-backpressure/
출처 : http://beust.com/weblog/2015/06/01/easy-sqlite-on-android-with-rxjava/Easy SQLite on Android with RxJavaWhenever I consider using an ORM library on my Android projects, I always end up abandoning the idea and rolling my own layer instead for a few reasons:My database models have never reached the level of complexity that ORM’s help with.Every ounce of performance counts on Android and I can..
https://github.com/amitshekhariitbhu/RxJava2-Android-Sampleshttps://github.com/kaushikgopal/RxJava-Android-Samples
Do these modifications to your animation files:enter.xml: exit.xml: You'll have your second activity sliding in from right to the left.For a better understadnig on how to play around with the fromXDelta and toXDelta values for the animations, here is a very basic illustration on the values: This way you can easily understand why you add android:fromXDelta="0%" and android:toXDelta="-100%" for yo..
public class TileBitmapProvider implements BitmapProvider { private final TileProvider provider; private final Bitmap.Config bitmapConfig; private final int backgroundColor; private final BitmapPool bitmapPool; private final Rect frameRect = new Rect(); public TileBitmapProvider(final TileProvider provider, final BitmapPool bitmapPool, final Bitmap.Config bitmapConfig, final int backgroundColor)..
출처 : http://blog.danlew.net/2016/06/13/multicasting-in-rxjava/ 멀티 캐스팅은 RxJava에서 중복 된 작업을 줄이기위한 핵심 방법입니다.당신이 이벤트를 멀티 캐스트하면 보내 같은 이벤트를 모두 다운 스트림 사업자 / 가입자. 이 기능은 네트워크 요청과 같이 값 비싼 작업을 수행 할 때 유용합니다. 각 가입자마다 똑같은 네트워크 요청을 반복적으로 실행하고 싶지는 않습니다. 결과를 멀티 캐스팅하기 만하면됩니다.멀티 캐스트에는 두 가지 방법이 있습니다.를 사용 ConnectableObservable을 통해 ( publish()또는replay()1 )사용 SubjectConnectableObservable또는 전에 수행 된 Subject작업은 한 번만 발생합니다..
출처 : http://kunny.github.io/community/2016/02/08/gdg_korea_android_weekly_02_1/MissingBackpressureExceptionMissingBackpressureException은 Observable에서 항목(item)을 보내는(emit) 속도보다 처리하는 속도가 느릴 때 발생합니다.RxJava 가이드 문서 내 Backpressure 항목에도 이와 관련된 항목이 기술되어 있는데, 문서에서 예로 든 사례(zip 연산자를 사용하는 경우)를 사용하지 않는 경우에도 상당히 높은 확률로 경험할 수 있습니다.RxAndroid를 사용하는 경우, 수신된 데이터를 UI에 표시하기 위해 observeOn(AndroidSchedulers.mainThread()..
you may use Observable for example: handling GUI eventsworking with short sequences (less than 1000 elements total) ========================================================= You may use Flowable for example: cold and non-timed sourcesgenerator like sourcesnetwork and database accessors
출처 : http://www.introtorx.com/Content/v1.0.10621.0/12_CombiningSequences.htmlCombining sequencesData sources are everywhere, and sometimes we need to consume data from more than just a single source. Common examples that have many inputs include: multi touch surfaces, news feeds, price feeds, social media aggregators, file watchers, heart-beating/polling servers, etc. The way we deal with these ..
오픈소스 라이버러리 모음 http://pluu.github.io/blog/android/oepnsource/2015/05/11/android-opensource/
Jabber/XMPP Protocol NamespacesThis is the official registry of Jabber/XMPP protocol namespaces as maintained by the XMPP Registrar. This registry contains only namespaces that are defined in the XMPP RFCs (published by the IETF) or in XMPP Extension Protocols that have advanced to a status of Active, Draft, or Final within the standards process of the XMPP Standards Foundation. Other namespaces..
ConfigureForm form = new ConfigureForm(FormType.submit); form.setPersistentItems(false); form.setDeliverPayloads(true); form.setAccessModel(AccessModel.open); PubSubManager manager = new PubSubManager(connection, "pubsub.my.openfire.server"); Node myNode = manager.createNode("TestNode", form); SimplePayload payload = new SimplePayload("book","pubsub:test:book", "Lord of the Rings"); Item item = ..