phone

How to make a call to a phone number in android?

In Android, we can call any phone number by using Intent.ACTION_CALL. To call a phone number we need to access uses permission.

Here is the code that shows you how to call a particular phone number

[sourcecode language="java"]

public class ExampleApp extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
startActivity(new Intent(Intent.ACTION_CALL, Uri.parse("tel:8304600889" )));
}
}

[/sourcecode]

Here the sample phone number is '8304600889'.

Android Edittext Inputtype

Edittext inputtype is used to set your input type for edittext.

Ex:- You can set your edittext inputtype as 'Phone'. So that user can able to type only numbers.

Get the screen size in Android

Android screen size is different for different phone models.

There are some screen resolutions already defined in Android.

They are:

  • QVGA (240×320, low density, small screen)
  • WQVGA (240×400, low density, normal screen)
  • FWQVGA (240×432, low density, normal screen)
  • HVGA (320×480, medium density, normal screen)
  • WVGA800 (480×800, high density, normal screen)
  • WVGA854 (480×854 high density, normal screen)

Now let's see how to get the screen size,

[sourcecode language="java"]
@Override
pub

Syndicate content