Wednesday, September 21, 2011

Basic iPhone Interview Question & Answer

What is iPhone? 
  • IPhone is a combination of internet and multimedia enabled smart phone developed by Apple Inc.
  • iPhone functions as a camera phone, including text messaging, and visual voice mail
  • iPhone is a portable media player that resembles a video iPod
  • It has user interface that is built around the multi-touch screen including virtual keyboard.
  • App Store , which launched in the mid 2008 has over 1,00,000 applications with functionalities including games, references, GPS navigation, advertising, television shows, films, reference, celebrities. 

What are the features of iphone 3gs? 

 

Video: Videos can be edited, shared. High quality VGA video can be shot in portrait or landscape. 
Camera: Still photos with greater quality can be taken.
Voice control: It recognizes the names in contacts and recognizes the music on iPod.
Compass: iPhone 3GS has built-in digital compass, used to point the way.
Internet Tethering: Internet surfing can be done from anywhere. A 3G connection can be shared on Iphon3 with Mac notebook or laptop..

What is iphone OS?  

 

iPhone OS runs on iPhone and iPod touch devices.
Hardware devices are managed by iPhone OS and provides the technologies needed for implementing native applications on the phone.
The OS ships with several system applications such as Mail, Safari, Phone, which provide standard services to the user. 

What is iphone sdk?  

 

iPhone SDK is available with tools and interfaces needed for developing, installing and running custom native applications.
Native applications are built using the iPhone OS’s system frameworks and Objective-C language and run directly on iPhone OS.
Native applications are installed physically on a device and can run in presence or absence of network connection.

What is iphone architecture? 

 

It is similar to MacOS X architecture
It acts as an intermediary between the iPhone and iPod hardware an the appearing applications on the screen
The user created applications never interact directly with the appropriate drivers, which protects the user applications from changes to the hardware.

What is iphone reference library ?  

 

iPhone reference library is a set of reference documents for iPhone OS .
It can be downloaded by subscribing to the iPhone OS Library doc set.
Select Help>Documentation from Xcode, and click the subscribe button next to the iPhone OS Library doc set, which appears in the left column.

What are sensors in iphone ?  

 

The proximity sensor immediately turns off the display when the iPhone is lifted to ear. With this sensor the power is saved and accidental dialing is prevented.
The display is automatically brightens the iPhone by the ambient light sensor when the sunlight or bright rooms and dims in darker places. 

What are the location services ?

 

Applications such as Maps, camera and compass are allowed to use the information from cellular, Wi-Fi and Global Positioning System networks for determining the approximate locations.
The location is displayed on the screen, using a blue marker. 

Describe the functionality of accelerometer of an iphone .

 

iPhone responds to motion using a built-in accelerometer.
The accelerometer detects the movement and changes the display accordingly, at the time of rotating iPhone from portrait to landscape.

Explain about the applications that can be used with iphone  

 

Technology, Entertainment and Design(TED): Allows to watch and listen to world’s most fascinating people have to say, all on the iPhone. 
Market Watch: Breaking news about the investments can be seen. To do so, open the Stocks app and rotate.
Trends: Latest runway shows, videos from Vogue’s fashion library, reviews, exclusive party pictures, fashion news updates can be seen on Style.com. 


Tuesday, September 20, 2011

Basic Android Interview question & answer



What is Android ?
Android is a software stack for mobile devices that includes an operating system, middleware and key applications.

Explain the Architecture of android ?
Top -> Applications (Contacts, Browser, Phone, etc)
Below Applications -> Application Framework(Activity Manager, Window Manager, Content Providers, View System, Package manager,
Telephony manager, Resource, Notification, Location managers)
Below Application Framework -> System Libraries(Like Sqlite, webkit, SSL, OpenGL, Media Framework etc) & Android Runtime( Core Libraries and DVM)
Atlast Last -> Linux Kernel (which composed of drivers like display, camera etc.)

Describe the APK format.
The APK file is compressed the AndroidManifest.xml file, application code (.dex files), resource files, and other files.
A project is compiled into a single .apk file.

What is an action ?
A description of something that an Intent sender desires.

What is an activity ?
A single screen in an application, with supporting Java code.
An activity presents a visual user interface for one focused endeavor the user can undertake.
For example, an activity might present a list of menu items users can choose from or it might display photographs along with their captions.
Each one is implemented as a subclass of the Activity base class.

What is a service ?
A service doesn’t have a visual user interface, but rather runs in the background for an indefinite period of time.
For example, a service might play background music as the user attends to other matters, or it might fetch data over the network or calculate
something and provide the result to activities that need it.
Each service extends the Service base class.

