Why XML used in Android

XML stands for Extensible Markup Language. It is a markup language much like HTML but the the difference between XML and HTML is, XML was designed to transport and store data while HTML was designed to display data..
 

XML is easy to parse and manipulate data pro-grammatically. It is a verbose(expressed in more words) and having a easily human readable format.

The reason that XML was chosen for android is because of its familiarity and the number of IDE (Integrated Development Environment like eclipse) tools that natively support it.

There are several XML files used:

    Layout XML:
    -Used to define the actual UI (user interface) of your application.
    -It holds all the elements or the tools that you want to use in your application.


     Manifest XML:
    -Used to define all the components of your application.
    -It includes the names of your packages, your classes(Activities), services, permissions that your application needs.
    
    String XML:
    -Used to replace the hard coded strings with a single string.
    -Like, you can replace "Welcome to my application" with a string named "welcome" and you can refer to that string.

    Styles XML:
    -Used to define different styles and looks for the UI of your application.

    Drawable XML:
    -Used to provide various graphics to the elements of your application.

Comments

Popular posts from this blog

SQLiteDatabase (Without SqliteOpenHelper class)

Set current date to Button and Datepicker dialog

MVC Architecture in Android