Common Issue

Android Gravity Example

Gravity is used to align a view in proper way. It may helps us in UI part very much. Gravity have some option like top, left, center, right, bottom, center-vertical, etc... You can use any option to gravity according to your UI Design.

 

Android Set Image as Wallpaper

Going to see about how to set a image as wallpaper in 2 line of code in android.

Android Ringer Control

Today we are going to see about AudioManager uses. AudioManager provides access to volume and ringer mode control.
Use
[sourcecode language="java"]
Context.getSystemService(Context.AUDIO_SERVICE)
[/sourcecode]
to get an instance of AudioManager Class.
AudioManager have more features. In that we are going to see about setRingerMode(int RingerMode);

setRingerMode() is used to control the ring tone. If you need to stop a incoming call ring tone through your code you can use this method.

Android Portrait & Landscape Differeent Layouts

Today we are going to see about, How to use different layout when screen orientation changes from Portrait to Landscape or Landscape to Portrait.
For example :-
In portrait mode , the option page button will looks like nice when buttons are in one by one position.
But in landscape if we use the same process we need to have scrollview to see all the option button in the page.
To overcome this problem here is a easy solution.
In your res folder create two folders for Landscape 1) drawable-land 2) layout-land
drawable-land folder images is used when the phone orientation in landscape mode.
layout-land folder layout files is used when the phone orientation in landscape mode.

How to handle screen orientation change issue in android?

Androidpeople.com Issue fix for handle screen orientation change and to avoid reloading activity when there is a change in orientation.

Syndicate content