1)WhatisAndroid?什么是Android?

Itisanopen-sourcedoperatingsystemthatisusedprimarilyonmobiledevices,suchascellphonesandtablets.ItisaLinuxkernel-basedsystemthat’sbeenequippedwithrichcomponentsthatallowsdeveloperstocreateandrunappsthatcanperformbothbasicandadvancedfunctions.

Android是一个主要用在移动设备(如手机、平板电脑)上的开源操作系统。它基于Linux内核并配备有丰富的组件允许开发者创建和运行拥有基本和高级功能的应用程序。

2)WhatIstheGoogleAndroidSDK?

TheGoogleAndroidSDKisatoolsetthatdevelopersneedinordertowriteappsonAndroidenableddevices.ItcontainsagraphicalinterfacethatemulatesanAndroiddrivenhandheldenvironment,allowingthemtotestanddebugtheircodes.

3)WhatistheAndroidArchitecture?什么是Android架构

AndroidArchitectureismadeupof4keycomponents:
-LinuxKernel
-Libraries
-AndroidFramework
-AndroidApplications

4)DescribetheAndroidFramework.描述Android框架

Android Interview Questions

TheAndroidFrameworkisanimportantaspectoftheAndroidArchitecture.HereyoucanfindalltheclassesandmethodsthatdeveloperswouldneedinordertowriteapplicationsontheAndroidenvironment.

5)WhatisAAPT?什么是AAPT?

AAPTisshortforAndroidAssetPackagingTool.Thistoolprovidesdeveloperswiththeabilitytodealwithzip-compatiblearchives,whichincludescreating,extractingaswellasviewingitscontents.

6)WhatistheimportanceofhavinganemulatorwithintheAndroidenvironment?

Theemulatorletsdevelopers“play”aroundaninterfacethatactsasifitwereanactualmobiledevice.Theycanwriteandtestcodes,andevendebug.Emulatorsareasafeplacefortestingcodesespeciallyifitisintheearlydesignphase.

7)WhatistheuseofanactivityCreator?

AnactivityCreatoristhefirststeptowardsthecreationofanewAndroidproject.ItismadeupofashellscriptthatwillbeusedtocreatenewfilesystemstructurenecessaryforwritingcodeswithintheAndroidIDE.

8)DescribeActivities.

Activitiesarewhatyourefertoasthewindowtoauserinterface.Justasyoucreatewindowsinordertodisplayoutputortoaskforaninputintheformofdialogboxes,activitiesplaythesamerole,thoughitmaynotalwaysbeintheformofauserinterface.

9)WhatareIntents?

IntentsdisplaysnotificationmessagestotheuserfromwithintheAndroidenableddevice.Itcanbeusedtoalerttheuserofaparticularstatethatoccurred.Userscanbemadetorespondtointents.

10)DifferentiateActivitiesfromServices.

Activitiescanbeclosed,orterminatedanytimetheuserwishes.Ontheotherhand,servicesaredesignedtorunbehindthescenes,andcanactindependently.Mostservicesruncontinuously,regardlessofwhethertherearecertainornoactivitiesbeingexecuted.

11)WhatitemsareimportantineveryAndroidproject?

ThesearetheessentialitemsthatarepresenteachtimeanAndroidprojectiscreated:
-AndroidManifest.xml
-build.xml
-bin/
-src/
-res/
-assets/

12)WhatistheimportanceofXML-basedlayouts?

TheuseofXML-basedlayoutsprovidesaconsistentandsomewhatstandardmeansofsettingGUIdefinitionformat.Incommonpractice,layoutdetailsareplacedinXMLfileswhileotheritemsareplacedinsourcefiles.

13)Whatarecontainers?

Containers,asthenameitselfimplies,holdsobjectsandwidgetstogether,dependingonwhichspecificitemsareneededandinwhatparticulararrangementthatiswanted.Containersmayholdlabels,fields,buttons,orevenchildcontainers,asexamples.

14)WhatisOrientation?

