Android 2.3 3 Tutorial

Posted By admin On 27/11/21
  1. Web Browser For Android 2.3.3
  2. Install Android Market On Coby Kyros MID7012 (or Most Other ...
  3. Android 2.3 3 Tutorial Autocad
  • Android Basics
  • Android - User Interface
  • Android Advanced Concepts
  • Android Useful Examples
  • Android Useful Resources
  • Selected Reading

A simple hello world app using latest Android Studio 2.3 which displays a greeting when the button is clicked. A tutorial for all android beginners explained. Android - Bluetooth - Among many ways, Bluetooth is a way to send or receive data between two different devices. Android platform includes support for the Bluetooth framework that al.

  • The Google Nexus S smartphone is finally here! Nexus S is the first smartphone based on the Gingerbread OS (Android 2.3) and will be available for purchase online and at Best Buy store locations everywhere, come December 16th, with T-Mobile service.
  • Explore Android. For enterprises. User guides and manuals Nokia 2.3. Keep your phone up to date.

Among many ways, Bluetooth is a way to send or receive data between two different devices. Android platform includes support for the Bluetooth framework that allows a device to wirelessly exchange data with other Bluetooth devices.

Android provides Bluetooth API to perform these different operations.

  • Scan for other Bluetooth devices

  • Get a list of paired devices

  • Connect to other devices through service discovery

Android provides BluetoothAdapter class to communicate with Bluetooth. Create an object of this calling by calling the static method getDefaultAdapter(). Its syntax is given below.

In order to enable the Bluetooth of your device, call the intent with the following Bluetooth constant ACTION_REQUEST_ENABLE. Its syntax is.

Apart from this constant, there are other constants provided the API , that supports different tasks. They are listed below.

Sr.NoConstant & description
1

ACTION_REQUEST_DISCOVERABLE

This constant is used for turn on discovering of bluetooth

2

ACTION_STATE_CHANGED

This constant will notify that Bluetooth state has been changed

3

ACTION_FOUND

This constant is used for receiving information about each device that is discovered

Once you enable the Bluetooth , you can get a list of paired devices by calling getBondedDevices() method. It returns a set of bluetooth devices. Its syntax is.

Apart form the parried Devices , there are other methods in the API that gives more control over Blueetooth. They are listed below.

Sr.NoMethod & description
1

enable()

This method enables the adapter if not enabled

2

isEnabled()

This method returns true if adapter is enabled

3

disable()

This method disables the adapter

4

getName()

This method returns the name of the Bluetooth adapter

5

setName(String name)

This method changes the Bluetooth name

6

getState()

This method returns the current state of the Bluetooth Adapter.

7

startDiscovery()

This method starts the discovery process of the Bluetooth for 120 seconds.

2.3.6

Example

This example provides demonstration of BluetoothAdapter class to manipulate Bluetooth and show list of paired devices by the Bluetooth.

Web Browser For Android 2.3.3

To experiment with this example , you need to run this on an actual device.

StepsDescription
1You will use Android studio to create an Android application a package com.example.sairamkrishna.myapplication.
2Modify src/MainActivity.java file to add the code
3Modify layout XML file res/layout/activity_main.xml add any GUI component if required.
4Modify AndroidManifest.xml to add necessary permissions.
5Run the application and choose a running android device and install the application on it and verify the results.

Here is the content of src/MainActivity.java

Here is the content of activity_main.xml

Here abc indicates about logo of tutorialspoint.

Here is the content of Strings.xml

Install Android Market On Coby Kyros MID7012 (or Most Other ...

Here is the content of AndroidManifest.xml

Let's try to run your application. I assume you have connected your actual Android Mobile device with your computer. To run the app from Android studio, open one of your project's activity files and click Run icon from the tool bar.If your Bluetooth will not be turned on then, it will ask your permission to enable the Bluetooth.

Now just select the Get Visible button to turn on your visibility. The following screen would appear asking your permission to turn on discovery for 120 seconds.

Now just select the List Devices option. It will list down the paired devices in the list view. In my case , I have only one paired device. It is shown below.

Android 2.3 3 Tutorial Autocad

Now just select the Turn off button to switch off the Bluetooth. Following message would appear when you switch off the bluetooth indicating the successful switching off of Bluetooth.