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)
 

Wednesday, 14 November 2012

Virtual Machine

VM ( Virtual Machine)

Dalvik Virtual Machine(DVM)Virtual Machine(VM):- 

VM is an  software implementation of a machine or computer which is used to execute our program like on a physical machine. VM is a set of instructions which will be followed to execute our program. On the basis of use, we have two types of Virtual Machine:-


  1. System Virtual Machine
  2. Process Virtual Machine
System VM are used to simulate complete working of an operating system or hardware.
e.g.
     Virtual PC, VMWare, etc.


Process VM are used to support an operating system in the execution of an application.

e.g.
      JVM, CLR(Common Language Runtime used in Dot Net), DVM, etc.

Process VM To Be Continued.........

Monday, 12 November 2012

Android Vs. J2ME

Android Vs. J2ME(Java 2 Micro Edition) 

 

In Conventional model  of mobile application or say J2ME, we have two major problems:-

  1. Third Party Apps were treated as second class citizen i.e. all the system resources were not available to them and in case of processor/memory request, they were killed first.
  2. To develop an app in a native technology native API's and hardware specification must be learned by the developer which were all available to them at large. To develop an application which has complete access to resources, the  application development require native libraries which are propriated.

Android vs. J2ME using FLOW Diagram 

Android vs. J2ME
Click on the pic to view the complete diagram

Thursday, 1 November 2012

Android Architecture

Architecture of Android


Application
Native App                   3rd Party App             Developer App


