New Android Interview Questions and Answers for beginners

How to do write intent to send email in android?

 

Intent email= new Intent(Intent.ACTION_SEND);Email.setType(“message/Meraj 786”);
Email.putExtra(Intent.EXTRA_EMAIL, new String[] {“merajansari15@gmail.com”});
Email.putEXTRA(Intent.EXTRA_SUBJECT, “Hi, I am Meraj Ansari this is my mail”);
startActivity(Intent.createChooser(email, “Choose an Email Client”));

How many functionalities of HTTPClient interface in android? 

The functionalities of HTTPClient interface are:

  • Connection management
  • Authentication management
  • Cookies management

To use HTTPClient, which permission is required in an android application?

The android.permission.INTERNET is most important for any HTTPRequest, as we are fetching or posting information using the internet or by using network connection.

What is the use of httpclient class in android?

Httpclient has a function execute (), which can be used httprequests such as get, post and returns response from server.

For example,

HttpGet get = new HttpGet(<a href="http://www.j2eebrain.com">http://www.j2eebrain.com</a>);HttpClient c = getDefaultHttpClient();
c.execute(get);

The HttpClient can also handle are:

  • Authentication
  • Connection management to the server
  • Cookies

How to read data and information from an xml folder of resources in android application?

For pulling data from an XML file which is stored in xml folder or resources, then we have to use XMLResourceParser.

For example,

XmlResourceParser xp = getResource().getXml(R.xml.myfolder);

A MapView is not present in default android packages. It is involved software of Google, which is not included in the default android package. If we need to use it then we have to using com.goolge.android.map library by choosing Google APIs (Application Program Interface) for creating the project.In which library MapView class is located?

How to result will be sent from a web server to the phone, for an HTTP Request sent from an Android application to the web server?

The result will be sent in the form of HTTPEntity which is inbuilt as body in HTTPResponse.

How to get current location in android?

Get the current location in android use the LocationManager class and also use LocationListener class. Use requestLocationUpdates to register locationlistener with locationmanger object.

How many screen sizes supported by android?

Generally android groups all actual screen sizes into four categorized sizes such as small, normal, large, and extra large.

What do you mean by the dx tool in android?

The DVM (Dalvik Virtual Machine) understands the only Dex format and not class format. All android apps run in DVM so, we have converted all class files into dalvik recognizable format (android byte code).