Friday, 30 March 2012

Install Java in Internet Explorer

This information applies to Windows Internet Explorer 7 and Windows Internet Explorer 8.

Java is a technology used to create interactive or animated web content such as games or advanced financial applications. Java programs are downloaded automatically to your computer when you use them and usually require no special installation. To run Java programs in Internet Explorer, but you have to install special software Java. When you install Java, is enabled by default and configured with security settings at their highest level.

To install Java, follow these steps:

    1 Open Internet Explorer by clicking the icon on the Start button and click the Internet Explorer.

    2.GO website Java.com.

    Free Java 3.Click Download button and then click I Agree and Start Free Download. This will take you to the setup screen Java. Administrator permission required If you are prompted for an administrator password or confirmation, type the password or provide confirmation.

   If the fourth a yellow information bar appears (warning that the website requires an ActiveX control or add-on from Sun Microsystems), click the yellow bar and click Install ActiveX Control or Install Add-ons. When a security warning dialog box appears, click Install.

    5.Click Install. (Note that you also change the location where Java is installed by default location of C: \ Program Files \ Java by selecting the Change destination folder check box and follow the instructions.)

    6.When you see the successful completion dialog box, click Close. Java does not require any additional settings or restarts.

To uninstall older versions of Java, follow these steps:

    1 Open Programs and Features, clicking the icon on the Start button, click Control Panel, click Programs and then click Programs and Features.

    2.Epilexte Java, and then click Uninstall. Administrator permission required If you are prompted for an administrator password or confirmation, type the password or provide confirmation.

Thursday, 29 March 2012

Abstract Class and Interface


    Java Interview Questions site discussing core java IT technical interview questions in detail. These are some of the java job interview questions me and my friends have faced regularly in campus interviews and off campuses. I have consolidated all of them from different people and communities into a vast resource of core java interview questions all in one place. So I am giving you a chance to prepare well by going through each of the java interview faqs organized by java topics, before attending a technical interview on java.

When To Use Interfaces
An interface allows somebody to start from scratch to implement your interface or implement your interface in some other code whose original or primary purpose was quite different from your interface. To them, your interface is only incidental, something that have to add on to the their code to be able to use your package. The disadvantage is every method in the interface must be public. You might not want to expose everything.
When To Use Abstract classes
An abstract class, in contrast, provides more structure. It usually defines some default implementations and provides some tools useful for a full implementation. The catch is, code using it must use your class as the base. That may be highly inconvenient if the other programmers wanting to use your package have already developed their own class hierarchy independently. In Java, a class can inherit from only one base class.
When to Use Both
You can offer the best of both worlds, an interface and an abstract class. Implementors can ignore your abstract class if they choose. The only drawback of doing that is calling methods via their interface name is slightly slower than calling them via their abstract class name.

Java Abstract Class and Interface Interview Questions
What is the difference between Abstract class and Interface
Or
When should you use an abstract class, when an interface, when both?
Or
What is similarities/difference between an Abstract class and Interface?
Or
What is the difference between interface and an abstract class?

1. Abstract class is a class which contain one or more abstract methods, which has to be implemented by sub classes. An abstract class can contain no abstract methods also i.e. abstract class may contain concrete methods. A Java Interface can contain only method declarations and public static final constants and doesn't contain their implementation. The classes which implement the Interface must provide the method definition for all the methods present.

2. Abstract class definition begins with the keyword "abstract" keyword followed by Class definition. An Interface definition begins with the keyword "interface".

3. Abstract classes are useful in a situation when some general methods should be implemented and specialization behavior should be implemented by subclasses. Interfaces are useful in a situation when all its properties need to be implemented by subclasses

4. All variables in an Interface are by default - public static final while an abstract class can have instance variables.

5. An interface is also used in situations when a class needs to extend an other class apart from the abstract class. In such situations its not possible to have multiple inheritance of classes. An interface on the other hand can be used when it is required to implement one or more interfaces. Abstract class does not support Multiple Inheritance whereas an Interface supports multiple Inheritance.

6. An Interface can only have public members whereas an abstract class can contain private as well as protected members.

7. A class implementing an interface must implement all of the methods defined in the interface, while a class extending an abstract class need not implement any of the methods defined in the abstract class.

8. The problem with an interface is, if you want to add a new feature (method) in its contract, then you MUST implement those method in all of the classes which implement that interface. However, in the case of an abstract class, the method can be simply implemented in the abstract class and the same can be called by its subclass