Orientation,whichcanbesetusingsetOrientation(),dictatesiftheLinearLayoutisrepresentedasaroworasacolumn.ValuesaresetaseitherHORIZONTALorVERTICAL.

15)WhatistheimportanceofAndroidinthemobilemarket?

DeveloperscanwriteandregisterappsthatwillspecificallyrunundertheAndroidenvironment.ThismeansthateverymobiledevicethatisAndroidenabledwillbeabletosupportandruntheseapps.WiththegrowingpopularityofAndroidmobiledevices,developerscantakeadvantageofthistrendbycreatinganduploadingtheirappsontheAndroidMarketfordistributiontoanyonewhowantstodownloadit.

16)WhatdoyouthinkaresomedisadvantagesofAndroid?

GiventhatAndroidisanopen-sourceplatform,andthefactthatdifferentAndroidoperatingsystemshavebeenreleasedondifferentmobiledevices,there’snoclearcutpolicytohowapplicationscanadaptwithvariousOSversionsandupgrades.OneappthatrunsonthisparticularversionofAndroidOSmayormaynotrunonanotherversion.Anotherdisadvantageisthatsincemobiledevicessuchasphonesandtabscomeindifferentsizesandforms,itposesachallengefordeveloperstocreateappsthatcanadjustcorrectlytotherightscreensizeandothervaryingfeaturesandspecs.

17)Whatisadb?

AdbisshortforAndroidDebugBridge.Itallowsdevelopersthepowertoexecuteremoteshellcommands.Itsbasicfunctionistoallowandcontrolcommunicationtowardsandfromtheemulatorport.

18)Whatarethefouressentialstatesofanactivity?

-Active�Ciftheactivityisattheforeground
-Paused�Ciftheactivityisatthebackgroundandstillvisible
-Stopped�Ciftheactivityisnotvisibleandthereforeishiddenorobscuredbyanotheractivity
-Destroyed�Cwhentheactivityprocessiskilledorcompletedterminated

19)WhatisANR?

ANRisshortforApplicationNotResponding.Thisisactuallyadialogthatappearstotheuserwheneveranapplicationhavebeenunresponsiveforalongperiodoftime.

20)Whichelementscanoccuronlyonceandmustbepresent?

Amongthedifferentelements,theandelementsmustbepresentandcanoccuronlyonce.Therestareoptional,andcanoccurasmanytimesasneeded.

21)Howareescapecharactersusedasattribute?

Escapecharactersareprecededbydoublebackslashes.Forexample,anewlinecharacteriscreatedusing‘\\n’

22)Whatistheimportanceofsettingspermissionsinappdevelopment?

Permissionsallowcertainrestrictionstobeimposedprimarilytoprotectdataandcode.Withoutthese,codescouldbecompromised,resultingtodefectsinfunctionality.

23)Whatisthefunctionofanintentfilter?

Becauseeverycomponentneedstoindicatewhichintentstheycanrespondto,intentfiltersareusedtofilteroutintentsthatthesecomponentsarewillingtoreceive.Oneormoreintentfiltersarepossible,dependingontheservicesandactivitiesthatisgoingtomakeuseofit.

24)Enumeratethethreekeyloopswhenmonitoringanactivity

-Entirelifetime�CactivityhappensbetweenonCreateandonDestroy
-Visiblelifetime�CactivityhappensbetweenonStartandonStop
-Foregroundlifetime�CactivityhappensbetweenonResumeandonPause

25)WhenistheonStop()methodinvoked?

AcalltoonStopmethodhappenswhenanactivityisnolongervisibletotheuser,eitherbecauseanotheractivityhastakenoverorifinfrontofthatactivity.

26)Isthereacasewhereinotherqualifiersinmultipleresourcestakeprecedenceoverlocale?

Yes,thereareactuallyinstanceswhereinsomequalifierscantakeprecedenceoverlocale.Therearetwoknownexceptions,whicharetheMCC(mobilecountrycode)andMNC(mobilenetworkcode)qualifiers.

