Android Virtual Devices | Android Developers - Distributed ...

文章推薦指數: 80 %
投票人數:10人

Android Virtual Devices (AVDs) are configurations of emulator options that let you better model an actual device. Each AVD is made up of:. Home Startseite ホーム 主页 首頁 SDK DevGuide Handbuch Guía Guide Guida 開発ガイド 开发人员指南 開發指南 Reference Referenz Referencia Référence Riferimento リファレンス 参考 參考資料 Resources Videos ビデオ Blog ブログ 博客 網誌 Android.com   AndroidBasics EinführunginAndroid InformaciónbásicasobreAndroid Présentationd'Android NozionidibasesuAndroid Androidの基本 Android基础知识 Android簡介 WhatIsAndroid? WasistAndroid? ¿QuéesAndroid? Qu'est-cequ'Android ? Checos'èAndroid? Androidとは Android是什么? 什麼是Android? FrameworkTopics Framework-Themen Temassobreelframework Thèmesrelatifsauframework Argomentirelativialframework フレームワークトピック 框架主题 架構主題 ApplicationFundamentals Anwendungsgrundlagen Fundamentosdelasaplicaciones Principesdebasedesapplications Concettifondamentalisulleapplicazioni 開発の基礎 应用程序基础 應用程式基本原理 UserInterface DeclaringLayout CreatingMenus CreatingDialogs HandlingUIEvents NotifyingtheUser CreatingToastNotifications CreatingStatusBarNotifications ApplyingStylesandThemes BuildingCustomComponents BindingtoDatawithAdapterView CommonLayoutObjects HowAndroidDrawsViews ApplicationResources ProvidingResources AccessingResources HandlingRuntimeChanges Localization ResourceTypes Animation ColorStateList Drawable Layout Menu String Style MoreTypes IntentsandIntentFilters DataStorage DataBackup ContentProviders SecurityandPermissions TheAndroidManifest.xmlFile Graphics 2DGraphics 3DwithOpenGL AudioandVideo LocationandMaps ObtainingUserLocation AppWidgets Bluetooth NearFieldCommunication new! SessionInitiationProtocol new! Search UsingtheAndroidSearchDialog AddingRecentQuerySuggestions AddingCustomSuggestions SearchableConfiguration DeviceAdministration Testing TestingFundamentals new! ActivityTesting new! ContentProviderTesting new! ServiceTesting new! WhatToTest new! AndroidMarketTopics ApplicationLicensing In-appBilling new! AboutthisRelease In-appBillingOverview ImplementingIn-appBilling SecurityandDesign TestingIn-appBilling AdministeringIn-appBilling In-appBillingReference MarketFilters Developing Entwicklung Desarrollo Développement Sviluppo 開発 开发 開發 InEclipse,withADT InEclipse,mitADT EnEclipse,conADT SousEclipse,àl'aidedupluginADT InEclipse,conADT Eclipse内でADTを使用 利用ADT在Eclipse中开发 在加裝ADT工具的Eclipse環境中 InOtherIDEs InanderenIDEs Enotrosentornos Sousd'autresenvironnements InaltriIDE その他の統合開発環境 在其他IDE中开发 在其他開發環境中 OnaDevice DebuggingTasks Testing TestinginEclipse,withADT TestinginOtherIDEs Tools aapt adb android aidl AVDs bmgr ddms dx Draw9-Patch Emulator HierarchyViewer layoutopt mksdcard Monkey monkeyrunner new! MonkeyDevice new! MonkeyImage new! MonkeyRunner new! ProGuardnew! sqlite3 Traceview zipalign Publishing Veröffentlichung Publicación Publication Pubblicazione 公開 发布 發佈 SigningYourApplications SignierenIhrerAnwendungen Firmadeaplicaciones Attributiondevotresignatureàvosapplications Firmadelleapplicazioni アプリケーションへの署名 应用程序签名 簽署應用程式 VersioningYourApplications VersionsverwaltungfürIhreAnwendungen Versionesdelasaplicaciones Attributiond'uneversionàvosapplications Controlloversionidelleapplicazioni アプリケーションのバージョニング 应用程序版本控制 應用程式版本設定 PreparingtoPublish VorbereitungaufdieVeröffentlichung Publicacióndeaplicaciones Préparationàlapublication Preparativiperlapubblicazione 公開の準備 准备发布 準備發佈 PublishingYourApplications BestPractices BewährteVerfahren Prácticasrecomendadas Meilleurespratiques Bestpractice ベストプラクティス 最佳实践 最佳實務 Compatibility SupportingMultipleScreens UIGuidelines IconDesign LauncherIcons MenuIcons StatusBarIcons TabIcons DialogIcons ListViewIcons AppWidgetDesign ActivityandTaskDesign MenuDesign DesigningforPerformance DesigningforResponsiveness DesigningforSeamlessness WebApplications WebAppsOverview new! TargetingScreensfromWebApps new! BuildingWebAppsinWebView new! DebuggingWebApps new! BestPracticesforWebApps new! Appendix Anhang Apéndice Annexes Appendice 付録 附录 附錄 AndroidAPILevels AppInstallLocation SupportedMediaFormats IntentsList:GoogleApps Glossary   AndroidVirtualDevices AVDquickview YouneedtocreateanAVDtorunanyappintheAndroidemulator EachAVDisacompletelyindependentvirtualdevice,withitsown hardwareoptions,systemimage,anddatastorage. YoucreateAVDconfigurationstomodeldifferentdeviceenvironments intheAndroidemulator. YoucanlaunchagraphicalAndroidAVDManagereitherthroughEclipseor throughtheandroidtool.Theandroidtoolalsooffers acommand-lineinterfaceforcreatingandmanagingAVDs. Inthisdocument CreatinganAVD Settinghardwareemulationoptions DefaultlocationoftheAVDfiles ManagingAVDs MovinganAVD UpdatinganAVD DeletinganAVD Command-lineoptions SeeAlso Android Emulator AndroidVirtualDevices(AVDs)areconfigurationsofemulatoroptionsthatlet youbettermodelanactualdevice. EachAVDismadeupof: Ahardwareprofile.  Youcansetoptionstodefinethehardware featuresofthevirtualdevice.Forexample,youcandefinewhetherthedevice hasacamera,whetheritusesaphysicalQWERTYkeyboardoradialingpad,how muchmemoryithas,andsoon. Amappingtoasystemimage.  Youcandefinewhatversionofthe Androidplatformwillrunonthevirtualdevice.Youcanchooseaversionofthe standardAndroidplatformorthesystemimagepackagedwithanSDKadd-on. Otheroptions.  Youcanspecifytheemulatorskinyouwanttouse withtheAVD,whichletsyoucontrolthescreendimensions,appearance,andso on.YoucanalsospecifytheemulatedSDcardtousewiththeAVD. Adedicatedstorageareaonyourdevelopmentmachine,inwhichisstoredthe device'suserdata(installedapplications,settings,andsoon)andemulatedSD card. YoucancreateasmanyAVDsasyouneed,basedonthetypesofdevicesyou wanttomodelandtheAndroidplatformsandexternallibrariesyouwanttorun yourapplicationon. InadditiontotheoptionsinanAVDconfiguration,youcanalso specifyemulatorcommand-lineoptionsatlaunchorbyusingtheemulator consoletochangebehaviorsorcharacteristicsatruntime.Foracomplete referenceofemulatoroptions,pleaseseetheEmulator documentation. TheeasiestwaytocreateanAVDistousethegraphicalAVDManager,which youcanlaunchfromEclipseorfromthecommandlineusingthe androidtool.Theandroidtoolisprovidedinthe tools/directoryoftheAndroidSDK.Whenyourunthe androidtoolwithoutoptions,itlaunchesthegraphicalAVD Manager. FormoreinformationabouthowtoworkwithAVDsfrominsideyourdevelopment environment,seeDevelopinginEclipsewith ADTorDevelopingin OtherIDEs,asappropriateforyourenvironment. CreatinganAVD TheAndroidSDKdoesnotincludeanypreconfiguredAVDs,so youneedtocreateanAVDbeforeyoucanrunanyapplicationintheemulator (eventheHelloWorldapplication). TheeasiestwaytocreateanAVDistousethegraphicalAVDManager,butthe androidtoolalsooffersacommandlineoption. TocreateanAVD: InEclipse,chooseWindow>AndroidSDKandAVDManager. Alternatively,youcanlaunchthegraphicalAVDManagerbyrunningthe androidtoolwithnooptions. SelectVirtualDevicesintheleftpanel. ClickNew. TheCreateNewAVDdialogappears. TypethenameoftheAVD,suchas"my_avd". Chooseatarget. Thetargetisthesystemimagethatyouwanttorunontheemulator, fromthesetofplatformsthatareinstalledinyourSDKenvironment.Youcan chooseaversionofthestandardAndroidplatformoranSDKadd-on.Formore informationabouthowtoaddplatformstoyourSDK,seeAddingSDKComponents. Optionallyspecifyanyadditionalsettings: SDCardThepathtotheSDcardimagetousewiththis AVD,orthesizeofanewSDcardimagetocreateforthisAVD. Skin TheskintouseforthisAVD,identifiedbynameordimensions. Hardware Thehardwareemulationoptionsforthedevice.Foralistoftheoptions,see Settinghardwareemulationoptions. ClickCreateAVD. Settinghardwareemulationoptions WhenyoucreateanewAVDthatusesastandardAndroidsystemimage("Type: platform"),theAVDManager letsyousethardwareemulation optionsforyourvirtualdevice. Thetablebelowliststheoptionsavailableandthe defaultvalues,aswellasthenamesofpropertiesthatstoretheemulated hardwareoptionsintheAVD'sconfigurationfile(theconfig.inifileinthe AVD'slocaldirectory). Characteristic Description Property Deviceramsize TheamountofphysicalRAMonthedevice,inmegabytes.Defaultvalueis"96". hw.ramSize Touch-screensupport Whetherthereisatouchscreenornotonthedevice.Defaultvalueis"yes". hw.touchScreen Trackballsupport Whetherthereisatrackballonthedevice.Defaultvalueis"yes". hw.trackBall Keyboardsupport WhetherthedevicehasaQWERTYkeyboard.Defaultvalueis"yes". hw.keyboard DPadsupport WhetherthedevicehasDPadkeys.Defaultvalueis"yes". hw.dPad GSMmodemsupport WhetherthereisaGSMmodeminthedevice.Defaultvalueis"yes". hw.gsmModem Camerasupport Whetherthedevicehasacamera.Defaultvalueis"no". hw.camera Maximumhorizontalcamerapixels Defaultvalueis"640". hw.camera.maxHorizontalPixels Maximumverticalcamerapixels Defaultvalueis"480". hw.camera.maxVerticalPixels GPSsupport WhetherthereisaGPSinthedevice.Defaultvalueis"yes". hw.gps Batterysupport Whetherthedevicecanrunonabattery.Defaultvalueis"yes". hw.battery Accelerometer Whetherthereisanaccelerometerinthedevice.Defaultvalueis"yes". hw.accelerometer Audiorecordingsupport Whetherthedevicecanrecordaudio.Defaultvalueis"yes". hw.audioInput Audioplaybacksupport Whetherthedevicecanplayaudio.Defaultvalueis"yes". hw.audioOutput SDCardsupport Whetherthedevicesupportsinsertion/removalofvirtualSDCards.Defaultvalueis"yes". hw.sdCard Cachepartitionsupport Whetherweusea/cachepartitiononthedevice.Defaultvalueis"yes". disk.cachePartition Cachepartitionsize Defaultvalueis"66MB". disk.cachePartition.size AbstractedLCDdensity SetsthegeneralizeddensitycharacteristicusedbytheAVD'sscreen.Most skinscomewithavalue(whichyoucanmodify),butifaskindoesn'tprovide itsownvalue,thedefaultis160. hw.lcd.density MaxVMapplicationheapsize ThemaximumheapsizeaDalvikapplicationmightallocatebeforebeing killedbythesystem.Valueisinmegabytes.Mostskinscomewithavalue(which youcanmodify),butifaskindoesn'tprovideitsownvalue,thedefaultis 16. vm.heapSize DefaultlocationoftheAVDfiles WhenyoucreateanAVD,theAVDManagercreatesadedicateddirectoryforit onyourdevelopmentcomputer.ThedirectorycontainstheAVDconfigurationfile, theuserdataimageandSDcardimage(ifavailable),andanyotherfiles associatedwiththedevice.Notethatthedirectorydoesnotcontainasystem image—instead,theAVDconfigurationfilecontainsamappingtothe systemimage,whichitloadswhentheAVDislaunched. TheAVDManageralsocreatesa.inifileforthe AVDattherootofthe.android/avddirectoryonyourcomputer.Thefile specifiesthelocationoftheAVDdirectoryandalwaysremainsattherootthe .androiddirectory. Bydefault,theAVDManagercreatestheAVDdirectoryinside ~/.android/avd/(onLinux/Mac),C:\Documentsand Settings\\.android\onWindowsXP,and C:\Users\\.android\onWindowsVista. IfyouwanttouseacustomlocationfortheAVDdirectory,you candosobyusingthe-poptionwhen youcreatetheAVD(commandlinetoolonly): androidcreateavd-nmy_android1.5-t2-ppath/to/my/avd Ifthe.androiddirectoryishostedonanetworkdrive,werecommendusing the-poptiontoplacetheAVDdirectoryinanotherlocation. TheAVD's.inifileremainsinthe.androiddirectoryonthenetwork drive,regardlessofthelocationoftheAVDdirectory. ManagingAVDs ThesectionsbelowprovidemoreinformationabouthowtomanageAVDsonceyou'vecreatedthem. MovinganAVD IfyouwanttomoveorrenameanAVD,youcandosousingthiscommand: androidmoveavd-n[-



請為這篇文章評分?