Application Framework
(Set of API's written in java to provide productive app developement)

↕                                                                     ↕

                            Native Library                                           Dalvik Virtual Machine 

↕                                                                    ↕

 Linux Kernel
Device Drivers          Power Mgt.          Memory Mgt.           Process Mgt.

Wednesday, 10 October 2012

Android Introduction

Android is an open source mobile platform provided by Google which comprises of mobile operating system, Application development framework, Run-time environment and some applications developed in Android.

Android is like an Software Stack which provides the facility to develope, to deploy and to execute an application. Software Stack means more than one software includess.

In short, Android is Linux based open source mobile application development platform or say mobile based operating system.

There are two types of mobile operating system:-
  1. Propritate  OS
  2. Open Source
Propritate OS means you can't change the Operating system files and we have to take license for developing applications in that OS i.e. we have to pay money for developing applications in propritate OS.
e.g.
     I O.S. and Blackberry

Open Source OS means you can change the operating files and we don't have to take license for developing application in that OS.
e.g.
     Android

One of the best thing in android is that it is open source so that we don't have to pay to create application in this or to use its API's.


To be Continued...........

Saturday, 29 September 2012

C Introduction

Introduction TO C language:  

C Introduction
     C an programming language which is the base language of all the languages like c++, Java, PERL, Limbo, etc.

Dennis Ritchie Founder of C
C Introduction
C was firstly introduced and developed by Dennis Ritchie in 1969 at AT & T Bell Laboratory.


After the  C Introduction , the first Operating System is made using C language and known as UNIX.

UNIX is fully developed in C and known as the most secure Operating System.

After UNIX then Linux and Windows are developed using one and only C language.

All other languages uses the syntax and structure of C.

In short, C is the backbone of all other languages.

Wednesday, 12 September 2012

Java Tutorial Asignment

Java Tutorial AsignmentAsignment for java tutorial :-

Here am going to tell you about some java tutorial which you use most of the time.

You can take this as your asignment for java tutorial and which one writes the best, I'll publish that java tutorial on my blog.So just write the best java tutorial on the following topics:-





1. Write the java examples for printing output like this:-

                         *
                       *  *
                     *  *  *
                   *  *  *  *
2. Write the java examples for swaping two numbers without using a third variable.

3. Write the java examples for printing output like this:-

              1
          1  2  1
        1  2  2  1
      1  2  3  2  1

Monday, 10 September 2012

Adding two numbers using IInd Method(J2SE)

Adding two numbers
J2SE Programming

Now m going to write the program for adding two numbers using values via command line arguments.
Command-Line arguments are the arguments which are passed just before run time i.e. after compilation.
Now the problem is how to get the arguments via command line.
Command Line arguments are passed in the String array used in main function as an argument.
Now the numbers are passed as string and we want int then what to do for this.
We have a static method in Integer class i.e. parseInt(String) which takes an argument of type string an returns int and there is a condition that the string passed in this should have a valid int value otherwise there is an run time exception i.e. NumberFormatException.


Here is the program for this:-


                                       class abc                                        
                                       {
                                               int a,b,sum;

                                              public static void main(String[] args)
                                              {

                                                  a=Integer.parseInt(args[0]);      //Getting int from string array at position 0

                                                  b=Integer.parseInt(args[1]);     //Getting int from string array at position 1

                                                  sum=a+b;                               //Adding numbers

                                                  System.out.println("Sum = "+sum);            // Printing sum

                                             }
                                       }

Now how to pass value in that string array.
Here is the solution:-

Firstly compile it as usual using Javac program.java
Now Run using java program arg1 arg2
arg1 arg2 are the arguments which are the a and b.


For further queries, feel free to contact us any time using our contact us form.
Thank You.

Sunday, 29 July 2012

WAP to add two numbers by just assigning values(J2SE).

Adding two numbers
J2SE Programming

Now I am going to write a program which adds two numbers.
For this i just want to know about addition operator and two inputs.
As we know, there is one operator known as plus(+) operator can be used to add two inputs.
Now the problem is how to get input for adding numbers.

 There are three ways to get input as follows:-
  1. One way is just by assigning values.
  2. Second way is by User input during Run-time.
  3. Third way is using Command-Line arguments.
Here we are using First way i.e. by Assigning values.
Other ways will be discussed Later.

                               class Addition
                              {
                                          //Main Function
                                       public static void main(String[] args)
                                      {
                                          Addition a1=new Addition();
                                          int a=a1.add(10,20);
                                          System.out.println(Sum is : +a);
                                      }

                               //Function to add two numbers

                                       public int add(int a,int b)
                                      {

                                         int c=0;
                                         c=a+b;
                                         return c;

                                      }
                              }


Now save it as Addition.java
Compile it using "javac Addition.java" Command in CMD
After compilation Run it using command "java Addition" in CMD

Saturday, 28 July 2012

Printing Hello World In Java(J2SE)

J2SE Programming

Here now we go for our first program i.e. printing hello world in java.

class HelloWorld
{
        public static void main(String[] args)
        {
           System.out.println("Hello World");
        }
}

Now compile it as show in fig.
Firstly you have to move into the directory where the file is saved(use cd to move between Directories )


Print hello world in java

Once you have compiled it then Run it as Shown in fig below

Print hello world in java


Wednesday, 25 July 2012

Starting Java(J2SE) Programming

Start Java Programming
J2SE Programming

As we know there are three types of programming we can do in Java. One is Console Based, second is Window Based and third one is Web-Based.
We start firstly with Console based.

Before Actual working, I tell some syntax used in java
Class syntax :    class <class_name>
                            {
                              //code to do
                           }
e.g.
      class abc
      {
        //code
      }

Method Declaration :  access_specifier return_type <function_name>(Argument List)
                                    {
                                      //Code to do
                                    }
e.g.
      public void doStuff()
      {
       System.out.println("DoStuff");
      }

Variable Declaration : type <variable_name>;

e.g. int a;

Variable Intialization : name=<variable_value>;

e.g. a=10;

Object Creation : type <reference_name>=new type(Arg List);

abc a1=new abc();

How java(J2SE) compiler works?

J2SE Programming

Here am going to tell you how java compiler works i.e. what is the actual working of java compiler.

If you write a program in java then it is both compiled and interpreted. The aim of the both compilation and interpretion is just to make program made by you more secure and making it portable i.e. platform independent.

Java Compiler Working

Now What actually happen when you compile a java program:-
  1. Firstly it is compiled for any error like Syntax error,etc.
  2. Once it is compiled, code is generated by the compiler known as BYTE Code which is some binary code can't be understandable by the Humans.The file generated by compiler has a extension of .class
  3. Like if you compile a file named First.java, then compiler generates a file named First.class which can be viewed using notepad but can't be understanded.
  4. Once the byte code is generated, it can be run on any platform.Here run means Interpreting the byte code and providing the appropriate output.
  5. There is one another thing in java which makes it more efficient i.e JIT(Just In Time Compiler) which is a part of JVM( Java Virtual Machine) which converts only necessary code to executable code              e.g. if then is an if condition which is already known that else part will be executed then JIT converts only that else part to the executable code but not the if part. JIT Comes in action during Run Time.
  6. After that the appropriate output is shown on the screen.

Monday, 23 July 2012

Java(J2SE) Intro

Java Introduction
JAVA INTRO


 J2SE Programming

Java , a programming language which is fully based on oops concept was developed by James Gosling in 1992 at Sun Microsystem.It was initially called as OAK.
Java is accepted as a core component of the organisation in 1995
Syntax used in java are much similar to used in C and C++.

Java is both Compiled and interpreted which is the best feature of it to make it secure.




It is an platform independent programming language in which following work can be carried out:-

  • Console Based applications
  • Window Based Applications
  • Web Based Applications

Features In Java:-


  • Simple
  • Object Oriented language.
  • Robust
  • Secure Language
  • Easy-to-understand
  • Multi-threded
  • Interpreted
  • Distributed
  • Dynamic
  • Portable