27)Whatarethedifferentstateswhereinaprocessisbased?

Thereare4possiblestates:
-foregroundactivity
-visibleactivity
-backgroundactivity
-emptyprocess

28)HowcantheANRbeprevented?

OnetechniquethatpreventstheAndroidsystemfromconcludingacodethathasbeenresponsiveforalongperiodoftimeistocreateachildthread.Withinthechildthread,mostoftheactualworkingsofthecodescanbeplaced,sothatthemainthreadrunswithminimalperiodsofunresponsivetimes.

29)WhatroledoesDalvikplayinAndroiddevelopment?

Dalvikservesasavirtualmachine,anditiswhereeveryAndroidapplicationruns.ThroughDalvik,adeviceisabletoexecutemultiplevirtualmachinesefficientlythroughbettermemorymanagement.

30)WhatistheAndroidManifest.xml?

Thisfileisessentialineveryapplication.ItisdeclaredintherootdirectoryandcontainsinformationabouttheapplicationthattheAndroidsystemmustknowbeforethecodescanbeexecuted.

31)WhatistheproperwayofsettingupanAndroid-powereddeviceforappdevelopment?

ThefollowingarestepstobefollowedpriortoactualapplicationdevelopmentinanAndroid-powereddevice:
-Declareyourapplicationas“debuggable”inyourAndroidManifest.
-Turnon“USBDebugging”onyourdevice.
-Setupyoursystemtodetectyourdevice.

32)EnumeratethestepsincreatingaboundedservicethroughAIDL.

1.createthe.aidlfile,whichdefinestheprogramminginterface
2.implementtheinterface,whichinvolvesextendingtheinnerabstractStubclassaswellasimplantingitsmethods.
3.exposetheinterface,whichinvolvesimplementingtheservicetotheclients.

33)WhatistheimportanceofDefaultResources?

Whendefaultresources,whichcontaindefaultstringsandfiles,arenotpresent,anerrorwilloccurandtheappwillnotrun.Resourcesareplacedinspeciallynamedsubdirectoriesundertheprojectres/directory.

34)Whendealingwithmultipleresources,whichonetakesprecedence?

Assumingthatallofthesemultipleresourcesareabletomatchtheconfigurationofadevice,the‘locale’qualifieralmostalwaystakesthehighestprecedenceovertheothers.

35)WhendoesANRoccur?

TheANRdialogisdisplayedtotheuserbasedontwopossibleconditions.Oneiswhenthereisnoresponsetoaninputeventwithin5seconds,andtheotheriswhenabroadcastreceiverisnotdoneexecutingwithin10seconds.

36)WhatisAIDL?

AIDL,orAndroidInterfaceDefinitionLanguage,handlestheinterfacerequirementsbetweenaclientandaservicesobothcancommunicateatthesamelevelthroughinterprocesscommunicationorIPC.ThisprocessinvolvesbreakingdownobjectsintoprimitivesthatAndroidcanunderstand.Thispartisrequiredsimplybecauseaprocesscannotaccessthememoryoftheotherprocess.

37)WhatdatatypesaresupportedbyAIDL?

AIDLhassupportforthefollowingdatatypes:
-string
-charSequence
-List
-Map
-allnativeJavadatatypeslikeint,long,charandBoolean

38)WhatisaFragment?

Afragmentisapartorportionofanactivity.Itismodularinasensethatyoucanmovearoundorcombinewithotherfragmentsinasingleactivity.Fragmentsarealsoreusable.

39)Whatisavisibleactivity?

Avisibleactivityisonethatsitsbehindaforegrounddialog.Itisactuallyvisibletotheuser,butnotnecessarilybeingintheforegrounditself.

40)Whenisthebesttimetokillaforegroundactivity?

Theforegroundactivity,beingthemostimportantamongtheotherstates,isonlykilledorterminatedasalastresort,especiallyifitisalreadyconsumingtoomuchmemory.Whenamemorypagingstatehasbeenreachbyaforegroundactivity,thenitiskilledsothattheuserinterfacecanretainitsresponsivenesstotheuser.

