Answer: D both option 1 and option 3 are correct
Show Answer and Explanation
Answer: D all of the above
Description: connection, authentication, Cookies management are the functionalities of HTTPClient interface.
Answer: B i & ii
Description: For posting some data like sending an email content we have to use HTTPPost Request. For getting some data from the server we have to use HTTPGet Request.
Answer: A android.permission.INTERNET
Description: android.permission.INTERNET is mandatory for any HTTPRequest, as we are fetching or posting information using internet or by using network connection.
Answer: A It will throw run time exception, i.e IOException
Description: With out internet permission, it will throw UnknownHostException which is part of IOException.
Answer: A It will throw run time exception, i.e IOException
Description: If url is wrong then, it will throw UnknownHostException which is part of IOException.
Answer: B all of the above
Description: httpclient has a function execute(), which can execute httprequests(get/post) and returns response from server.
eg:
HttpGet get = new HttpGet("http://google.com");
HttpClient c = getDefaultHttpClient();
c.execute(get);
HttpClient can also handle
1. Cookies
2. Authentication
3. Connection management to the server
Answer: B option 1 is true & httppost() - use it when we want to post some infromation from mobile to a server mentioned by URL
Description: httpget() - use it when we want to get some information from an URL of a server.
httppost() - use it when we want to post some infromation to a server mentioned by URL from mobile.
eg: Use HttpGet, if you want to get google.com page. Use HttpGet if you want to get all employee details from server.
eg: Use HttpPost, if you want to post some data like posting email to gmail server, or posting a blog to blog server.
Answer: A HttpResponse
Description: on executing a request (httpget/ httppost), httpclient.execute will return httpresponse which will contain httpentity(which is the actual response from the server).
Answer: B org.json
Description:
Answer: A org.apache.http.client
Description:
Answer: A Use XMLResource parser to read the resource file, and parse it.
Description: For pulling data from an XML file which is stored in xml folder or resources, then we have to use XMLResourceParser.
Eg: XmlResourceParser xp = getResources().getXml(R.xml.myfile);
Answer: C XMLPullParser.START_TEXT
Description: Below are the available event types available for an xml pull parser.
1. START_DOCUMENT
2.START_TAG
3.TEXT
4.END_TAG
5. END_DOCUMENT.
Answer: C com.google.android.maps
Description: MapView is not available in default android packages. It is proprietary software of Google which is not included into default android package. If we want to use it then we have to use com.google.android.maps library by selecting Google APIs while creating the project.
Note : MapView is deprecated which is version 1. Latest Android Google maps comes with MapFragment in version 2.
Answer: C along with option 1 , we have to register our application with Google maps service, by providing md5 finger print of the final digital certificate with which application will be signed.
Description: Step 1: Use MapActivity with MapView and use library "com.google.android.maps". App should have internet permission as well. Step 2: we have to register our application with Google maps service, by providing md5 finger print of the final digital certificate with which application will be signed.
Note : MapView is deprecated, and not recommended to use. Use MapFragment in place of it.
Answer: A Result will be sent in the form of HTTPEntity, which is embedded as body in HTTPResponse.
Description: Result from server will be coming as HTTPResponse, which contains HTTPEntity, which contains encoded data embodied in it.
Answer: A AJAX
Description: AJAX technology uses dynamic content refresh for the webpages. Refreshing the whole page is very heavy and tedious technique, which may irritate the user of that web site.
Answer: C 3 json objects, 1 json array. contacts is json array.
Description: Any thing that starts with { is JSONObject and that starts with [ is JSONArray. So here total 3 objects and 1 array is there.
In the above example contacts is json array as it starts with [
Answer: C JSONObject root = new JSONObject(str);
JSONArray arr = root.getJSONArray("contacts");
String ph = arr.getJSONObject(0).getJSONObject("phone").getString("mobile");
Description:
Answer: B JSONObject root = new JSONObject(str);
String name = root.getString("username");
Description: