Android Developers

Android Interview questions for beginners

       What is android?

Android is an operating system which is developed to run on mobile phones. Android have different versions to support different features. The main programming language that is used to develop applications in Android is Java. Android also supports applications that is developed in other programming languages.


Installing Android Studio in Windows.

Android studio is used to develop applications in android. It is an open source tool available to download from developer’s site.

You can download Android studio for windows from below link.


     Eclipse vs Android Studio

Working with eclipse can be difficult at times, probably when debugging and designing layouts Eclipse sometimes get stuck and we have to restart eclipse from time to time. Also you get problems with emulators.

Android studio was releases very recently and this IDE is not yet heavily used by developers. Therefor it may contain certain bugs.

      Storage media in Android?

Storage may vary based on what kind of data to be stored. Storage can be like Internal Storage and External Storage.

Internal Storage also known as internal memory which can be available in-built.
External Storage is the SD Card.

SQLite is one of the option available in Android as storing the data of application into database. Most of the developers choose SQLite as database.

       What is an activity?

Activities are one of the fundamental building blocks of apps on the Android platform. They serve as the entry point for a user's interaction with an app, and are also central to how a user navigates within an app (as with the Back button) or between apps (as with the recent button).

     What is a fragment?

A fragment represents a behavior or a portion of user interface in an Activity. You can combine multiple fragments in a single activity to build a multi-pane UI and reuse a fragment in multiple activities.

Android activity life cycle?

Android Activity Lifecycle is controlled by 7 methods of android.app.Activity class. The android Activity is the subclass of ContextThemeWrapper class. The Activity class provides a number of callbacks that allow the activity to know that a state has changed: that the system is creating, stopping, or resuming an activity, or destroying the process in which the activity resides.

For Example,

§  Crashing if the user receives a phone call or switches to another app while using your app.
§  Consuming valuable system resources when the user is not actively using it.
§  Losing the user's progress if they leave your app and return to it at a later time.
§  Crashing or losing the user's progress when the screen rotates between landscape and portrait orientation.
Android Activity Life Cycle Methods:
1.    onCreate
2.    onStart
3.    onResume
4.    onPause
5.    onStop
6.    onRestart
7.    onDestroy

Activity Life Cycle




     Android app Architecture?

Activities are one of the fundamental building blocks of apps on the Android platform. They serve as the entry point for a user's interaction with an app, and are also central to how a user navigates within an app (as with the Back button) or between apps (as with the Recent button).

For Example,

§  Orientation changes take place smoothly without disrupting the user experience.
§  User data is not lost during activity transitions.
§  The system kills processes when it's appropriate to do so.
Application Architecture


 What is a Service?

A Service is an application component that can perform long-running operations in the background, and it does not provide a user interface. Another application component can start a service, and it continues to run in the background even if the user switches to another application. Additionally, a component can bind to a service to interact with it and even perform inter-process communication (IPC). For example, a service can handle network transactions, play music, perform file I/O, or interact with a content provider, all from the background.

These are the three different types of services:

§  Scheduled
§  Started
§  Bound

Android Services


     What is manifest?

Every application must have an AndroidManifest.xml file (with precisely that name) in its root directory. The manifest file provides essential information about your app to the Android system, which the system must have before it can run any of the app's code.

     What is an Intent?

     An Intent is a messaging object you can use to request an action from another app component. Although intents facilitate communication between components in several ways, there are three fundamental use cases:
§  Starting an activity
§  Starting a service
§  Delivering a broadcast

Intent Types:

§  Explicit intents specify the component to start by name (the fully-qualified class name). You'll typically use an explicit intent to start a component in your own app, because you know the class name of the activity or service you want to start. For example, you can start a new activity in response to a user action or start a service to download a file in the background.

§  Implicit intents do not name a specific component, but instead declare a general action to perform, which allows a component from another app to handle it. For example, if you want to show the user a location on a map, you can use an implicit intent to request that another capable app show a specified location on a map.


     Android Architecture?
     
     Android architecture or Android software stack is categorized into five parts:
1.    Linux kernel
2.    native libraries (middleware)
3.    Android Runtime
4.    Application Framework
5.    Applications
Android Platform Architecture


What is DDMS?

Android Studio includes a debugging tool called the Dalvik Debug Monitor Server (DDMS), which provides port-forwarding services, screen capture on the device, thread and heap information on the device, logcat, process, and radio state information, incoming call and SMS spoofing, location data spoofing, and more. This page provides a modest discussion of DDMS features; it is not an exhaustive exploration of all the features and capabilities.

To view heap usage for a process:
1.    In the Devices tab, select the process that you want to see the heap information for.

2.    Click the Update Heap button to enable heap information for the process.


3.    In the Heap tab, click Cause GC to invoke garbage collection, which enables the collection of heap data. When the operation completes, you will see a group of object types and the memory that has been allocated for each type. You can click Cause GC again to refresh the data.

4.    Click on an object type in the list to see a bar graph that shows the number of objects allocated for a particular memory size in bytes.



What is Gradle?

Gradle is a build system. Android studio uses gradle, an advanced build toolkit, to automate and manage the build process, while allowing you to define flexible custom build configurations. Each build configuration can define its own set of code and resources, while reusing the parts common to all versions of your app. The Android plugin for Gradle works with the build toolkit to provide processes and configurable settings that are specific to building and testing Android applications.




Comments