Q:

Use of dp and dpi instead of percentages in android? 

I have understood the concept of dp and dpi for different layouts and images being used in android.  But my doubt (sorry if dumb) is why did android come up with a concept of density pixel, density independent pixel instead of percentages just like in html.  It is getting difficult for the developer..

A:

Because of to support multiple screens android introduced this dp and dip concepts
dp or dip
From the Android Documentation for Supporting Multiple Screens:

Density-independent Pixels - an abstract unit that is based on the physical density of the screen.  These units are relative to a 160
  dpi screen, so one dp is one pixel on a 160 dpi screen. 
Use of dp:
Density independence - Your application achieves “density independence” when it preserves the physical size (from the user’s
  point of view) of user interface elements when displayed on screens
  with different densities. ( ie) The image should look the same size
  (not enlarged or shrinked) in different types of screens. 
Density-independent pixel is a virtual pixel unit that you should use when defining UI layout, to express layout dimensions or position
  in a density-independent way. 
The density-independent pixel is equivalent to one physical pixel
  on a 160 dpi screen, which is the baseline density assumed by the
  system for a "medium" density screen.   At runtime, the system
  transparently handles any scaling of the dp units, as necessary, based
  on the actual density of the screen in use.  The conversion of dp
  units to screen pixels is simple: px = dp * (dpi / 160).  
For example, on a 240 dpi screen, 1 dp equals 1.5 physical pixels. 
  You should always use dp units when defining your application's UI,
  to ensure proper display of your UI on screens with different
  densities.