9. Interfaces are slow as it requires extra indirection to to find corresponding method in in the actual class. Abstract classes are fast

10.Interfaces are often used to describe the peripheral abilities of a class, and not its central identity, E.g. an Automobile class might
implement the Recyclable interface, which could apply to many otherwise totally unrelated objects.

Note: There is no difference between a fully abstract class (all methods declared as abstract and all fields are public static final) and an interface.

Note: If the various objects are all of-a-kind, and share a common state and behavior, then tend towards a common base class. If all they
share is a set of method signatures, then tend towards an interface.

Similarities:
Neither Abstract classes nor Interface can be instantiated.

What does it mean that a method or class is abstract?

An abstract class cannot be instantiated. Only its subclasses can be instantiated. A class that has one or more abstract methods must be declared abstract. A subclass that does not provide an implementation for its inherited abstract methods must also be declared abstract. You indicate that a class is abstract with the abstract keyword like this:

    public abstract class AbstractClass

Abstract classes may contain abstract methods. A method declared abstract is not actually implemented in the class. It exists only to be overridden in subclasses. Abstract methods may only be included in abstract classes. However, an abstract class is not required to have any abstract methods, though most of them do. Each subclass of an abstract class must override the abstract methods of its superclasses
or itself be declared abstract. Only the method’s prototype is provided in the class definition. Also, a final method can not be abstract and vice versa. Methods specified in an interface are implicitly abstract.
. It has no body. For example,

public abstract float getInfo()

What must a class do to implement an interface?

The class must provide all of the methods in the interface and identify the interface in its implements clause.

What is an abstract method?

An abstract method is a method whose implementation is deferred to a subclass.

What is interface? How to support multiple inhertance in Java?

Or

What is a cloneable interface and how many methods does it contain?

An Interface are implicitly abstract and public. Interfaces with empty bodies are called marker interfaces having certain property or behavior. Examples:java.lang.Cloneable,java.io.Serializable,java.util.EventListener. An interface body can contain constant declarations, method prototype declarations, nested class declarations, and nested interface declarations.

Interfaces provide support for multiple inheritance in Java. A class that implements the interfaces is bound to implement all the methods defined in Interface.
Example of Interface:
public interface sampleInterface {
public void functionOne();

public long CONSTANT_ONE = 1000;
}

What is an abstract class?
Or
Can you make an instance of an abstract class?

Abstract classes can contain abstract and concrete methods. Abstract classes cannot be instantiated directly i.e. we cannot call the constructor of an abstract class directly nor we can create an instance of an abstract class by using “Class.forName().newInstance()” (Here we get java.lang.InstantiationException). However, if we create an instance of a class that extends an Abstract class, compiler will initialize both the classes. Here compiler will implicitly call the constructor of the Abstract class. Any class that contain an abstract method must be declared “abstract” and abstract methods can have definitions only in child classes. By overriding and customizing the abstract methods in more than one subclass makes “Polymorphism” and through Inheritance we define body to the abstract methods. Basically an abstract class serves as a template. Abstract class must be extended/subclassed for it to be implemented. A class may be declared abstract even if it has no abstract methods. This prevents it from being instantiated. Abstract class is a class that provides some general functionality but leaves specific implementation to its inheriting classes.

Example of Abstract class:

abstract class AbstractClassExample{

protected String name;
public String getname() {
return name;
}
public abstract void function();
}

Example: Vehicle is an abstract class and Bus Truck, car etc are specific implementations

No! You cannot make an instance of an abstract class. An abstract class has to be sub-classed.
If you have an abstract class and you want to use a method which has been implemented, you may
need to subclass that abstract class, instantiate your subclass and then call that method.

What is meant by "Abstract Interface"?

Firstly, an interface is abstract. That means you cannot have any implementation in an interface.
All the methods declared in an interface are abstract methods or signatures of the methods.

How to define an Interface?

In Java Interface defines the methods but does not implement them. Interface can include constants.
A class that implements the interfaces is bound to implement all the methods defined in Interface.
Example of Interface:

public interface SampleInterface {
public void functionOne();

public long CONSTANT_ONE = 1000;
}

Can Abstract Class have constructors? Can interfaces have constructors?

Abstract class's can have a constructor, but you cannot access it through the object, since you cannot instantiate abstract class. To access the constructor create a sub class and extend the abstract class which is having the constructor.

