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框架
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–iftheactivityisattheforeground
-Paused–iftheactivityisatthebackgroundandstillvisible
-Stopped–iftheactivityisnotvisibleandthereforeishiddenorobscuredbyanotheractivity
-Destroyed–whentheactivityprocessiskilledorcompletedterminated
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–activityhappensbetweenonCreateandonDestroy
-Visiblelifetime–activityhappensbetweenonStartandonStop
-Foregroundlifetime–activityhappensbetweenonResumeandonPause
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-patchp_w_picpath?
Ingeneral,aNine-patchp_w_picpathallowsresizingthatcanbeusedasbackgroundorotherp_w_picpathsizerequirementsforthetargetdevice.TheNine-patchreferstothewayyoucanresizethep_w_picpath:4cornersthatareunscaled,4edgesthatarescaledin1axis,andthemiddleonethatcanbescaledintobothaxes.
50)WhatlanguageissupportedbyAndroidforapplicationdevelopment?
ThemainlanguagesupportedisJavaprogramminglanguage.Javaisthemostpopularlanguageforappdevelopment,whichmakesitidealevenfornewAndroiddeveloperstoquicklylearntocreateanddeployapplicationsintheAndroidenvironment.
Readmoreat http://www.gointerviews.com/top-50-android-interview-questions/#fdzehh3IHOP6pYhQ.99