<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Android Development on Guowei Lv</title>
    <link>https://www.lvguowei.me/categories/android-development/</link>
    <description>Recent content in Android Development on Guowei Lv</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Tue, 19 Jul 2022 21:21:01 +0300</lastBuildDate><atom:link href="https://www.lvguowei.me/categories/android-development/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Demystify RxJava (2)</title>
      <link>https://www.lvguowei.me/post/rxjava-interenals-2/</link>
      <pubDate>Tue, 19 Jul 2022 21:21:01 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/rxjava-interenals-2/</guid>
      <description>In this article, we focus on how the dispose system works in RxJava.
First, let&amp;rsquo;s take a look at the Disposable interface.
public interface Disposable { void dispose(); boolean isDisposed(); } Not much going on here, basically it says a Disposable can be disposed.
First example we are going to examine is:
Observable.interval(1, TimeUnit.SECONDS) If you click through the code, the implementation is actually this class ObservableInterval.
First let&amp;rsquo;s look at the constructor of this class:</description>
    </item>
    
    <item>
      <title>Demystify RxJava (1)</title>
      <link>https://www.lvguowei.me/post/rxjava-internals/</link>
      <pubDate>Thu, 30 Jun 2022 21:23:02 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/rxjava-internals/</guid>
      <description>Let&amp;rsquo;s see what makes RxJava tick.
RxJava is complex, so I will have to (overly) simplify things at places. All of this is just trying to help you to get a better picture of how RxJava is implemented.
Let&amp;rsquo;s go.
Let&amp;rsquo;s start with the Single, it&amp;rsquo;s just an interface with one method:
public interface Single&amp;lt;T&amp;gt; { void subscribe(SingleObserver&amp;lt;T&amp;gt; observer); } So a Single is just a thing that can be subscribed.</description>
    </item>
    
    <item>
      <title>I wrote a game again - 24!</title>
      <link>https://www.lvguowei.me/post/24-game/</link>
      <pubDate>Wed, 15 Jun 2022 12:39:41 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/24-game/</guid>
      <description>It all started from a message sent by my cousin in our family group chat one day.