Example
public abstract class AbstractExample {
public AbstractExample(){
System.out.println("In AbstractExample()");
}
}

public class Test extends AbstractExample{
public static void main(String args[]){
Test obj=new Test();
}
}

Wednesday, 28 March 2012

Java Runtime Environment (JRE) (64-Bit)

Java Runtime Environment (JRE) (64-Bit) provides the libraries, the Java Virtual Machine, and other components to run applets and applications written in the Java programming language. In addition, two key deployment technologies are part of the JRE: Java Plug-in, which enables applets to run in popular browsers; and Java Web Start, which deploys standalone applications over a network.

Read more: Java Runtime Environment (JRE) (64-Bit) - Download.com http://download.cnet.com/Java-Runtime-Environment-JRE-64-Bit/3000-2378_4-75317067.html#ixzz1qTgteRgO

64-bit Java

    What is 64-bit Java?
    Which platforms and Java releases support 64-bit operation?
    Where can I download the 64-bit SDK or JRE?
    When you download the SDK or JRE, must you choose between the 32 and 64-bit versions?
    How do I select between 32 and 64-bit operation? What's the default?
    Are both -client and -server VM modes available in 64-bit Java?
    Which components do not support 64-bit operation?
    How is native code affected?
    When writing Java code, how do I distinguish between 32 and 64-bit operation?
    Will 32-bit native code work with a 64-bit VMs?
    Where can I learn more about 64-bit programming?
    What are the performance characteristics of 64-bit versus 32-bit VMs?
    What are the default heap sizes for 64-bit VMs if GC ergonomics is not used?
    How large a heap can I create using a 64-bit VM?
    Which garbage collector should I use for very large 64-bit heaps?

Tuesday, 27 March 2012

What is the hottest Java web framework? Or maybe not Java?


I have not sat down for a long time and actually tried to determine the development of Java web framework arena. The host of "easy to use" Java web frameworks, which now adays is too many to be only partially aware.

Struts 1 came at a perfect time in history ... where your only option was either hand-coding everything or Struts ... and most people went with Struts.

Flash forward a few years later and now you are in a state where everyone has done, reviewed and revised and Struts Model 2-style web-frames again and again and again, each supposedly easier and faster than the previous one.

Some of the frames actually some pretty cool ideas on the table in new and interesting ways. They need other basic tasks with the most complicated / confusing syntax that you adjust to your ever thought that you (did sorta like Windows Vista) has already spent years learning and learn entirely new technology stack from scratch.

With so many options for Java web frameworks are and most of them are pretty decent from a technical level, the only thing to grow the adoption of specific tools and tool support causes.

Unfortunately, not many of the teams that understand these frameworks, / believe it or not, want to work with tools (of course, it can be very different tools to do than to make a frame).

In other words, what if you are a fairly experienced developer, and need no tools? What Java web framework has to be chosen for you? Well, that's what I want to try and find out ...

I will only examine frames that I have experienced significant growth and news for the past few years ... I apologize if I have your favorite part here, if it is excluded large enough to let me know and I'll add it.

I also tried only next-gen frameworks are ... Struts or WebWork so not in this list. The Java web frameworks I narrowed down to are (in no particular order):

JavaServer Faces: It's part of the specification have to consider it.
Apache Wicket: Big grassroots effort, personal favorite and strong team.
JBoss Seam: A lot of people who say it and it's pretty amazing solution for JSF development.
Spring MVC and WebFlow: I'm a pot would be thrown, because I do not think either has a significant market penetration to justify on their own, the various categories.
Struts 2: Struts was too big, not to count it.
And finally, I wanted to take a look (curiosity) to the following non-Java web frameworks:

Adobe Flex: This is where a lot of people praise him, who use them.
Ruby on Rails: Sizzling Hot
NOTE: I used Google Trends to determine a universal interest / penetration level of each technology. Alternative names for some technologies were combined to a single value (for example, "JSF" and "Java Server Faces" and "Java Server Faces") to create, in the hope to provide the most accurate values.

I would also make clear that Google Trends (not the number of pages indexed by the specified conditions) data on the frequency of keywords based. So if you "cat" to "Dog" They tend trending the frequency of times people use words like "cat" vs. "dog" look.

This is actually an interesting data point, because I think most people are looking for terms in the evaluation or to learn a technology stack ... not just for fun. So, by striking keyword frequency, we get a live "vibe" as active community around these technologies are in a roundabout way. Or at least a decent approximation is determined by the interest of a larger development community.

