0

Boolean data type and its exmples in java programming


  • Boolean is a primitive data type.
  • Boolean is the smallest data type in Java which is made up of only 1 bit.
  • Boolean data type represents only two possible values -  True and False.
  • The default Boolean value is False.

Syntax to Declare Boolean variable :

 boolean <variable name> = <default value>;

Example:

  boolean x = true;
  boolean y = false;

Simple Sample Program Describing Boolean Data Type:

  public class Main {
    public static void main(String[] args) {
      boolean x = true;    
      System.out.println("x is " + x);

      int y = 5;
      boolean z = (y > 15);
      System.out.println("z is " + z);
      }
    } 

Output:

  x is true
  z is false

The above is a simple example for Boolean data type in Java programming and click the link Primitive Data Type to learn more about other Data types in Java.
More
0

Download Eclipse Software And Installing Android SDK for Android Application Development

This tutorial is to explain how to Setup Android SDK with Eclipse. You may find many website which explains how to setup android development in eclipse and i tried to make the tutorial simple by adding images to it. Before we move forward with the tutorials we must know the system requirement Android SDK and they are listed below.


System Requirement For Android SDK :
Operating Systems
  • Windows XP (32-bit), Vista (32- or 64-bit), or Windows 7 (32- or 64-bit)
  • Mac OS X 10.5.8 or later (x86 only)
  • Linux (tested on Ubuntu Linux, Lucid Lynx)
  • GNU C Library (glibc) 2.7 or later is required.
  • On Ubuntu Linux, version 8.04 or later is required.
  • 64-bit distributions must be capable of running 32-bit applications.


1. Eclipse 3.6.2 (Helios) or greater
   Note: Eclipse 3.5 (Galileo) is no longer supported with the latest version of ADT.
2. Eclipse JDT plugin (included in most Eclipse IDE packages)
3. JDK 6 (JRE alone is not sufficient)
4. Android Development Tools plugin (recommended)
5. Not compatible with Gnu Compiler for Java (gcj)

Other development environments

1. JDK 6 (JRE alone is not sufficient)
2. Apache Ant 1.8 or later
3. Not compatible with Gnu Compiler for Java (gcj)
   Note: Some Linux distributions may include JDK 1.4 or Gnu Compiler for Java, both of which are not supported for Android development.

The above are the System Requirement for Android SDK and lets move on with the tutorial. Follow the below given steps to Setup Android SDK in Eclipse.

Step 1 : Download Android SDK And Unzip It

First step is to download Android Software Development Kit(SDK) and unzip the file to your specified folder. You can download Android SDK from Android SDK download page. After the download is finished you need to open the zip file and unzip the file to any of your specific folder.

Note : while unzip SDK file choose a folder location where the file wont get deleted because this file will be used by eclipse later.

Step 2 : Download Eclipse And Run Eclipse IDE

Now you need to run Eclipse to install Android SDK and if you don't have Eclipse IDE in your system then you can download Eclipse by Clicking Here. You can download latest version of Eclipse IDE from the given website and the website will look like below given image.

download eclipse for android
After finishing the download of Eclipse IDE, Unzip the file and open the unzipped folder and run the Eclipse.exe file. The below image will occur and Eclipse IDE will open.

eclipse juno
You need to select a workspace where all your projects and related files will get stored. Click Browse as shown in the blow image and select a folder of your choice where all your files and project will get stored.

eclipse work space
3. Installing Android Development Tool (ADT) Plugin To Eclipse :

Once you open Eclipse and set Workspace for it then you can install Android Development Tool (ADT) plugin using few simple steps as shown below.

   i) Start Eclipse and select Help -> Install New Softwares... as shown in the below image.


install new software in eclipse

   ii) Install window will appear in that click Add button. Add Repository window appears.

   iii) Add Name as Android and Location as https //dl-ssl.google.com/android/eclipse/  in Add Repository window and press OK .

install plugin in eclipse
   iv) Now you will see the Developer Tools in the Install window.

   v) Press Select All and press Next button.

install plugin in eclipse juno
   vi) Now you need to select file location and click Next button to install SDK.

configure android in eclipse
   vii) In Choose Packages To Install window select Accept All and click Install button.

install android sdk in eclipse
In the Android SDK Manager window, you can see a list of Android versions available and Extra tools. You can download and use any Android version but its better if you start using Android 2.1 which is the basic version that support most of the Android devices.