He posted some of those harder 24 problems, and I couldn&amp;rsquo;t solve any of them.
(If you don&amp;rsquo;t know what is this 24 game is all about, here you can read it https://en.wikipedia.org/wiki/24_game)
So, I decided to write a program to help me. And that program turned into a mobile game eventually.
You can find it on Play Store.</description>
    </item>
    
    <item>
      <title>Handmade NestedScrollView</title>
      <link>https://www.lvguowei.me/post/handmade-nested-scrollview/</link>
      <pubDate>Tue, 12 Apr 2022 20:57:33 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/handmade-nested-scrollview/</guid>
      <description>I&amp;rsquo;m learning how the nested scrolling machanism works on Android, but couldn&amp;rsquo;t really find any in-depth material. So I turned into the Chinese community, and found this incredible article. It is very long and detailed to death, I don&amp;rsquo;t really have time to go through it all. I find the first half, a handmade SimpleNestedScrollView to be quite interesting, let me put that part in English here.
Understand the problem If you have a ScrollView inside another ScrollView(same scrolling direction, both vertical or horizontal), then what to expect of the scrolling behaviour?</description>
    </item>
    
    <item>
      <title>Understand Android View&#39;s Touch Events</title>
      <link>https://www.lvguowei.me/post/understand-touch-event-android/</link>
      <pubDate>Mon, 24 Jan 2022 20:52:47 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/understand-touch-event-android/</guid>
      <description>How the view system in Android handles touch events? Let&amp;rsquo;s try to understand it by designing it from scratch ourselves!
(This is not my original but a summary of this https://juejin.cn/post/6844903761052188679)
Let&amp;rsquo;s do this by coming up a series of requirements (from naive to sophisticated) and see how we can design the logic to fulfill them.
Requirement 1 In a nested view hierachy, only the most inner view can handle events.</description>
    </item>
    
    <item>
      <title>WTF Livedata?! (or Kotlin)</title>
      <link>https://www.lvguowei.me/post/wtf-livedata/</link>
      <pubDate>Sat, 22 Jan 2022 20:31:24 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/wtf-livedata/</guid>
      <description>LiveData is convenient, powerful and super easy to use. But, there are still some quirks that could possibly leads to some heads banging against walls.
How many times can I observe? In theory, we can observe livedata with multiple observers, just like the good old pub-sub pattern, right? Well, let&amp;rsquo;s test this out.
Let&amp;rsquo;s create a super simple livedata.
class MainViewModel : ViewModel() { private val _data = MutableLiveData&amp;lt;Int&amp;gt;() val data: LiveData&amp;lt;Int&amp;gt; = _data fun update(count: Int) { _data.</description>
    </item>
    
    <item>
      <title>Fun Facts About OnMeasure() and OnLayout()</title>
      <link>https://www.lvguowei.me/post/fun-facts-about-onmeasure-and-onlayout/</link>
      <pubDate>Mon, 03 Jan 2022 21:48:45 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/fun-facts-about-onmeasure-and-onlayout/</guid>
      <description>Let&amp;rsquo;s understand more about Android view&amp;rsquo;s measure and layout process, and have some fun along the way.
Let&amp;rsquo;s say we have this:
&amp;lt;LinearLayout xmlns:android=&amp;#34;http://schemas.android.com/apk/res/android&amp;#34; xmlns:app=&amp;#34;http://schemas.android.com/apk/res-auto&amp;#34; xmlns:tools=&amp;#34;http://schemas.android.com/tools&amp;#34; android:layout_width=&amp;#34;match_parent&amp;#34; android:layout_height=&amp;#34;match_parent&amp;#34; tools:context=&amp;#34;.MainActivity&amp;#34;&amp;gt; &amp;lt;com.example.stubornview.StubbornView android:layout_width=&amp;#34;match_parent&amp;#34; android:layout_height=&amp;#34;match_parent&amp;#34; android:background=&amp;#34;@color/design_default_color_primary&amp;#34; /&amp;gt; &amp;lt;/LinearLayout&amp;gt; class StubbornView @JvmOverloads constructor( context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0 ) : View(context, attrs, defStyleAttr) { /** * 1. Parent LinearLayout combines developer&amp;#39;s requirements * and the available space of itself into MeasureSpecs and * pass them here.</description>
    </item>
    
    <item>
      <title>How to Really Understand ViewModel in Android</title>
      <link>https://www.lvguowei.me/post/how-to-understand-viewmodel/</link>
      <pubDate>Sat, 18 Dec 2021 10:50:35 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/how-to-understand-viewmodel/</guid>
      <description>Yes, there is documentation and tons of sample apps out there. But they are all in a top down approach, meaning they give you the final result of how to use it first, and never tells you why and what is behind the scenes.
I will fix that in this article, and present a bottom up approach which leads to much better and deeper understanding.
First, at the bottom of things, we need to define what is ViewModel.</description>
    </item>
    
    <item>
      <title>How to implement an ExpandableLayout</title>
      <link>https://www.lvguowei.me/post/expandable-layout/</link>
      <pubDate>Fri, 17 Dec 2021 21:15:42 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/expandable-layout/</guid>
      <description>It is quite common in Android that we need some expandable widget to show and hide information. This is my first attempt, note that this is only a &amp;ldquo;sketch&amp;rdquo;, and I intentionally leave some room for improvement.
One interesting detail worth mentioning is how the animation is done. I used the reverse() function to play animation backwards in order to achieve a smooth and continuous feel.
Here is the code:</description>
    </item>
    
    <item>
      <title>View Binding Internals</title>
      <link>https://www.lvguowei.me/post/view-binding-internals/</link>
      <pubDate>Wed, 10 Nov 2021 21:25:50 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/view-binding-internals/</guid>
      <description>I was bored at night so decided to peek into the guts of how Android&amp;rsquo;s View Binding works. To my suprise the generated code is extremely simple.
Imagine you have a list_item.xml file and it looks like this:
&amp;lt;LinearLayout&amp;gt; &amp;lt;ImageView android:id=&amp;#34;@+id/icon&amp;#34; /&amp;gt; &amp;lt;TextView android:id=&amp;#34;@+id/name&amp;#34; /&amp;gt; &amp;lt;/LinearLayout&amp;gt; Then the generated class will be like this:
public final class ListItemBinding implements ViewBinding { private final LinearLayout rootView; public final ImageView icon; public final TextView name; // Notice: private constructor private ListItemBinding(LinearLayout rootView, ImageView icon, TextView name) { this.</description>
    </item>
    
    <item>
      <title>Back to Basics - App Bar</title>
      <link>https://www.lvguowei.me/post/b2b_app_bar/</link>
      <pubDate>Sun, 27 Jun 2021 22:20:27 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/b2b_app_bar/</guid>
      <description>We often hear 3 words: app bar, action bar and tool bar. Let&amp;rsquo;s make clear of them first:
app bar: the name of the UI element/bar at the top of the app. action bar: the previous implementation of app bar, comes with some themes by default. But should not really be used anymore. tool bar: the current implementation of app bar. Should be used in replacement of action bar. Let&amp;rsquo;s create an empty project and see what it looks like by default:</description>
    </item>
    
    <item>
      <title>Collapsing Toolbar With Motion Layout</title>
      <link>https://www.lvguowei.me/post/collapsing-toolbar-with-motion-layout/</link>
      <pubDate>Sun, 21 Jun 2020 23:27:09 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/collapsing-toolbar-with-motion-layout/</guid>
      <description>Source code</description>
    </item>
    
    <item>
      <title>Simple Toolbar Example</title>
      <link>https://www.lvguowei.me/post/toolbar-example/</link>
      <pubDate>Fri, 19 Jun 2020 23:15:00 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/toolbar-example/</guid>
      <description>Use NoActionBar theme &amp;lt;resources&amp;gt; &amp;lt;style name=&amp;#34;AppTheme&amp;#34; parent=&amp;#34;Theme.AppCompat.Light.NoActionBar&amp;#34;&amp;gt; &amp;lt;item name=&amp;#34;colorPrimary&amp;#34;&amp;gt;@color/colorPrimary&amp;lt;/item&amp;gt; &amp;lt;item name=&amp;#34;colorPrimaryDark&amp;#34;&amp;gt;@color/colorPrimaryDark&amp;lt;/item&amp;gt; &amp;lt;item name=&amp;#34;colorAccent&amp;#34;&amp;gt;@color/colorAccent&amp;lt;/item&amp;gt; &amp;lt;/style&amp;gt; &amp;lt;/resources&amp;gt; Create toolbar layout &amp;lt;?xml version=&amp;#34;1.0&amp;#34; encoding=&amp;#34;utf-8&amp;#34;?&amp;gt; &amp;lt;androidx.appcompat.widget.Toolbar xmlns:android=&amp;#34;http://schemas.android.com/apk/res/android&amp;#34; android:layout_width=&amp;#34;match_parent&amp;#34; android:layout_height=&amp;#34;wrap_content&amp;#34; xmlns:app=&amp;#34;http://schemas.android.com/apk/res-auto&amp;#34; android:background=&amp;#34;@color/colorPrimary&amp;#34; android:theme=&amp;#34;@style/ThemeOverlay.AppCompat.Dark.ActionBar&amp;#34; app:popupTheme=&amp;#34;@style/ThemeOverlay.AppCompat.Light&amp;#34;&amp;gt; &amp;lt;/androidx.appcompat.widget.Toolbar&amp;gt; Setting the layout_height to wrap_content will make it the correct default height.
Since our app has a light theme, the texts color in toolbar will be black. To change it to white, we need to set the theme of the toolbar to ThemeOverlay.</description>
    </item>
    
    <item>
      <title>Realm Guide: From Zero to Give Up</title>
      <link>https://www.lvguowei.me/post/realm-learning-resources/</link>
      <pubDate>Sat, 25 Apr 2020 17:23:40 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/realm-learning-resources/</guid>
      <description>You know nothing about realm, then watch this video first -&amp;gt;
Now you should know the basic basics, then take a look at the official doc.
You think you know it all until you try to combine with RxJava.
Now you are super puzzled, look at some examples with full source code.
Finally you realize that you have to do all this in clean architecture and decided to give up by turning Realm into a NoSQL version SQLite.</description>
    </item>
    
    <item>
      <title>Dagger Android Tutorial 4</title>
      <link>https://www.lvguowei.me/post/dagger-android-4/</link>
      <pubDate>Sun, 29 Mar 2020 15:18:19 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/dagger-android-4/</guid>
      <description>Convert RxJava stream into LiveData stream When we use Rxjava for handling api requests, it will return a RxJava Stream. But in the presentation layer we are using LiveData, this article shows you how to make them work together.
The tool we are using here is LiveDataReactiveStreams.
It is an adapter from LiveData to ReactiveStream and vice versa.
This is how we do it in AuthViewModel.
public class AuthViewModel extends ViewModel { private static final String TAG = &amp;#34;AuthViewModel&amp;#34;; private final AuthApi authApi; // 1.</description>
    </item>
    
    <item>
      <title>Dagger Android Tutorial 3</title>
      <link>https://www.lvguowei.me/post/dagger-android-3/</link>
      <pubDate>Sun, 29 Mar 2020 09:58:23 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/dagger-android-3/</guid>
      <description>Inject Retrofit @Singleton The Retrofit instance should be a singleton in the scope of AppComponent.
Provide the Retrofit instance in AppModule.
@Singleton @Provides static Retrofit provideRetrofitInstance() { return new Retrofit.Builder().baseUrl(Constants.BASE_URL) .addCallAdapterFactory(RxJava2CallAdapterFactory.create()) .addConverterFactory(GsonConverterFactory.create()).build(); } Under AuthActivity subcomponent, create a module called AuthModule, in it, provides the AuthApi instance.
@Module public class AuthModule { @Provides static AuthApi provideAuthApi(Retrofit retrofit) { return retrofit.create(AuthApi.class); } } public interface AuthApi { @GET(&amp;#34;/users/{id}&amp;#34;) Flowable&amp;lt;User&amp;gt; getUser(@Path(&amp;#34;id&amp;#34;) int id); } @ContributesAndroidInjector(modules = {AuthModule.</description>
    </item>
    
    <item>
      <title>Dagger Android Tutorial 2</title>
      <link>https://www.lvguowei.me/post/dagger-android-2/</link>
      <pubDate>Sat, 28 Mar 2020 17:48:48 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/dagger-android-2/</guid>
      <description>In this article we show how to inject into ViewModels.
Note that we will not dive too deep into the inner workings of things, since they are extremely complex. If you want to get some level of insight into the topic read this article. But I try to give the clean solution and how you can put it in your head.
First a few words about the ViewModel in android MVVM architecture.</description>
    </item>
    
    <item>
      <title>Dagger Android Tutorial 1</title>
      <link>https://www.lvguowei.me/post/dagger-android-1/</link>
      <pubDate>Sat, 28 Mar 2020 07:52:09 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/dagger-android-1/</guid>
      <description>Warning: Google thinks you should avoid dagger-android for new projects. Watch Here
But, if you are using it now, here are some notes on how to approach it.
This is basically a text version of these videos
Application Component Pretty much every app will have an application component, whose scope will be the lifetime of the application.
First, create the AppComponent
//1. Include this &amp;#39;AndroidSupportInjectionModule&amp;#39;, this is required @Component(modules = {AndroidSupportInjectionModule.</description>
    </item>
    
    <item>
      <title>Instance Initialization Block in Android</title>
      <link>https://www.lvguowei.me/post/java-iib/</link>
      <pubDate>Thu, 09 Jan 2020 21:22:02 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/java-iib/</guid>
      <description>This will be a short and sweet post.
The usage of Instance Initialization Block of Java in custom android views.
First of all, I have a confession to make. After almost 10 years of Java programming, I do not really know what is IIB and why it exists.
Pretty obviously, the purpose of IIB is to initialize instance variables of a class.
But you may ask isn&amp;rsquo;t that the job of constructors?</description>
    </item>
    
    <item>
      <title>Where to Put observeOn in Rxjava2</title>
      <link>https://www.lvguowei.me/post/where-to-put-observeon-rxjava2/</link>
      <pubDate>Thu, 08 Nov 2018 20:56:01 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/where-to-put-observeon-rxjava2/</guid>
      <description>Me: Why I have put the observeOn(AndroidSchedulars.mainThread()) but still onNext() is NOT called in android main thread?!
Rx Master: Show me your code.
Me: Here you are my master. I just want to wait for 5 seconds then call an api:
override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) fun networkObservable(): Observable&amp;lt;String&amp;gt; { return Observable.just(&amp;#34;test&amp;#34;).subscribeOn(Schedulers.io()) } Observable.timer(5, TimeUnit.SECONDS) .observeOn(AndroidSchedulers.mainThread()) .flatMap { _ -&amp;gt; networkObservable() } .subscribe(Consumer { Log.d(&amp;#34;testtest&amp;#34;, it) Log.d(&amp;#34;testtest&amp;#34;, Thread.currentThread().name) }) } } Rx Master: &amp;hellip; Read the Doc of observeOn:</description>
    </item>
    
    <item>
      <title>Android Design Pattern - Build a SOLID Image Loader</title>
      <link>https://www.lvguowei.me/post/android-design-pattern-imageloader/</link>
      <pubDate>Thu, 16 Aug 2018 12:29:18 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/android-design-pattern-imageloader/</guid>
      <description>SOLID Principles and Design Patterns play an important role in Android development.
Lets take a look at how to design and implement an image loader step by step. This example comes from the book Android Source Code Design Patterns - Analysis and Practice. I also rewrote all the code from Java to Kotlin and made some bug fixes.
Step 1: Make it work Requirement: Our first version of image loader will just use in-memory cache to cache images loaded from the Internet, we will ignore cache validation for now.</description>
    </item>
    
    <item>
      <title>What the FlatMap?</title>
      <link>https://www.lvguowei.me/post/what-the-flatmap/</link>
      <pubDate>Sun, 17 Dec 2017 20:04:29 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/what-the-flatmap/</guid>
      <description>The operator flatmap in RxJava is a tough topic if you are not familiar with functional style.
After reading all the articles and tutorials and even worked with RxJava for almost a year, I&amp;rsquo;m still not quite confident about it. I sure know how to and when to use it, but the understanding seems always shallow.
Until I read the flatmap in the Structure and Interpretation of Computer Programs.
The key is to understand the word flat.</description>
    </item>
    
    <item>
      <title>How to write maintainable RecyclerView</title>
      <link>https://www.lvguowei.me/post/maintainable-recyclerview/</link>
      <pubDate>Sun, 17 Sep 2017 18:39:39 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/maintainable-recyclerview/</guid>
      <description>Google is famous for making complicated things. RecyclerView is not an exception. It is more flexible than the previous ListView I understand, but that also means that us developers need to understand more and do more work. I have seen gigantic adapters that have very complicated logic especially when there are multiple types that the RecyclerView is trying to handle. I think I happen to know one way to organize things a bit better so one can easily find what he/she is looking for.</description>
    </item>
    
    <item>
      <title>Customize Android Seekbar Color</title>
      <link>https://www.lvguowei.me/post/customize-android-seekbar-color/</link>
      <pubDate>Wed, 23 Aug 2017 20:50:44 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/customize-android-seekbar-color/</guid>
      <description>I was tasked to create a simple media player app for a shop demo, and I&amp;rsquo;m using the built-in SeekBar for the volume control. All goes well, until I want to change the color of it. The design has it like the thumb of the SeekBar is white, and first half is green and rest half is grey. It took me almost a whole day to find a satisfying anwser, come on Android!</description>
    </item>
    
    <item>
      <title>All You Need To Know About Android Espresso Testing (Part IV)</title>
      <link>https://www.lvguowei.me/post/all-you-need-to-know-about-android-espresso-testing-4/</link>
      <pubDate>Fri, 21 Jul 2017 18:19:35 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/all-you-need-to-know-about-android-espresso-testing-4/</guid>
      <description>In previous article, we talked about how to scroll to a certain position in RecyclerView in the test. In this article, we further discuss how to write a custom matcher and use it to scroll the RecyclerView.
Let&amp;rsquo;s say that we want to scroll to certain item in RecyclerView, but we don&amp;rsquo;t know the position. We can then create a custom Matcher, and use the matcher to determine which item to scroll to.</description>
    </item>
    
    <item>
      <title>All You Need To Know About Android Espresso Testing (Part III)</title>
      <link>https://www.lvguowei.me/post/all-you-need-to-know-about-android-espresso-testing-3/</link>
      <pubDate>Fri, 21 Jul 2017 16:44:41 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/all-you-need-to-know-about-android-espresso-testing-3/</guid>
      <description>In part II, we wrote a test case to verify that the app can create a task and the task will be seen on the screen. In this part III, we will demonstrate one technique on writing tests that involves a RecyclerView.
First we repeatly add some tasks, and then we verify that the last added task is on display. Note that since we are using a RecyclerView, the last item might not be seen, so we need to scroll the RecyclerView before checking.</description>
    </item>
    
    <item>
      <title>All You Need To Know About Android Espresso Testing (Part II)</title>
      <link>https://www.lvguowei.me/post/all-you-need-to-know-about-android-espresso-testing-2/</link>
      <pubDate>Fri, 21 Jul 2017 11:48:08 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/all-you-need-to-know-about-android-espresso-testing-2/</guid>
      <description>In Part I we talked about how to setup Espresso testing framework, what is the activity testing rule and how to use uiautomatorviewer to help us find id of the view quickly.
In this Part II, we will write some tests against a simple TODO list application. Lets get started.
About the App under test This is a very simple app with basically 2 screens. One to display a list of tasks:</description>
    </item>
    
    <item>
      <title>All You Need To Know About Android Espresso Testing (Part I)</title>
      <link>https://www.lvguowei.me/post/all-you-need-to-know-about-android-espresso-testing/</link>
      <pubDate>Thu, 13 Jul 2017 13:03:12 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/all-you-need-to-know-about-android-espresso-testing/</guid>
      <description>The Espresso testing framework really makes it easy to write UI tests for Android. In this first installment, I will go through how to set it up and write our first test case.
Let&amp;rsquo;s get started.
Set up Espresso Add the following dependencies to your gradle build file.
dependencies { // Other dependencies ... androidTestCompile &amp;#39;com.android.support.test.espresso:espresso-core:2.2.2&amp;#39; } Understand the Rules in JUnit Why do they exist? We all know that in JUnit there is a setup method(annotated as @Before) and a teardown method(annotated as @After).</description>
    </item>
    
    <item>
      <title>Android Emulator Problem In Arch Linux</title>
      <link>https://www.lvguowei.me/post/android-emulator-problem-in-arch-linux/</link>
      <pubDate>Wed, 12 Jul 2017 14:13:07 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/android-emulator-problem-in-arch-linux/</guid>
      <description>I don&amp;rsquo;t remember since when, but now whenever I upgrade Android Studio from pacman, I cannot open my emulator, with some libGL error: unable to load driver: i965_dri.so error.
I tried to follow the solution online but found none of them is working out of the box, because Android Sdk changed some paths. Here is what actualy works now:
cd ANDROID_SDK_PATH/emulator/lib64/libstdc++/ mv libstdc++.so.6 libstdc++.so.6.bak ln -s /usr/lib64/libstdc++.so.6 libstdc++.so.6 </description>
    </item>
    
    <item>
      <title>Rxjava fromCallable() Vs defer()</title>
      <link>https://www.lvguowei.me/post/rxjava-fromcallable-vs-defer/</link>
      <pubDate>Tue, 11 Jul 2017 17:13:32 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/rxjava-fromcallable-vs-defer/</guid>
      <description>In this post we talk about how to use Observable.fromCallable() and Observable.defer() to convert exising functionality into the Rx.
Imagine that you have a UserService class, in it there is a getUserFromDb() function. This function is developed before RxJava and cannot be changed. But somehow you need a function which returns a Observable&amp;lt;User&amp;gt;. What could you do?
The UserService Example public class UserService { /** * Gets User from database, this should not be run in UI thread.</description>
    </item>
    
    <item>
      <title>Why we stopped using dagger</title>
      <link>https://www.lvguowei.me/post/why-remove-dagger/</link>
      <pubDate>Tue, 27 Jun 2017 20:40:41 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/why-remove-dagger/</guid>
      <description>I decided to stop using Dagger2 in our company&amp;rsquo;s android project. Why?
Don&amp;rsquo;t get me wrong, Dagger2 is still great. But though it is great, it is complex. Lots of concepts to wrap our heads around. What is a component, what is a module, what is the difference between subcomponent and dependency component, etc. In order to use it properly, we need to anwser all that questions, even you think you understand it, you still run into suprises now and then.</description>
    </item>
    
    <item>
      <title>Android Kata View Property Animator</title>
      <link>https://www.lvguowei.me/post/android-kata-view-property-animator/</link>
      <pubDate>Tue, 28 Mar 2017 20:49:08 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/android-kata-view-property-animator/</guid>
      <description>Since I have been doing programming kata, why not adopt the same kata concept in Android programming?
Over the years I have accumulated some useful tools / tricks that I can show in kata form.
The goal is to keep it simple and easy to grasp and to the point.
This is the first one, which shows how to use ViewPropertyAnimator to animate show and hide of the FAB button.</description>
    </item>
    
  </channel>
</rss>