I used to represent the following values ​​into Google Trends engine, each frame:

JavaServer Faces (JavaServer Faces) | (JavaServer Faces) | JSF
Apache Wicket (Apache Wicket) | Wicket
JBoss Seam: (JBoss Seam) - Can not with the term "seam" is too simple
Spring MVC and WebFlow: (Spring MVC) | (Spring WebFlow) | (Spring Web Flow)
Struts 2 (Struts 2) | (struts2)
And for non-Java frameworks:

Adobe Flex (Adobe Flex) | (Adobe AIR) | (Flex 2) | (Flex 3)
Ruby on Rails (Ruby on Rails) | "RoR" | ruby ​​rails
I've tried to include most all of the different variations of the name, they provide the technology stack and eliminate potential false positives in order to give as accurate results as possible, especially with the framework contained normal-ish words in their names (for Example Seam and Flex).

If you have any improvements that you think might make the results more accurately have said, let me know.

NOTE: Also see the liberal use of qualifiers, I realized that it still creates an error rate of frequent words that can possibly fit one period. So do your own research and come to your own conclusions from the research environment for use in the workplace.

Let us now begin to analyze it. If you have all 4 of Java web frameworks chart a trend, at the end did with what I found to be a rather surprising result, JSF is the clear winner with a surprising amount of Struts 2 in mixed there:

Monday, 26 March 2012

Android 4.0 Ice Cream Sandwich This is The Very New Latest Version


Cellphones, Software, Tablet PCs
Android 4.0 Ice Cream Sandwich review

The next version of each smartphone's operating system is always the best. We impatiently wait for the latest and greatest firmware to come around, expecting it to liberate us from the shackles of last year's code and features that haven't shown up yet. This happens incessantly with Google's Android OS, and version 4.0 -- unveiled at this year's I/O conference in May -- is no different. Known as Ice Cream Sandwich (referred to henceforth as ICS), the last word in the title indicates the merging of Gingerbread, the most recent phone platform, and Honeycomb, the version optimized for use on tablets. We knew this much, but were otherwise left with conjecture as to how the company planned to accomplish such a feat -- and what else the new iteration had in store.


Which devices will get Ice Cream Sandwich?
Hands-on screenshot gallery
Galaxy Nexus and ICS roundup
But now the time of reckoning is upon us, and the Samsung Galaxy Nexus -- Android 4.0's mother ship -- is slowly spreading across the globe, its users being treated to this year's smartphone dessert. ICS is one of the largest and most important upgrades we've witnessed from Android since its humble beginnings, making a huge change in user experience as well as a massive number of bullet points on the list of features. Now that we've had the opportunity to take it for a spin, where does it stand in the ranks of mobile operating systems? Follow us beneath as we dig into the layers of this sweet sandwich.

CIO — Earlier this week, Google officially announced the latest version of its popular Android mobile OS, v4.0, a.k.a., "Ice Cream Sandwich," along with a brand new device that runs Android 4.0: The Samsung Galaxy Nexus--formerly referred to as the "Nexus Prime."
Though Google is really targeting consumers with Android 4.0, the new OS packs a handful of new features and functionality that could be valuable to businesspeople and the IT administrators who support them. The following list spotlights eight of the most noteworthy business features in Android 4.0, which should become available on a variety of new devices in addition to the Galaxy Nexus, and via software updates for some existing handhelds, in the coming weeks and months.
1) Android 4.0 Supports On-Device Encryption

The latest version of Android, 4.0, supports full on-device data encryption, according to Dan Morrill, a Google engineer who works on the Android OS. Past versions of the Android handheld OS could connect to Microsoft Exchange Servers for access to corporate e-mail, calendars, contacts and more, but only if those Exchange Servers did not have a device-encryption IT policy enabled. (Microsoft's brand new Windows Phone 7.5 "Mango" OS does not support on-device encryption, and as such, I recently dubbed it unsuitable for business use.)

Android Ice Cream Sandwich device encryption means any corporate data stored on users' devices is "scrambled" to protect the info if the handheld is lost or stolen.

Google's latest tablet OS, Android 3.0 "Honeycomb," already supports on-device encryption, according to Morrill.
2) Voice Typing Enhancements in Android 4.0

Android's talk-to-talk engine got a lot "smarter" with Ice Cream Sandwich, according to Google. Text should instantly appear on screen as you speak. You simply touch the microphone on your Android 4.0 device's keyboard and use your voice to instantly type your emails, SMS, or anywhere you want to enter text.