android sdk manager
Step 4: Configuring Android SDK

Now after downloading Android SDK and installing Android Development Tool plugin next step is to Configuring Android SDK. Follow the below steps

   i) Select Window -> Preferences in Eclipse.


   ii) In SDK Location select the folder location where you have saved the SDK file which we unzip on Step 1 and we need to select a SDK from it and press Apply button and then finally click OK button.

configure android sdk

 Step 5 : Creating Your Android Virtual Device

   i) Lastly we need to create the Android Virtual Device that will be our Android Emulator through which we can run and test our Android Projects in our PC.

   ii) You can create Android Virtual Device by clicking on the icon on Eclipse as shown in the below or you can select it by clicking on Window -> AVD Manager.

android virtual device
   iii) Now Android Virtual Device Manager window will open and there you can see a New button on the right side. Click the New button.

   iv) Create new Android Virtual Device Window will Appear and it has Name, Target and other options in it.

   v) In Name write any name which you would like to use and in Target select the Android Version which you would like to use in your Android Emulator and leave the other options as it is and finally click on Create AVD.

Now you can start programming Android applications and when you run the application, the application will be executed in Android Emulator.

android emulator windows

android 4.0
More
0

What is Android

what is android operating system, about android

Android is a Linux based operating system mainly created for mobile phones such as smartphone and tablet computers. Android operating system is also used in embedded systems such as networking equipment, smart TV systems including set top boxes and built in systems and various devices as varied as house hold appliances and wrist watches.

Android Inc was started in Palo Alto, California, United States on October 2003 by Andy Rubin. Google bought Android Inc on August 17, 2005. With 500000 new Android activation's a day, it is becoming the dominant player in mobile operating system and now majority of mobile device use Android Operating System in it.

Android Versions :

Android Released its  first version "Astro" on September 23, 2008 and since then it has been updating frequently which fixes bugs of previous versions and improves performance by adding new features. Below are the list of Android version released till date.

1. Astro was released on November 5, 2007

2. Bender was released On February 9, 2009

3. Cupcake was released on April 30, 2009

4. Donut was released On September 15, 2009

5. Eclair was released On October 26, 2009

6. Froyo was released On May 20, 2010

7. Gingerbread was released On December 6, 2010

8. Honeycomb was released On February 22, 2011

9. Ice Cream Sandwich was released on October 19, 2011

10. Jelly Bean was released on July 11, 2012

This are the Android versions released upto date and Each version after Astro and Bender is named in alphabetical order after a dessert or sweet treat, with "Cupcake" being the first and every update since following this naming convention.
More
0

Compile And Run A Java Program Using Command Prompt

The following tutorial is going to take you step-by-step with the process of compiling and running java program. The easiest method to understand is to compile and run these programs on your own. I chose to make this because I've come across a lot of java beginners who does not know how to compile and run a java program.

To start with, we need to have JDK installed on our PC. You can easily download JDK from java website or you can also check Tutorial To Download And Install Java In Windows.

Compile Java Program Using Command Prompt :

Before Java virtual machine (VM) can run a Java program, Java source code needs to be compiled into byte-code using the javac compiler. In order to compile a Java source code of file helloworld.java you should do the following steps.

1. open cmd(command prompt) from run.
2. open directory in command prompt in which your java file is stored.
3. compile your java file using javac command.

Syntax To Compile A Java Program :
javac FileName.java

Example :
javac helloworld.java

4. If there are no errors in your source file, the Java compiler will produce .class file. For instance, the results of a successful compile of helloworld.java will produce a byte-code version of the class in a file named helloworld.class.

Running A Java Program Using Command Prompt :

1. After you have successfully compiled your Java source code, you'll be able to invoke the Java Virtual Machine to run your program byte code.
2. You can run a java program in command prompt using java command.

Syntax To Run Java Program In Command Prompt :
java FileName

Example :

java helloworld

Video Tutorial To Compile And Run A Java Program Using Command Prompt :

More
0

Video Tutorial To Set Path For Java In Windows Operating System

This Tutorial is about how to set a path for java in windows operating system. You need to install java first to set a path. You can get details of how to install java from Tutorial To Download And Install Java In Windows .


Also check Image Tutorial To Set Path For Java In Windows.
More