brunch

You can make anything
by writing

C.S.Lewis

by 이승현 May 23. 2016

안드로이드 면접 질문 #01

Android interview questions

CareerRide


Android interview questions and answers - freshers, experienced


http://www.careerride.com/android-interview-questions.aspx



Question #01

Explain in brief about the important file and folder when you create new android application.

(안드로이드 어플리케이션을 만들 때 중요한 파일과 폴더에 대해 간략히 설명.)

                              

   

Answer

- src : Contains the .java source files for your project. You write the code for your application in this file. This file is available under the package name for your project.
(.java 소스 파일들을 포함하고 있고 코드를 여기에 작성한다. 이 파일은 프로젝트의 패키지 이름으로 사용할 수 있습니다.)


- gen : This folder contains the R.java file. It is compiler-generated file that references all the resources found in your project. You should not modify this file.
(R.java 소스 파일들을 포함하고 있고 프로젝트에 있는 모든 자원을 참조하는 컴파일러가 생성 한 파일입니다. 이 파일은 수정해서는 안됩니다.)


- Android 4.0 library : This folder contains android.jar file, which contains all the class libraries needed for an Android application.
(이 폴더는 안드로이드 어플리케이션을 위한 모든 클래스 라이브러리를 가진 android.jar 파일이 있습니다.)


- assets : This folder contains all the information about HTML file, text files, databases, etc.
(이 폴더는 모든 HTML, text file, database와 같은 정보들을 가지고 있습니다.)


- bin : It contains the .apk file (Android Package) that is generated by the ADT during the build process. An .apk file is the application binary file. It contains everything needed to run an Android application.
(빌드 과정에서 ADT에 의해 생성된. apk 파일이 있습니다. apk 파일은 어플리케이션 바이너리 파일이고 실행하기 위한 모든 것을 담고 있습니다.)


- res : This folder contains all the resource file that is used by android application. It contains subfolders as: drawable, menu, layout, and values etc.

(drawable, menu, layout 그리고 value 같은 안드로이드 어플리케이션에 쓰이는 모든 resource 파일들을 가지고 있습니다.)


질문이 좀 오래된 거 같네요. 그냥 참고만 하세요.


Question #02

Describe android Activities in brief.

(Activities에 대해 간략히 설명.)

                              

   

Answer

Activity provides the user interface. Mostly, applications have one or more activities and the main purpose of an activity is to interact with the user. Activity goes through a number of stages, known as an activity’s life cycle.


(Activity는 UI를 제공합니다. 대게 어플리케이션은 하나 또는 그 이상의 activity를 가지고 주요 목적은 사용자와 상호작용하기 위함입니다. Activity는 life cycle이라는 여러 상태를 거치게 됩니다.)


Question #03

Describe Intents in detail.

(Intent에 대해 자세히 설명.)

                              

   

Answer

There are two types of Intents.

1) Explicit Intents
2) Implicit Intents

Intents works in pairs: action and data. The action defines what you want to do, such as editing an item, viewing the content of an item etc. The data specifies what is affected, such as a person in the Contacts database. The data is specified as an Uri object.


(Intent는 action과 data 쌍으로 동작합니다. action은 item 수정, 보기와 같은 수행 할 작업을 정의하고 data는 Uri 객체와 처럼 지정됩니다.)


Explicitly starting an Activity (명시적 intent)

Intent intent = new Intent (this, SecondActivity.class);

startActivity(intent);
// Here SecondActivity is the name of the target activity that you want to start.


Implicitly starting an Activity (암시적 intent)

If you want to view a web page with the specified URL then you can use this procedure.