These enhancements should make the feature a much more viable option for business users.
3) Improved Copy and Paste in Android 4.0

The copy and paste function in Android Ice Cream Sandwich also got an upgrade, according to TechCrunch. Selecting, copying and replacing content should be significantly easier. And users can now move around full blocks of text. Enterprise users who send lots of e-mail and other messages are sure to appreciate this enhancement.
4) New Calendar Features in Android 4.0

The Android Ice Cream Sandwich OS has a revamped calendar UI that makes navigating calendar pages easier and more intuitive. And a new pinch-to-zoom feature makes precise zooming in on calendar items much simpler. 

Wednesday, 21 March 2012

Introduction to Java's Architecture





At the heart of Java technology lies the Java virtual machine--the abstract computer on which all Java programs run. Although the name "Java" is generally used to refer to the Java programming language, there is more to Java than the language. The Java virtual machine, Java API, and Java class file work together with the language to make Java programs run.

The first four chapters of this book (Part I. "Java's Architecture") show how the Java virtual machine fits into the big picture. They show how the virtual machine relates to the other components of Java's architecture: the class file, API, and language. They describe the motivation behind--and the implications of- -the overall design of Java technology.

This chapter gives an introduction to Java as a technology. It gives an overview of Java's architecture, discusses why Java is important, and looks at Java's pros and cons.
Why Java?

Over the ages people have used tools to help them accomplish tasks, but lately their tools have been getting smarter and interconnected. Microprocessors have appeared inside many commonly used items, and increasingly, they have been connected to networks. As the heart of personal computers and workstations, for example, microprocessors have been routinely connected to networks. They have also appeared inside devices with more specific functionality than the personal computer or the workstation. Televisions, VCRs, audio components, fax machines, scanners, printers, cell phones, personal digital assistants, pagers, and wrist-watches--all have been enhanced with microprocessors; most have been connected to networks. Given the increasing capabilities and decreasing costs of information processing and data networking technologies, the network is rapidly extending its reach.

The emerging infrastructure of smart devices and computers interconnected by networks represents a new environment for software--an environment that presents new challenges and offers new opportunities to software developers. Java is well suited to help software developers meet challenges and seize opportunities presented by the emerging computing environment, because Java was designed for networks. Its suitability for networked environments is inherent in its architecture, which enables secure, robust, platform- independent programs to be delivered across networks and run on a great variety of computers and devices.
The Challenges and Opportunities of Networks

One challenge presented to software developers by the increasingly network- centric hardware environment is the wide range of devices that networks interconnect. A typical network usually has many different kinds of attached devices, with diverse hardware architectures, operating systems, and purposes. Java addresses this challenge by enabling the creation of platform-independent programs. A single Java program can run unchanged on a wide range of computers and devices. Compared with programs compiled for a specific hardware and operating system, platform-independent programs written in Java can be easier and cheaper to develop, administer, and maintain.

Another challenge the network presents to software developers is security. In addition to their potential for good, networks represent an avenue for malicious programmers to steal or destroy information, steal computing resources, or simply be a nuisance. Virus writers, for example, can place their wares on the network for unsuspecting users to download. Java addresses the security challenge by providing an environment in which programs downloaded across a network can be run with customizable degrees of security.

One aspect of security is simple program robustness. Like devious code written by malicious programmers, buggy code written by well-meaning programmers can potentially destroy information, monopolize compute cycles, or cause systems to crash. Java's architecture guarantees a certain level of program robustness by preventing certain types of pernicious bugs, such as memory corruption, from ever occurring in Java programs. This establishes trust that downloaded code will not inadvertently (or intentionally) crash, but it also has an important benefit unrelated to networks: it makes programmers more productive. Because Java prevents many types of bugs from ever occurring, Java programmers need not spend time trying to find and fix them.

One opportunity created by an omnipresent network is online software distribution. Java takes advantage of this opportunity by enabling the transmission of binary code in small pieces across networks. This capability can make Java programs easier and cheaper to deliver than programs that are not network- mobile. It can also simplify version control. Because the most recent version of a Java program can be delivered on-demand across a network, you needn't worry about what version your end-users are running. They will always get the most recent version each time they use your program.

