Using GNU Command Line Tools on Mac Os X

Unlike Ubuntu shipped with GNU command line tools,Mac OS X shipped with the BSD version,which make me WTF when I encountered with some compatibility issues.Fortunately,it's quit easy to install gnu tools by using homebrew in Mac OS X and set them as default. First comes with the most important one – GNU coreutils,which contains the most essential commands like ls,cat and bla,bla… brew install coreutils,and export PATH="$(brew --prefix)/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH",and add this alias to your .

Android Best Practices for Background Jobs

Background jobs best practices Running in a background service Loading data in the background Managing the device awake state Best Practices for Background Jobs These classes show you how to run jobs in the background to boost your application’s performance and minimize its drain on the battery. Running in a background service This class describes how to implement

Android Multithreading in a Ui Environment

Why do we need multithreading in Android applications? Let’s say you want to do a very long operation when the user pushes a button.If you are not using another thread, it will look something like this: 1 2 3 4 5 6 7 8 9 ((Button)findViewById(R.id.Button01)).setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { int result = doLongOperation(); updateUI(result); } }); What will happen?The UI freezes. This is a really bad UI experience.