How to Change Desktop Environment from Xfce to KDE

Don’t use Xfce, use KDE!

Why is Xfce junk?

The style is very half windows, half mac, half-a-job. There is also no built in support for dual monitors so you have to use xrandr everytime you boot which is very annoying. Sure it is lightweight, but it is not good enough.

Why is KDE the best?

Well for one, it was the first ever GNU/Linux Desktop environment, announced in 1996. So they have had time to refine the experience and it is very smooth and customisable. It is also now the most popular desktop environment and rightly so.

What about the rest?

Well Gnome is alright but you will pull your hair out after a while. Unity for ubuntu is really good and I would advise sticking with it if you are on ubuntu. I have not tested Cinnamon but apparently it is very windowsy, so you may want to stay clear.

How to Change Desktop Environment from Xfce to KDE

Take note that in this case I am using Debian 8 as the operating system, with the apt-get package manager you can probably use the same commands but with you package maanager eg. aptitude, yum, emerge

1. First install KDE, otherwise if you remove XFCE first then your network connection manager may not work.


sudo apt-get purge xfce4

2. Install KDE


sudo apt-get install ~t^desktop$ ~t^kde-desktop$

3. Reconfigure the Display manager and select KDE, this probably appened in the previous step


sudo dpkg-reconfigure gdm

4. Configure the default X-session to start


update-alternatives --config x-session-manager

5. Autoremove Xfce


sudo apt-get autoremove

What Now?

Enjoy the best Desktop environment there is. Welcome to the calm world where almost everything is intuitive…

switch-xfce-to-kde

The Essential Android Developer Toolbox and Reference

“XML is crap. Really. There’s just no reason for that horrible crap to exist”

Interacting with an API

  • Retrofit – The Best REST Client for Android (Don’t use anything else), you will need the lower level OKHTTP as a client for adding cookie/session to headers and to trust self-signed certificates
  • Json to Pojo – Generate plain old java objects from the JSON response from an API. Saves a lot of Time, you can also use android studio to create the setters and getters -> highlight the attributes of the class -> right click -> generate -> setters & getters

Views and Layout Elements

Memory Management and Leaking

  • Leak Canary – Detect Memory Leaks in Android and Java

References

android-developer-toolkit

How to Debug or Sniff Network Activity on Android Emulator?

Checking network activity is a very important task especially when your app is accessing an API.
However the emulator runs in a virtual environment and hence is often not picked up by default on network sniffing debugging and activity tools.
Fear not we can use Fiddler to view network requests made on your android emulator or even a test device.
Even better we can do this on a linux machine.

How to Install Fiddler

On Windows: Download Fiddler to view network traffic

On Linux(ubuntu):

  1. Install Mono – an open source implementation of the .net framework (basically lets you run .exe on linux)
    sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
    echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list
    sudo apt-get update
    sudo apt-get install mono-complete
  2. Download Fiddler for Mono
  3. Run Fiddler
    mono Fiddler.exe
  4. Tools -> Fiddler Options -> Connections -> Make sure Allow remote computers to connect is checked

Set your Emulator or Device to Proxy Traffic to Fiddler

On the device

  1. Go to Settings
  2. Select Wifi
  3. Hold down the wifi connection for 2 seconds
  4. Click Modify Network
  5. set the Following:
    Proxy Hostname: 10.0.3.2 (Genymotion Emulator) | 10.0.2.2 (Normal Emulator)
    Proxy port: 8888
    
  6. Turn Off and On The Wifi to Refresh

Start Debugging

Now your life is made a little bit easier you can check the headers, cookies and form data sent with requests and check responses.

Source: Stack Overflow Emulator Port, Genymotion port MSDN