Mobile code gives rise to another opportunity: mobile objects, the transmission of both code and state across the network. Java realizes the promise of object mobility in its APIs for object serialization and RMI (Remote Method Invocation). Built on top of Java's underlying architecture, object serialization and RMI provide an infrastructure that enables the various components of distributed systems to share objects. The network-mobility of objects makes possible new models for distributed systems programming, effectively bringing the benefits of object-oriented programming to the network.

Platform independence, security, and network-mobility--these three facets of Java's architecture work together to make Java suitable for the emerging networked computing environment. Because Java programs are platform independent, network-mobility of code and objects is more practical. The same code can be sent to all the computers and devices the network interconnects. Objects can be exchanged between various components of a distributed system, which can be running on different kinds of hardware. Java's built-in security framework also helps make network-mobility of software more practical. By reducing risk, the security framework helps to build trust in a new paradigm of network-mobile software.

Tuesday, 20 March 2012

what is 404 Error ??


Introduction

    The Web server (running the Web site) thinks that the HTTP data stream sent by the client (e.g. your Web browser or our CheckUpDown robot) was correct, but simply can not provide the access to the resource specified by your URL. This is equivalent to the 'return to sender - address unknown' response for conventional postal mail services. (Last updated: March 2012).

    This error is easily shown in a Web browser if try a URL with valid domain name but invalid page e.g. http://www.checkupdown.com/InvalidPage.html.

404 errors in the HTTP cycle

    Any client (e.g. your Web browser or our CheckUpDown robot) goes through the following cycle:

        Obtain an IP address from the IP name of the site (the site URL without the leading 'http://'). This lookup (conversion of IP name to IP address) is provided by domain name servers (DNSs).
        Open an IP socket connection to that IP address.
        Write an HTTP data stream through that socket.
        Receive an HTTP data stream back from the Web server in response. This data stream contains status codes whose values are determined by the HTTP protocol. Parse this data stream for status codes and other useful information.

    This error occurs in the final step above when the client receives an HTTP status code that it recognises as '404'.

Fixing 404 errors - general

    For top level URLs (such as www.isp.com), the first possibility is that the request for the site URL has been directed to a Web server that thinks it never had any pages for the Web site. This is possible if DNS entries are fundamentally corrupt, or if the Web server has corrupt internal records. The second possibility is that the Web server once hosted the Web site, but now no longer does so and can not or will not provide a redirection to another computer which now hosts the site. If the site is completely dead - now effectively nowhere to be found on the Internet - then the 404 message makes sense. However if the site has recently moved, then an 404 message may also be triggered. This is also a DNS issue, because the old Web server should no longer be accessed at all - as soon as global DNS entries are updated, only the new Web server should be accessed.

    For low-level URLs (such as www.isp.com/products/list.html), this error can indicate a broken link. You can see this easily by trying the URL in a Web browser. Most browsers give a very clear '404 - Not Found' message.

    Provided that the Web site is still to be found somewhere on the Internet, 404 errors should be rare. For top level URLs, they typically occur only when there is some change to how the site is hosted and accessed, and even these typically disappear within a week or two once the Internet catches up with the changes that have been made. For low-level URLs, the solution is almost always to fix the Web pages so that the broken hypertext link is corrected.

Fixing 404 errors - CheckUpDown

    Persistent 404 errors on your CheckUpDown account indicate a fundamental problem that may not be easy to resolve. If you do see lots of 404 errors, then please contact us (email preferred) so we can help you to sort them out. Unfortunately this may take some time, because we may have to liaise with your ISP and the vendor of the Web server software to agree the exact reason for the error.

Monday, 19 March 2012

Simple Android and Java Bluetooth Application




Last week was my school’s recess week. I had a lot of free time and decided to learn Java and Android Bluetooth by reading the Bluetooth development guide for Android. Then I had an idea to make my Android phone become a simple remote control for my laptop, just for controlling the Power Point slides for presentation. The volume up and volume down become buttons for going to next and previous slide respectively. I write this post to share with you what I have done. I have used Ecipse IDE to write the program.

REMOTE CONTROL SERVER (Java)

Firstly, we need to write the remote control server to receive the signal from Android phone. I used a Java library for Bluetooth called Bluecove to implement the server. You can download the bluecove-2.1.0.jar file and add it to your external library. Note that for Linux, you need to install the bluez-libs to your system and add bluecove-gpl-2.1.0.jar to external library of the project as well
The Android platform includes support for the Bluetooth network stack, which allows a device to wirelessly exchange data with other Bluetooth devices. The application framework provides access to the Bluetooth functionality through the Android Bluetooth APIs. These APIs let applications wirelessly connect to other Bluetooth devices, enabling point-to-point and multipoint wireless features.

