Tuesday 10 December 2013

Android interview question

Interview Question for Intermediate level

What is Persistent and Non-Persistent object in android?
Ans:-

       Persistent Objects:- an application appears to continue running, the system may choose to kill its process and restart it later.

For sharing complex persistent user-defined objects, the following approaches are recommended:
·         Application Preferences
·         Files
·         contentProviders
·         SQLite DB
Non-Persistent object:
For sharing complex non-persistent user-defined objects for short duration, the following approaches are recommended:
 
What is portable Wi-Fi hotspot?
Ans:
       The portable Wi-Fi® hotspot feature allows you to share your mobile device’s data connection with other devices by turning your device into a wireless access point. You can connect up to 8 wireless devices via Wi-Fi.
 
What is the difference between a regular bitmap and a nine-patch image?
Ans:
       It is one of a resizable bitmap resource which is being used as backgrounds or other images on the device. The NinePatch class allows drawing a bitmap in nine sections. The four corners are unscaled; the middle of the image is scaled in both axes, the four edges are scaled into one axis.
 
Explain about the exceptions of Android?
Ans.
What is ,dex extension. What is the significance of the .dex files?
Ans.
       Android programs are compiled into .dex (Dalvik Executable) files, which are in turn zipped into a single .apk file on the device. .dex files can be created by automatically translating compiled applications written in the Java programming language
 
What is the difference between Service and Thread?
Ans:
·                   Service is like an Activity but has no interface. Probably if you want to fetch the weather for example you won't create a blank activity for it, for this you will use a Service.
·         A Thread is a Thread, probably you already know it from other part. You need to know that you cannot update UI from a Thread. You need to use a Handler for this, but read further.
·         An AsyncTask is an intelligent Thread that is advised to be used. Intelligent as it can help with it's methods, and there are two methods that run on UI thread, which is good to update UI components
 
What is the importance of XML-based layouts?
Ans:
The use of XML-based layouts provides a consistent and somewhat standard means of setting GUI definition format. In common practice, layout details are placed in XML files while other items are placed in source files.
 
What is the importance of settings permissions in app development in Android?
Ans:
       Permissions allow certain restrictions to be imposed primarily to protect data and code. Without these, codes could be compromised, resulting to defects in functionality.
 
 
What is an URIs? 
Ans:
 
An uniform resource identifier (URI) is a string of characters used to identify a name of a web resource
 A URI reference includes a URI and a fragment, the component of the URI following a '#'. Builds and parses URI references which conform to RFC 2396.
 
Can I write code for Android using C/C++?
Ans:
Yes, using NDKyou can write but it too complex so avoid this.
 
Does Android support the Bluetooth serial port profile?
Ans:
       The most common type of Bluetooth socket is RFCOMM, which is the type supported by the Android APIs. RFCOMM is a connection-oriented, streaming transport over Bluetooth. It is also known as the Serial Port Profile (SPP).
      
How to select more than one option from list in android xml file? 
       Specify android id, layout height and width as depicted in the following example.
 
What is Mono in Android?
Ans:
Mono is a free and open source project led by Xamarin (formerly by Novell and originally by Ximian) to create an Ecma standard-compliant, .NET Framework-compatible set of tools including, among others, a C# compiler and a Common Language Runtime.
 
 
What are the differences between a domain and a workgroup?

Ans:
      
In a domain, one or more computer can be a server to manage the network. On the other hand in a workgroup all computers are peers having no control on each other. In a domain, user doesn’t need an account to logon on a specific computer if an account is available on the domain. In a work group user needs to have an account for every computer. 
In a domain, Computers can be on different local networks. In a work group all computers needs to be a part of the same local network. 
 
Explain IP datagram, Fragmentation and MTU.
Ans:
IP datagram can be used to describe a portion of IP data. Each IP datagram has set of fields arranged in an order. The order is specific which helps to decode and read the stream easily. IP datagram has fields like Version, header length, Type of service, Total length, checksum, flag, protocol, Time to live, Identification, source and destination ip address, padding, options and payload.
MTU:- Maximum Transmission Unit is the size of the largest packet that a communication protocol can pass. The size can be fixed by some standard or decided at the time of connection
Fragmentation is a process of breaking the IP packets into smaller pieces. Fragmentation is needed when the datagram is larger than the MTU. Each fragment becomes a datagram in itself and transmitted independently from source. When received by destination they are reassembled. 
Why Activitylife cycle is must. What are the Different phases of Activity Life cycle. For example: when and how the activity comes to foreground?



The square rectangles represent callback methods you can implement to perform operations when the Activity moves between states. The colored ovals are major states the Activity can be in.

No comments:

Today's Pageviews