What is a Broadcast receivers ?
A broadcast receiver is a component that does nothing but receive and react to broadcast announcements.
For example, announcements that the timezone has changed, that the battery is low or that the user changed a language preference.
All receivers extend the BroadcastReceiver base class.
Broadcast receivers do not display a user interface. However, they may start an activity in response to the information they receive,
or they may use the NotificationManager to alert the user like(flashing the backlight, vibrating the device, playing a sound)

What is a content provider ?
A content provider makes a specific set of the application’s data available to other applications.The content provider extends the ContentProvider
base class to implement a standard set of methods that enable other applications to retrieve and store data of the type it controls.
However, applications do not call these methods directly. Rather they use a ContentResolver object and call its methods instead.

What is intent ?
A class (Intent) describes what a caller desires to do. The caller sends this intent to Android’s intent resolver, which finds the most suitable activity for the intent.

How is nine-patch image different from a regular bitmap ?
It is a resizable bitmap resource that can be used for backgrounds or other images on the device. The NinePatch class permits drawing a bitmap in nine sections. The four corners are unscaled; the four edges are scaled in one axis, and the middle is scaled in both axes.

What languages does Android support for application development ?
Android applications are written using the Java programming language.

What is a resource ?
A user-supplied XML, bitmap, or other file, injected into the application build process, which can later be loaded from code.

What Virtual Machine Android runs on ?
Dalvik virtual machine

Android Latest Version ?
Android 4.4 KitKat 

 What do containers hold ?
 Containers hold objects and widgets in a specified arrangement.
 They can also hold labels, fields, buttons, or child containers. .


What are the key components of Android Architecture ?
Android Architecture consists of 4 key components:
Linux Kernel
Libraries
Android Framework
Android Applications

What are the advantages of having an emulator within the Android environment?
The emulator allows the developers to work around an interface which acts as if it were an actual mobile device.
They can write, test and debug the code.
They are safe for testing the code in early design phase

Tell us something about activityCreator ?
An activityCreator is the initial step for creation of a new Android project.
It consists of a shell script that is used to create new file system structure required for writing codes in Android IDE.

What do intent filters do ?
There can be more than one intents, depending on the services and activities that are going to use them.
Each component needs to tell which intents they want to respond to.
Intent filters filter out the intents that these components are willing to respond to.

Where are layout details placed? Why ?
Layout details are placed in XML files
XML-based layouts provide a consistent and standard means of setting GUI definition format.

What is Orientation ?
Orientation decides if the LinearLayout should be presented in row wise or column wise fashion.
The values are set using setOrientation()
The values can be HORIZONTAL or VERTICAL

What is it important to set permissions in app development ?
Certain restrictions to protect data and code can be set using permissions.
In absence of these permissions, codes could get compromised causing defects in functionality.

What is AIDL ?
AIDL is the abbreviation for Android Interface Definition Language.
It handles the interface requirements between a client and a service to communicate at the same level through interprocess communication.
The process involves breaking down objects into primitives that are Android understandable.

What data types are supported by AIDL ?
AIDL supports following data types:
-String
-List
-Map
-charSequence and all native Java data types like int,long, char and Boolean

Which dialog boxes are supported by android ?
Android supports 4 dialog boxes:

a.) AlertDialog: Alert dialog box supports 0 to 3 buttons and a list of selectable elements which includes check boxes and radio buttons.

b.) ProgressDialog: This dialog box is an extension of AlertDialog and supports adding buttons. It displays a progress wheel or bar.

c.) DatePickerDialog: The user can select the date using this dialog box.

d.) TimePickerDialog: The user can select the time using this dialog box.
How do you define the user interface ?
XML Format is the best.
Code Snippets:
————————
How to start a browser instance with some url ?
1Intent intent = new Intent(Intent.ACTION_VIEW);
2Uri u = Uri.parse("http://google.com");
3intent.setData(u);
4startActivity(intent);
//Function called when return from a sub activity.
1protected void onActivityResult(int requestCode, int resultCode, String data, Bundle extras) {
2}
//How to retrieve the device IMEI Number
1TelephonyManager mTelephonyMgr = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
2imei = mTelephonyMgr.getDeviceId();
How to call a subactivity ?
1Intent intent = new Intent(this, SubActivity.class);
2//to pass data
3addintent.putExtra(name, value);
4startActivityForResult(intent, int);

Mastering Jetpack Compose: Key Methods for Efficient Android UI Development

Jetpack Compose is a modern toolkit for building native Android UI. It simplifies UI development by providing a declarative approach, making...