Tuesday, 9 December 2014

Using the Media API's.

Android supports playing audio and video under the android.media package.

At the heart of the android.media package is the android.media.MediaPlayer class.
The MediaPlayer class is responsible for playing both audio and video content.The content for
this class can come from the following sources:

* Web: You can play content from the web via a URL.

* .apk file: You can play content that is packaged as part of your .apk file. You can package the media
content as a resource or as an asset ( with the assets folder ).

* SD card: You can play content that resides on the device's SD card.

The MediaPlayer is capable of decoding quite a few different content formats,including 3rd Generation
Partnership Project(3GPP, .3gp),MP3(.mp3),MIDI(.mid and others),Ogg Vorbis(.ogg),PCM/WAVE
(.wav), and MPEG-4(.mp4),RTSP,HTTP/HTTPS live streaming, and M3U playlists are also supported,

For a complete list of supported media formats,go to

http://developer.android.com/guide/appendix/media-formats.html


Proximity Sensors in Android .

* The Proximity Sensors either measures the distance that some object is from the device ( in

centimeters ) or represents a flag to say whether an object is close or far.

* The Proximity sensor is sometimes the same hardware as the light sensor.

* The Proximity is often used in the phone application to detect the presence of a person's head

next to the device.If the head is that close to the touchscreen,the touchscreen is disabled so no

keys will be accidently pressed by the ear or cheek while the person is talking on the phone.


Sunday, 7 December 2014

Light Sensors in Android .

The Light Sensor is one of the simplest sensors on a device. This sensor gives a reading of the

light level detected by the light sensor of the device. As the light level changes,the sensors

readings change. The units of the data are in SI lux units.

For the values array in the SensorEvent object, a light sensor uses just the first element values[0].

This value is a float and ranges technically from 0 to the maximum value for the particular sensor.

We say technically because the sensor may only send very small values when there's no light,and

never actually send a value of 0.

For Example:

SensorManager has a constant called LIGHT_SUNLIGHT_MAX, which is float value of 120,000.

Friday, 5 December 2014

Interpreting Sensor Data.

We Understand how to get data from a sensor,we must do something meaningful with the data.

The data we get, however , will depend on which sensor we're getting the data from. Some

sensors are simpler than others. As new devices come into being,new sensors will undoubtedly

be introduced as well.the sensors framework is very likely to remain the same.


Thursday, 4 December 2014

What can we know about a Sensor ?

While using the uses-feature tags in the manifest file lets you know that a Sensor your

application requires exists on a device,it doesn't tell you everything you may want to

know about the actual sensor.


Detecting Sensor:

If your application needs a Proximity Sensor,you specify that in your manifest file

Ex:

<uses-feature android:name="android.hardware.sensor.proximity" />

Wednesday, 3 December 2014

What is a Sensor in Android ?

A Sensor is a piece of Hardware that has been wired into device to feed data from the physical

world to applications. Applications use the sensor data to inform the user about the physical world,

to control game play,to do augmented reality,or to provide useful tools for working in the real world.

Some of the Sensor types that can appear in an Android device :

- Light Sensor.
- Proximity Sensor.
- Temperature Sensor
- Pressure Sensor
- Gyroscope Sensor
- Accelerometer
- Magnetic Field Sensor
- Orientation Sensor
- Gravity Sensor
- Linear Acceleration Sensor
- Rotation Vector Sensor
- Relative Humidity Sensor
- Near Field Communication ( NFC ) Sensor.

Monday, 1 December 2014

ViewGroups in Android .

ViewGroups are Views that contain child Views.

Each ViewGroup class embodies a different set of assumptions about how to display its child views.

All ViewGroup descend from the android.view.ViewGroup class.

Subset of ViewGroups are:

- Gallery and GridView.
- ListView and ListActivity.
- ScrollView
- TabHost
etc.