41)Isitpossibletouseoraddafragmentwithoutusingauserinterface?

Yes,itispossibletodothat,suchaswhenyouwanttocreateabackgroundbehaviorforaparticularactivity.Youcandothisbyusingadd(Fragment,string)methodtoaddafragmentfromtheactivity.

42)HowdoyouremoveiconsandwidgetsfromthemainscreenoftheAndroiddevice?

Toremoveaniconorshortcut,pressandholdthaticon.Youthendragitdownwardstothelowerpartofthescreenwherearemovebuttonappears.

43)WhatarethecorecomponentsundertheAndroidapplicationarchitecture?

Thereare5keycomponentsundertheAndroidapplicationarchitecture:
-services
-intent
-resourceexternalization
-notifications
-contentproviders

44)WhatcomposesatypicalAndroidapplicationproject?

AprojectunderAndroiddevelopment,uponcompilation,becomesan.apkfile.ThisapkfileformatisactuallymadeupoftheAndroidManifest.xmlfile,applicationcode,resourcefiles,andotherrelatedfiles.

45)WhatisaStickyIntent?

AStickyIntentisabroadcastfromsendStickyBroadcast()methodsuchthattheintentfloatsaroundevenafterthebroadcast,allowingotherstocollectdatafromit.

46)DoallmobilephonessupportthelatestAndroidoperatingsystem?

SomeAndroid-poweredphoneallowsyoutoupgradetothehigherAndroidoperatingsystemversion.However,notallupgradeswouldallowyoutogetthelatestversion.Itdependslargelyonthecapabilityandspecsofthephone,whetheritcansupportthenewerfeaturesavailableunderthelatestAndroidversion.

47)Whatisportablewi-fihotspot?

PortableWi-FiHotspotallowsyoutoshareyourmobileinternetconnectiontootherwirelessdevice.Forexample,usingyourAndroid-poweredphoneasaWi-FiHotspot,youcanuseyourlaptoptoconnecttotheInternetusingthataccesspoint.

48)Whatisanaction?

InAndroiddevelopment,anactioniswhattheintentsenderwantstodoorexpectedtogetasaresponse.Mostapplicationfunctionalityisbasedontheintendedaction.

49)Whatisthedifferencebetweenaregularbitmapandanine-patchimage?

Ingeneral,aNine-patchimageallowsresizingthatcanbeusedasbackgroundorotherimagesizerequirementsforthetargetdevice.TheNine-patchreferstothewayyoucanresizetheimage:4cornersthatareunscaled,4edgesthatarescaledin1axis,andthemiddleonethatcanbescaledintobothaxes.

50)WhatlanguageissupportedbyAndroidforapplicationdevelopment?

ThemainlanguagesupportedisJavaprogramminglanguage.Javaisthemostpopularlanguageforappdevelopment,whichmakesitidealevenfornewAndroiddeveloperstoquicklylearntocreateanddeployapplicationsintheAndroidenvironment.


Readmoreat http://www.gointerviews.com/top-50-android-interview-questions/#fdzehh3IHOP6pYhQ.99

更多相关文章

  1. 前阿里技术总监手打:452页Android Framework 精编内核解析
  2. Google计划开发开源WebKit内核Android浏览器
  3. 【android内核分析-启动】Android 启动过程详解
  4. Android 内核分析
  5. Android开发者应该深入学习的10个开源应用项目

随机推荐

  1. Android作为Socket服务器端
  2. android控件的对齐方式
  3. 从 Windows 到 Android: 威胁的持续迁移
  4. Android流媒体播放器
  5. android 实战 AppCompat实现Action Bar
  6. Android(安卓)NDK OverView翻译
  7. android TabHost 例子
  8. Android(安卓)training–android studio
  9. Android(安卓)HAL模块实现
  10. 【Android】应用程序启动过程源码分析