Using the Bluetooth APIs, an Android application can perform the following:

    Scan for other Bluetooth devices
    Query the local Bluetooth adapter for paired Bluetooth devices
    Establish RFCOMM channels
    Connect to other devices through service discovery
    Transfer data to and from other devices
    Manage multiple connections
The Basics

This document describes how to use the Android Bluetooth APIs to accomplish the four major tasks necessary to communicate using Bluetooth: setting up Bluetooth, finding devices that are either paired or available in the local area, connecting devices, and transferring data between devices.

All of the Bluetooth APIs are available in the android.bluetooth package. Here's a summary of the classes and interfaces you will need to create Bluetooth connections:

BluetoothAdapter
    Represents the local Bluetooth adapter (Bluetooth radio). The BluetoothAdapter is the entry-point for all Bluetooth interaction. Using this, you can discover other Bluetooth devices, query a list of bonded (paired) devices, instantiate a BluetoothDevice using a known MAC address, and create a BluetoothServerSocket to listen for communications from other devices.
BluetoothDevice
    Represents a remote Bluetooth device. Use this to request a connection with a remote device through a BluetoothSocket or query information about the device such as its name, address, class, and bonding state.
BluetoothSocket
    Represents the interface for a Bluetooth socket (similar to a TCP Socket). This is the connection point that allows an application to exchange data with another Bluetooth device via InputStream and OutputStream.
BluetoothServerSocket
    Represents an open server socket that listens for incoming requests (similar to a TCP ServerSocket). In order to connect two Android devices, one device must open a server socket with this class. When a remote Bluetooth device makes a connection request to the this device, the BluetoothServerSocket will return a connected BluetoothSocket when the connection is accepted.
BluetoothClass
    Describes the general characteristics and capabilities of a Bluetooth device. This is a read-only set of properties that define the device's major and minor device classes and its services. However, this does not reliably describe all Bluetooth profiles and services supported by the device, but is useful as a hint to the device type.
BluetoothProfile
    An interface that represents a Bluetooth profile. A Bluetooth profile is a wireless interface specification for Bluetooth-based communication between devices. An example is the Hands-Free profile. For more discussion of profiles, see Working with Profiles
BluetoothHeadset
    Provides support for Bluetooth headsets to be used with mobile phones. This includes both Bluetooth Headset and Hands-Free (v1.5) profiles.
BluetoothA2dp
    Defines how high quality audio can be streamed from one device to another over a Bluetooth connection. "A2DP" stands for Advanced Audio Distribution Profile.
BluetoothHealth
    Represents a Health Device Profile proxy that controls the Bluetooth service.
BluetoothHealthCallback
    An abstract class that you use to implement BluetoothHealth callbacks. You must extend this class and implement the callback methods to receive updates about changes in the application’s registration state and Bluetooth channel state.
BluetoothHealthAppConfiguration
    Represents an application configuration that the Bluetooth Health third-party application registers to communicate with a remote Bluetooth health device.
BluetoothProfile.ServiceListener
    An interface that notifies BluetoothProfile IPC clients when they have been connected to or disconnected from the service (that is, the internal service that runs a particular profile).

 Code for bluetooh:
private class AcceptThread extends Thread {
    private final BluetoothServerSocket mmServerSocket;

    public AcceptThread() {
        // Use a temporary object that is later assigned to mmServerSocket,
        // because mmServerSocket is final
        BluetoothServerSocket tmp = null;
        try {
            // MY_UUID is the app's UUID string, also used by the client code
            tmp = mBluetoothAdapter.listenUsingRfcommWithServiceRecord(NAME, MY_UUID);
        } catch (IOException e) { }
        mmServerSocket = tmp;
    }

    public void run() {
        BluetoothSocket socket = null;
        // Keep listening until exception occurs or a socket is returned
        while (true) {
            try {
                socket = mmServerSocket.accept();
            } catch (IOException e) {
                break;
            }
            // If a connection was accepted
            if (socket != null) {
                // Do work to manage the connection (in a separate thread)
                manageConnectedSocket(socket);
                mmServerSocket.close();
                break;
            }
        }
    }

    /** Will cancel the listening socket, and cause the thread to finish */
    public void cancel() {
        try {
            mmServerSocket.close();
        } catch (IOException e) { }
    }
}