Android BLE

Unpacking BLE frames in a readable way.

Ever wondered why does unpacking Bluetooth data you receive is so much work compared to automatic unpacking done by Retrofit via GSon/etc? This is caused because BLE data is usually very tightly packed and data format varies greatly between devices. Some devices can send Int values as one/two/three/four bytes, sometimes they are big-endian, sometimes little-endian. […]

Android RxJava Tips Tricks

RxJava

Do you want to make sure that your Rx Java Disposables are disposed from the viewModel when they are no longer needed?

Pure Rx Java solution Create CompositeDisposable as field Register all your Disposables via its add method. When you don’t need to receive more updates call clear: public class RxLifecycleViewModel extends ViewModel { private final CompositeDisposable disposables = new CompositeDisposable(); public void onAttach(final ViewInterface view) { disposables.add(Observable.interval(1, TimeUnit.SECONDS) .subscribe(aLong -> { view.updateText(aLong); })); } public void […]

Kotlin

Tips – clean code & less boilerplate

A few tips on how to keep the code clean and testable 1. Don't want to have Android dependencies in viewModel, but still want it to handle clicks? Create an onClick BindingAdapter that does not pass View, or use one from SecretSauce library. 2. Do you want to auto refresh your data in view by [...]

Android Course

Android development tutorials collection

This is my handpicked list of resources for developers who want to start or get better with Android. List will evolve with time, new items will be added, old removed. START HERE https://tutsplus.com/course/android-for-the-busy-developer/ http://www.vogella.com/android.html http://www.vogella.com/java.html VIDEO TUTORIALS/COURSES Android Development Tutorial by Derek Banas http://www.newthinktank.com/videos/android-video-tutorial/ DESIGNER RESOURCES http://petrnohejl.github.io/Android-Cheatsheet-For-Graphic-Designers/ TESTING http://vimeo.com/62144863 http://looksok.wordpress.com/2012/03/17/best-android-tdd-tutorials/ PRACTICAL http://www.ashokgelal.com/2013/01/writing-a-real-android-app-from-scratch-the-world-beyond-the-hello-world/ MORE ADVANCED http://opensignal.com/blog/2013/07/30/40-developer-tips-for-android-optimization/ […]