Posts

Showing posts from November, 2013

MVC Architecture in Android

Image
MVC represents Model-View-Controller Model : Manage the behavior and data of the application R esponds to requests for information about its state (usually from the view) Responds to instructions to change state (usually from the controller) Allows the views to produce updated output View : T ypically a user interface element O ne to one correspondence with a display surface Present the model to the user Generates the output representation to the user Controller : Controls both model and view Accepts input from the user and instructs the model and the view to perform actions based on that input Update view when model changes Update model when user manipulate the input

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 ha

Components of Android

A component is a piece of code that has a well-defined life cycle like Activity, Intent, Service etc. The fundamental components of Android are activities, views, intent, service, content providers, fragments and AndroidManifest.xml. Activity is a class that represents a single screen. It is like a Frame in AWT. View is the UI element such as Button, TextView, Label etc. Anything that you see on display screen is View. Intent is used to invoke the components. It is mainly used to: Start the service Launch an activity Display a webpage Broadcast a message Dial a phone call etc. Service is a background process that runs for a long time. There are two types of services local and remote. Local service is accessed from within the application and remote service is accessed remotely from another application running on the same device. Content Providers are used to share data between the applications. Fragments are part of an activity. An activity can display one or

Android Versions and Android Architecture

Image
Android version names are very interesting. The names of android versions ranges from A to K currently such as, Aestro, Blender, Cupcake, Donut, Eclair, Froyo, Gingerbread, Honeycomb, Ice Cream Sandwich, Jelly Bean, Kitkat and Lollipop. Android versions having their own API (Application Programming Interface that is how software components interact with each other). Based on API, android versions divided as follows: Android 1.0 (API level 1) Android 1.1 (API level 2) Android 1.5 Cupcake (API level 3) Android 1.6 Donut (API level 4) Android 2.0 Eclair (API level 5) Android 2.0.1 Eclair (API level 6) Android 2.1 Eclair (API level 7) Android 2.2–2.2.3 Froyo (API level 8)   Android 2.3–2.3.2 Gingerbread (API level 9) Android 2.3.3–2.3.7 Gingerbread (API level 10)   Android 3.0 Honeycomb (API level 11)   Android 3.1 Honeycomb (API level 12) Android 3.2 Honeycomb (API level 13) Android 4.0–4.0.2 Ice Cream Sandwich (API level 14) Android 4.0.3–4.0.4 Ice Cream Sandwich (