Speed up your website with Google mod_pagespeed

In short, Google mod_pagespeed is a Apache HTTP server module that helps you optimize your web pages without changing a single lines of code in your web application.  In this article I’ll demonstrate how to get the mod_pagespeed up and running.

Note: This article is written for CentOS environment, if you’re using other Linux distros, please find the installation steps here.

Continue reading

Inspect the view hierarchy (layout) of any Android app

Ever wondering how a particular app structure their hierarchy of views? With the latest Android SDK(I’m using 21.01 currently) and Eclipse ADT plugin, you can finally do that!

1. Connect your phone, Open the app you are curious about. Switch to the DDMS perspective, See the little button over there? click on it.insepct_view_hierarchy_1

2. The following screen will appear, you can now browse the view hierarchy just like a DOM tree which Web developers are familiar with.

insepct_view_hierarchy_2

What is does is basically dump a snapshot of the view in the current screen to the IDE. There’s quite a lot of information you can see in the “Node Detail” section, but you probably cannot reconstruct a layout XML in your own code by these info because It doesn’t show you some attributes like layout_width, layout_height, layout_weight etc. But it definitely tells you what types of views you need to build a particular layout.

Android: Can’t establish a reliable data connection to the server

Few days ago I saw this strange error message when I try to login my Google account on the HTC Desire (my previous phone):

Can’t establish a reliable data connection to the server

Since I cannot login to google, I cannot use the Play Store, Gmail, Youtube etc. My phone was connected to the home WiFi and the internet is definitely working.

I was thinking maybe this phone is already old and maybe Google changed something in their Authentication API. When I was about to give up after trying for about 10 times, I realize something Continue reading