Thursday, 31 January 2013

Components of Android

Android has basically four components which it uses to manage all the applications.
These are as follows:-

    Components of Android
  1. Activity
  2. Content Provider
  3. Broadcast Reciever
  4. Service
Here is just the overview of the components of Android.These components of android will be discussed in later posts.

1. Activity:- Activity is an visible component of android which is used to display the user interface to the user just like a frame in awt or swing.Interface is made using Xtensible Markup Language(XML).To use this, Activity class is provided by the android.Activity is full java based class.

2. Content Provider:-  This component provides the facility to share database between different applications.
e.g. As the contact detail is saved in contact application but we can use that information in other applications like Phone Dialer, Messaging, call, etc.
This facility is provided by Content Provider.

3. Broadcast Reciever:- This android component provides the facility to communicate between two or more applications. It is used by the application to broadcast its change of state to other applications.
e.g. Whenever we are listening music and a call is received at the same time, then in this situation music player is paused automatically and when the call is ended, Music player is resumed automatically.
This is done with the help of Broadcast Reciever.

4. Service:- Services are used to provide the facility for starting long running tasks which perform some operation in background and doesn't require much user interaction.
e.g. Downloading a file from network, playing some music in background,etc.
These tasks never interrupt in other applications.


These four components are the basic components which will discussed briefly in later posts with examples.

Thursday, 13 December 2012

Android LifeCycle


    In android, an application doesn't have any control over its lifecycle.

        Life Cycle of an Android Application could be managed by Android Run-time Environment which provide some callback methods to notify the different change of state of an application.

As an application developer, our responsibility would be just to override these callback methods to handle the change of state of an application.

Activity LifeCycle
Different states are:-
  • Active State
  • Visible State
  • Inactive/Invisible State
These states can be managed using following methods:-
  • onCreate()
  • onDestroy()
  • onStart()
  • onStop()
  • onPause()
  • onResume()
To be continued........

PHP Introduction

PHP ( Hypertext Preprocessor)PHP is a language that has been growned so fastly. It was originally conceived as a set or collection of macros to provide help to the coders to maintain their personal home pages, and its name given from this purpose i.e. Personal(P) Home(H) Page(P). Since then, The capabilities of PHP have been extended, taking it beyond a set of utilities to a full-featured programming language, capable of managing huge database-driven online environments or say complete WEBSITE can be managed using PHP. As PHP's capabilities have grown, so its popularity is also increased. PHP was running on around 1 million hosts in Nov. 1999. And in Feb. 2000, that figure had already risen to 1.4 million hosts. According to  E-Soft, PHP is the only module which is most popular on Apache, beating even ModPerl.
Now, PHP is officially known as PHP - "HyperText Preprocessor". It is an server-side scripting language basically written in an HTML context or HTML tag. Unlike an ordinary HTML page, a PHP script is not sent directly to a client by the server. Instead, it is parsed by the PHP binary or module or PHP interpreter. HTML elements in the script are left alone, but PHP code is interpreted and executed. PHP code in a script can be used to query databases, create images, read and write files, talk to remote servers. The possibilities in PHP are endless.
PHP is one of the easiest Web Development Language in which a complete full functioning website can be Developed in a day or two days.
As it provides the simplest Keywords to manage database, to get User Input or to respond user back.

Now-a-days this is most required language in the web development market.

Sunday, 9 December 2012

DVM(Dalvik Virtual Machine)

As we are familiar with the two major problems in mobiles,given as:-
i) Less Memory
i) Limited Battery Backup

Keeping these tow limitations in mind, we use Register Based Process Virtual Machine in Mobiles.
DVM is also an Register Based  Process Virtual Machine whereas JVM is an Stack Based Process Virtual Machine.

As in JVM, after compilation it gives BYTE Code which is platform-independant Intermidiate Code.

 Java File
(Compiled by java Compiler)
↓ 
Byte Code
(.class File)
↓ 
Dalvik Executable Code
(.dex File)

Just Like JVM, after compilation it generates DEX code i.e. Dalvik Executable Code which is also an platform independant Intermediate Code.

DVM Uses less memory for the execution of an instruction so that it is efficient in case of less memory as in mobiles.

Process Virtual Machine

Process Virtual Machine Continued.....

As you know, Process Virtual Machines are used to support an O.S. in the execution of an application.
e.g.
     JVM(Java Virtual Machine), CLR, DVM(Dalvik Virtual Machine), etc.
On the basis of its architecture, we have two types of Process Virtual Machine:-
  1.  Stack Based Process Virtual Machine
  2. Register Based Process Virtual Machine
 1) Stack Based VM :-  Stack based Process Virtual machines are faster and use Reduced Instruction Set (RISC Architecture).
e.g.
       JVM (Java Virtual Machine)
Main disvantage of this type of machines is that they require more memory.

2) Register Based VM :-  Register based process virtual machines are little bit slower than Stack Based Virtual Machine but take less memory to execute instruction.in comparison to Stack Based Virtual Machine.
e.g.
      DVM( Dalvik Virtual Machine)