Select chapter



basics (6.papers)
activities (5.papers)
services (2.papers)
threads (2.papers)
receivers (1.papers)
advanced android (2.papers)
SQLite database (1.papers)
adapters (1.papers)
adb and ddms (1.papers)
widgets (1.papers)
fragments (1.papers)
UI (1.papers)
Hide

Sponsored Links


  

android interview questions and answers

1
Is JSON language?
  1. TRUE
  2. FALSE
  3. We can't really call it as a language. It is light weight text-based format used to exchange data between two systems connected in the network. It is an alternative to xml way of transferring data between systems.
  4. None are correct
Show Answer
Share Facebook gmail Twitter
2
What are the JSON elements?
  1. Number, String, Boolean, null, Array, Object.
  2. Number, String, Boolean, Array, Object.
  3. String, Array, Object.
  4. Number, String, null, Array, Object.
Show Answer
Share Facebook gmail Twitter
3
How to communicate the data with an internet server from an android application?
  1. If data is less - use name spaces, if data is heavy use - xml.xml is faster than json. so parsing and loading will be fast.
  2. If data is less - use name spaces, if data is heavy use - json. json is faster than xml. so parsing and loading will be fast.
  3. Option 1 is true, and many web sites and services have more support to xml compared to json.
  4. option 2 is true, and many of the web sites and services including twitter, facebook, google, linkedin uses json than xml.
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
6
To connect to network from android application which of the blow options I have to use?
  1. DefaultHTTPClient
  2. HTTPUrlConnection. it is light weight compared to option 1 and 3. so use this one always.
  3. DefaultHTTPClient or AndroidHttpClient
  4. till before Froyo better to use option DefaultHTTPClient or AndroidHttpClient, but from then on wards better to use HTTPUrlConnection as it has the size advantage over later.
Show Answer
Share Facebook gmail Twitter
7
How to log in to gmail account from android application using HTTP request?
  1. DefaultHttpClient client = new DefaultHttpClient();
        HttpPost post = new HttpPost("http://mail.google.com/");
    
        List<NameValuePair> params = new ArrayList<NameValuePair>(3);
        params.add(new BasicNameValuePair("Email", "username@gmail.com"));
        params.add(new BasicNameValuePair("Passwd", "password here"));
        params.add(new BasicNameValuePair("signIn", "Sign in"));
        post.setEntity(new UrlEncodedFormEntity(params));
        HttpResponse res = client.execute(post);
    
        if(res.getStatusLine().getStatusCode() < 400)
            //success
        else
            //fail
  2. DefaultHttpClient client = new DefaultHttpClient();
        HttpPost post = new HttpPost("http://mail.google.com/");
    
        List<NameValuePair> params = new ArrayList<NameValuePair>(3);
        params.add(new BasicNameValuePair("Email", "username@gmail.com"));
        params.add(new BasicNameValuePair("Passwd", "password here"));
        post.setEntity(new UrlEncodedFormEntity(params));
        HttpResponse res = client.execute(post);
    
        if(res.getStatusLine().getStatusCode() < 400)
            //success
        else
            //fail
  3. DefaultHttpClient client = new DefaultHttpClient();
        HttpPost post = new HttpPost("http://mail.google.com/");
    
        List<NameValuePair> params = new ArrayList<NameValuePair>(3);
        params.add(new BasicNameValuePair("Email", "username@gmail.com"));
        params.add(new BasicNameValuePair("Passwd", "password here"));
        post.setEntity(new UrlEncodedFormEntity(params));
        HttpResponse res = client.execute(post);
    
        if(res.getStatusLine().getStatusCode() >= 400)
            //success
        else
            //fail
  4. DefaultHttpClient client = new DefaultHttpClient();
        HttpPost post = new HttpPost("http://mail.google.com/");
    
        List<NameValuePair> params = new ArrayList<NameValuePair>(3);
        params.add(new BasicNameValuePair("Email", "username@gmail.com"));
        params.add(new BasicNameValuePair("Passwd", "password here"));
        params.add(new BasicNameValuePair("signIn", "Sign in"));
        post.setEntity(new UrlEncodedFormEntity(params));
        HttpResponse res = client.execute(post);
    
        if(res.getStatusLine().getStatusCode() >= 400)
            //success
        else
            //fail
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
9
Which technology suites best to send data across network to a server from an android application?
  1. SOAP is faster than REST to transfer the data.
  2. JSON is faster than XML, XML is faster than SOAP.
  3. JSON is faster than XML, XML is faster than SOAP. But if we want to SOAP in mobiles, we can go with KSOAP designed for embedded devices which is faster.
  4. none of the above.
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
12
How to know the number of elements in a JSONArray?
  1. use length() function
  2. use length variable which will hold no of elements in that array
  3. put infinite loop to read JSONArray, JSON library will automatically detect end of array.
  4. none of the above.
Show Answer
Share Facebook gmail Twitter
13
Which of the below web sites uses JSON technique heavily to send and receive data on over the network.
  1. facebook, google drive, twitter
  2. facebook, google drive, twitter, linkedin
  3. google drive
  4. facebook
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
15
While connecting to Google server from an android application, what are the checked exception that needs to handle in this scenario?
  1. ClientProtocolException, IOException, UnsupportedEncodingException, XmlPullParserException
  2. ClientException, IOException, UnsupportedEncodingException, XmlPullParserException
  3. ClientProtocolException, IOError, UnsupportedEncodingException, XmlPullParserException
  4. ClientProtocolException, IOError, UnsupportedEncodingException
Show Answer
Share Facebook gmail Twitter
Read more papers :