Intent i = new Intent(android.content.Intent.ACTION_VIEW,Uri.parse(“http://www.amazon.com”));

startActivity(i);


if you want to dial a telephone number then you can use this method by passing the telephone number in the data portion

Intent i = new Intent (android.content.Intent.ACTION_DIAL,Uri.parse(“tel:+9923.....”));

startActivity(i);


* 명시적 intent : 호출되는 대상이 명확하게 지정된 경우.

* 암시적 intent : 호출되는 대상이 명확하게 정의되어 있지 않은 경우. (Action, Data, Type, Category, Component, Extras, Flags)


Question #04

What are different data storage options are available in Android?

(안드로이드에서 이용할 수 있는 데이터 저장 옵션들은?)

                              

   

Answer

- SharedPreferences

- Property

- SQlite
- ContentProvider
- File Storage
- Cloud Storage


* 안드로이드에서 제공하는 SharedPreferences와 달리 Property는 Java에서 제공하는 저장 방법이다.


Question #05

Describe SharedPreference storage option.

(SharedPreference 저장 옵션에 대해 설명.)

                              

   

Answer

SharedPreference is the simplest mechanism to store the data in android. You do not worry about creating the file or using files API.It stores the data in XML files. SharedPreference stores the data in key value pair. The SharedPreferences class allows you to save and retrieve key-value pairs of primitive data types. You can use SharedPreferences to save any primitive data: boolean, floats, int, longs, and strings. The data is stored in XML file in the directory data/data//shared-prefs folder.


(SharedPreference는 안드로이드에서 데이터를 저장하는 가장 간단한 mechanism이다. 별도의 file 생성 필요 없이 key와 value 쌍형태의 XML 파일로 데이터를 저장한다. SharedPreferences class는 key-value 쌍을 primitive 데이터 형태(boolean, floats, int , longs and strings)로만 저장하여 쓸 수 있도록 허용한다. 이 XML 파일은 data/data//shared-prefs 폴더 안에 있다.)


Question #06

What are the key components of Android Architecture?

(Android Architecture의 핵심 component는?)

                              

   

Answer

- Linux Kernel
- Libraries : Android Application API를 위한 library.
- Android Framework : Android Application을 위한 API.
- Android Applications


Question #07

What do intent filters do?

(intent filter?)

                              

   

Answer

- There can be more than one intents, depending on the services and activities that are going to use them.

(이용하고자 하는 service와 activity에 따라 하나 이상의 intent들이 있을 수 있음.)


- Each component needs to tell which intents they want to respond to.

(각 component는 응답하려는 intent들을 말할 필요가 있다.)


- Intent filters filter out the intents that these components are willing to respond to.

(Intent filter는 이러한 component에 대응하고자 하는 intent를 필터링할 수 있습니다.)


Question #08

What is AIDL?

(AIDL?)

                              

   

Answer

- AIDL is the abbreviation for Android Interface Definition Language.

(AIDL은 Android Interface Definition Language의 약어입니다.)


- It handles the interface requirements between a client and a service to communicate at the same level through interprocess communication.

(IPC를 통한 동일한 레벨로 통신하는 클라이언트와 서비스 간 인터페이스 요구사항들을 처리한다.)


- The process involves breaking down objects into primitives that are Android understandable.

(이 과정은 객체를 Android understandable 하게 primitive로 분해하여 포함한다.)

(IPC 통신을 위해 Parcel를 이용해 data들을 primitive type으로 주고받는다는 내용인 거 같습니다.)


Question #09

What are the steps that are required in Service Lifecycle?

(Service Lifecycle에서 어떤 단계들이 요구되는가?)

                              

   

Answer

- The service starts with Context.startService() function and the system will retrieve the service using onCreate() method. To start the service it calls on onStartCommand(Intent, int, int) method with proper arguments that are given by the client.

(service는 Context.startService() 함수를 통해 시작되고 시스템에서 onCreate () 메소드를 사용하여 서비스를 검색합니다. service를 시작하기 위해 onStartCommand(Intent, int, int) 메소드를 적절한 arguments들과 함께 호출해야 한다.)


- If the service is running and due to some problem the user doesn't want to run it then it uses Context.stopService() or stopSelf() method to properly implement the service for the user.

(만약 service를 멈추려면 Context.stopService() 또는 stopSelf() 메소드를 실행시켜야 한다.)


- Due to multiple calls of the Context.startService() method the program doesn't do any nesting of the program and shows the stopping of the services.

(Context.startService() 메소드의 복수 호출로 인해 프로그램 중첩을 이나 서비스의 정지를 하지 않습니다.)


- Services can use the command stopSelf(int) method to stop their own service. A service doesn't stop until all the processes are processed.

(Service는 stopSelf(int) 메소드를 이용해 스스로 정지할 수 있다. 모든 프로세스가 처리될 때까지 서비스가 중지되지 않습니다.)


Question #10

What are the different modes of operations used in services for Android?

(안드로이드를 위한 서비스에 사용되는 작업의 다른 모드는 무엇인가?)

                              

   

Answer

- START_STICKY : Service가 강제 종료되었을 경우 시스템이 다시 Service를 재시작시켜 주지만 intent 값을 null로 초기화시켜서 재시작합니다. 

 Service 실행 시 startService(Intent service) 메서드를 호출하는데 onStartCommand(Intent intent, int flags, int startId) 메서드에 intent로 value를 넘겨줄 수 있습니다. 기존에 intent에 value값이 설정이 돼있다고 하더라도 Service 재시작 시 intent 값이 null로 초기화돼서 재시작됩니다. 

START_NOT_STICKY : 이 Flag를 리턴해 주시면, 강제로 종료된 Service가 재시작하지 않습니다. 시스템에 의해 강제 종료되어도 괜찮은 작업을 진행할 때 사용해 주시면 됩니다. 

START_REDELIVER_INTENT : START_STICKY와 마찬가지로 Service가 종료되었을 경우 시스템이 다시 Service를 재시작시켜 주지만 intent 값을 그대로 유지시켜 줍니다. startService() 메서드 호출시 Intent value값을 사용한 경우라면 해당 Flag를 사용해서 리턴 값을 설정해 주면 됩니다.


http://arabiannight.tistory.com/entry/%EC%95%88%EB%93%9C%EB%A1%9C%EC%9D%B4%EB%93%9CAndroid-Service-%EC%82%AC%EC%9A%A9%EB%B2%95



이 사이트는 별로 볼 게 없네요.

매거진의 이전글 안드로이드 개발자 이직 공부 #05
작품 선택
키워드 선택 0 / 3 0
댓글여부
afliean
브런치는 최신 브라우저에 최적화 되어있습니다. IE chrome safari