Android studio overview

506 1.5K 1
Android studio overview

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Giới thiệu về Android Studio, các chức năng, công cụ, cách vận hành, debug, run...Khởi tạo project với Android Studio, với các example cơ bản.Chú thích các lệnh, phím tắt khi dùng Android StudioCó đường link để tham khảo thêm,...,

Android Studio Overview In this document Project and File Structure Android Build System Debug and Performance Installation, Setup, and Update Management Other Highlights See also IntelliJ FAQ on migrating to IntelliJ IDEA Android Studio is the official IDE for Android application development, based on IntelliJ IDEA On top of the capabilities you expect from IntelliJ, Android Studio offers:  Flexible Gradle-based build system  Build variants and multiple apk file generation  Code templates to help you build common app features  Rich layout editor with support for drag and drop theme editing  Lint tools to catch performance, usability, version compatibility, and other problems  ProGuard and app-signing capabilities  Built-in support for Google Cloud Platform, making it easy to integrate Google Cloud Messaging and App Engine  And much more Download Android Studio now If you're new to Android Studio or the IntelliJ IDEA interface, this page provides an introduction to some key Android Studio features For specific Android Studio how-to documentation, see the pages in the Workflow section, such as Managing Projects from Android Studio and Building and Running from Android Studio Project and File Structure Android Project View By default, Android Studio displays your profile files in the Android project view This view shows a flattened version of your project's structure that provides quick access to the key source files of Android projects and helps you work with the new Gradle-based build system The Android project view:  Groups the build files for all modules at the top level of the project hierarchy  Shows the most important source directories at the top level of the module hierarchy  Groups all the manifest files for each module  Shows resource files from all Gradle source sets  Groups resource files for different locales, orientations, and screen types in a single group per resource type Figure Show the Android project view Figure Project Build Files The Android project view shows all the build files at the top level of the project hierarchy under Gradle Scripts Each project module appears as a folder at the top level of the project hierarchy and contains these three elements at the top level:  java/  manifests/  res/ - Source files for the module - Manifest files for the module - Resource files for the module For example, Android project view groups all the instances of the ic_launcher.png resource for different screen densities under the same element Note: The project structure on disk differs from this flattened representation To switch to back the segregated project view, select Project from the Project New Project and Directory Structure When you use the Project view of a new project in Android Studio, you should notice that the project structure appears different than you may be used to in Eclipse Each instance of Android Studio contains a project with one or more application modules Each application module folder contains the complete source sets for that module, including src/main and src/androidTest directories, resources, build file and the Android manifest For the most part, you will need to modify the files under each module's src/main directory for source code updates, the gradle.build file for build specification and the files under src/androidTest directory for test case creation Figure Android Studio project structure For more information, see IntelliJ project organization and Managing Projects Creating new files You can quickly add new code and resource files by clicking the appropriate directory in the Project pane and pressing ALT + INSERT on Windows and Linux or COMMAND + N on Mac Based on the type of directory selected, Android Studio offers to create the appropriate file type For example, if you select a layout directory, press ALT + INSERT on Windows, and select Layout resource file, a dialog opens so you can name the file (you can exclude the xml suffix) and choose a root view element The editor then switches to the layout design editor so you can begin designing your layout Android Build System Android Build System The Android build system is the toolkit you use to build, test, run and package your apps This build system replaces the Ant system used with Eclipse ADT It can run as an integrated tool from the Android Studio menu and independently from the command line You can use the features of the build system to:  Customize, configure, and extend the build process  Create multiple APKs for your app with different features using the same project and modules  Reuse code and resources across source sets The flexibility of the Android build system enables you to achieve all of this without modifying your app's core source files To build an Android Studio project, see Building and Running from Android Studio To configure custom build settings in an Android Studio project, see Configuring Gradle Builds Application ID for Package Identification With the Android build system, the applicationId attribute is used to uniquely identify application packages for publishing The application ID is set in the android section of the build.gradle file apply plugin: 'com.android.application' android { compileSdkVersion 19 buildToolsVersion "19.1" defaultConfig { applicationId "com.example.my.app" minSdkVersion 15 targetSdkVersion 19 versionCode versionName "1.0" } Note: The applicationId is specified only in your build.gradle file, and not in the AndroidManifest.xml file When using build variants, the build system enables you to to uniquely identify different packages for each product flavors and build types The application ID in the build type is added as a suffix to those specified for the product flavors productFlavors { pro { applicationId = "com.example.my.pkg.pro" } free { applicationId = "com.example.my.pkg.free" } } buildTypes { debug { applicationIdSuffix ".debug" } } The package name must still be specified in the manifest file It is used in your source code to refer to your R class and to resolve any relative activity/service registrations package="com.example.app"> Note: If you have multiple manifests (for exmample, a product flavor specific manifest and a build type manifest), the package name is optional in those manifests If it is specified in those manifests, the package name must be identical to the package name specified in the manifest in the src/main/ folder For more information about the build files and process, see Build System Overview Debug and Performance Android Virtual Device (AVD) Manager AVD Manager has updated screens with links to help you select the most popular device configurations, screen sizes and resolutions for your app previews Click the Android Virtual Device Manager in the toolbar to open it and create new virtual devices for running your app in the emulator The AVD Manager comes with emulators for Nexus and Nexus devices and also supports creating custom Android device skins based on specific emulator properties and assigning those skins to hardware profiles Android Studio installs the Intel® x86 Hardware Accelerated Execution Manager (HAXM) emulator accelerator and creates a default emulator for quick app prototyping For more information, see Managing AVDs Memory Monitor Android Studio provides a memory monitor view so you can more easily monitor your app's memory usage to find deallocated objects, locate memory leaks and track the amount of memory the connected device is using With your app running on a device or emulator, click the Memory Monitor tab in the lower right corner to launch the memory monitor Figure Memory Monitor New Lint inspections Lint has several new checks to ensure:  Cipher.getInstance()  In custom Views, the associated declare-styleable for the custom view uses the same base name as the class name  Security check for fragment injection  Where ever property assignment no longer works as expected  Gradle plugin version is compatible with the SDK  Right to left validation  Required API version  many others is used with safe values Hovering over a Lint error displays the full issue explanation inline for easy error resolution There is also a helpful hyperlink at the end of the error message for additional error information With Android Studio, you can run Lint for a specific build variant, or for all build variants You can configure Lint by adding a lintOptions property to the Android settings in the build.gradle file android { lintOptions { // set to true to turn off analysis progress reporting by lint quiet true // if true, stop the gradle build if errors are found abortOnError false // if true, only report errors ignoreWarnings true For more information, see Improving Your Code with Lint Dynamic layout preview Android Studio allows you to work with layouts in both a Design View Figure Hello World App with Design View and a Text View Figure Hello World App with Text View Easily select and preview layout changes for different device images, display densities, UI modes, locales, and Android versions (multi-API version rendering) Figure API Version Rendering From the Design View, you can drag and drop elements from the Palette to the Preview or Component Tree The Text View allows you to directly edit the XML settings, while previewing the device display Log messages When you build and run your app with Android Studio, you can view adb and device log messages (logcat) in the DDMS pane by clicking Android at the bottom of the window If you want to debug your app with the Android Debug Monitor, you can launch it by clicking Monitor in the toolbar The Debug Monitor is where you can find the complete set of DDMS tools for profiling your app, controlling device behaviors, and more It also includes the Hierarchy Viewer tools to help optimize your layouts Installation, Setup, and Update Management Android Studio installation and setup wizards An updated installation and setup wizards walk you through a step-by-step installation and setup process as the wizard checks for system requirements, such as the Java Development Kit (JDK) and available RAM, and then prompts for optional installation options, such as the Intel® HAXM emulator accelerator An updated setup wizard walks you through the setup processes as the wizard updates your system image and emulation requirements, such GPU, and then creates an optimized default Android Virtual Device (AVD) based on Android (Lollipop) for speedy and reliable emulation Figure Setup Wizard Expanded template and form factor support Android Studio supports new templates for Google Services and expands the availabe device types Android Wear and TV support For easy cross-platform development, the Project Wizard provides new templates for creating your apps for Android Wear and TV Android Support Library, revision 21 (October 2014) Changes for v4 support library:  Added support for Fragment transitions for devices running Android 5.0 (API level 21) Be aware that transitions have no effect on devices running Android 4.4 and lower  Added DocumentFile to ease the transition from File while working with document trees However, this class demands more processing overhead compared to the platform's DocumentsContract API added in Android 4.4 (API level 19) So you should switch to using DocumentsContract when running on Android 4.4 and higher Changes for v7 appcompat library:  Added support for material design user interfaces  Added Toolbar, which generalizes the functionality of ActionBar for use within app layouts  Updated ActionBarDrawerToggle, which contains the menu-to-arrow animation  Updated common user interface widgets to allow tinting via theme attributes when running on pre-Android 5.0 devices  Added SwitchCompat, a backport of the Switch widget that was added in Android 4.0 (API level 14) New v7 cardview library:  Added the CardView widget, which provides a material design-compatible implementation for displaying data items New v7 recyclerview library:  Added the RecyclerView widget, which provides a flexible list view for providing a limited window into a large data set New v7 palette library:  Added Palette class, which lets you extract prominent colors from an image New v17 leanback library:  Added support for building TV user interfaces, including BrowseFragment, DetailsFragment, and PlaybackOverlayFragment For more information about using these user interface widgets, see Building TV Playback Apps Android Support Library, revision 20 (July 2014) Android Support Library, revision 19.1.0 (March 2014) Android Support Library, revision 19.0.1 (December 2013) Android Support Library, revision 19 (October 2013) Android Support Library, revision 18 (July 2013) Android Support Library, revision 13 (May 2013) Android Support Library, revision 12 (February 2013) Android Support Library, revision 11 (November 2012) Android Support Library, revision 10 (August 2012) Android Support Library, revision (June 2012) Android Support Library, revision (April 2012) Android Support Library, revision (March 2012) Android Support Library, revision (December 2011) Android Support Library, revision (December 2011) Android Support Library, revision (October 2011) Android Support Library, revision (July 2011) Android Support Library, revision (May 2011) Android Support Library, revision (March 2011) Support Library Features In this document v4 Support Library Multidex Support Library v7 Support Libraries v7 appcompat library v7 cardview library v7 gridlayout library v7 mediarouter library v7 palette library v7 recyclerview library v8 Support Library v13 Support Library v17 Leanback Library See also Support Library Revisions Support Library Setup The Android Support Library package contains several libraries that can be included in your application Each of these libraries supports a specific range of Android platform versions and set of features This guide explains the important features and version support provided by the Support Libraries to help you decide which of them you should include in your application In general, we recommend including the v4 support and v7 appcompat libraries, because they support a wide range of Android versions and provide APIs for recommended user interface patterns In order to use any of the following libraries, you must download the library files to your Android SDK installation Follow the directions for downloading the Support Libraries in Support Library Setup to complete this step You must take additional steps to include a specific Support Library in your application See the end of each library section below for important information on how to include the library in your application v4 Support Library This library is designed to be used with Android 1.6 (API level 4) and higher It includes the largest set of APIs compared to the other libraries, including support for application components, user interface features, accessibility, data handling, network connectivity, and programming utilities Here are a few of the key classes included in the v4 library:  App Components o Fragment - Adds support for encapsulation of user interface and functionality with Fragments, enabling applications to provide layouts that adjust between small and large-screen devices o NotificationCompat - Adds support for rich notification features o LocalBroadcastManager - Allows applications to easily register for and receive intents within a single application without broadcasting them globally  User Interface o ViewPager - Adds a ViewGroup that manages the layout for the child views, which the user can swipe between o PagerTitleStrip - Adds a non-interactive title strip, that can be added as a child of ViewPager o PagerTabStrip - Adds a navigation widget for switching between paged views, that can also be used with ViewPager o DrawerLayout - Adds support for creating a Navigation Drawer that can be pulled in from the edge of a window o SlidingPaneLayout - Adds widget for creating linked summary and detail views that appropriately adapt to various screen sizes  Accessibility o ExploreByTouchHelper - Adds a helper class for implementing accessibility support for custom views o AccessibilityEventCompat - Adds support for AccessibilityEvent For more information about implementing accessibility, see Accessibility o AccessibilityNodeInfoCompat - Adds support for AccessibilityNodeInfo o AccessibilityNodeProviderCompat - Adds support for AccessibilityNodeProvider o AccessibilityDelegateCompat - Adds support for View.AccessibilityDelegate  Content o Loader - Adds support for asynchronous loading of data The library also provides concrete implementations of this class, including CursorLoader and AsyncTaskLoader o FileProvider - Adds support for sharing of private files between applications There are many other APIs included in this library For complete, detailed information about the v4 Support Library APIs, see the android.support.v4 package in the API reference This library is located in the /extras/android/support/v4/ directory after you download the Android Support Libraries The library does not contain user interface resources To include it in your application project, follow the instructions for Adding libraries without resources Caution: Using dynamic dependencies, especially for higher version numbers, can cause unexpected version updates and regression incompatibilities The Gradle build script dependency identifier for this library is as follows: com.android.support:support-v4:21.0.+ This dependency notation specifies the latest release version with the 21.0 prefix Multidex Support Library This library provides support for building apps with multiple Dalvik Executable (DEX) files Apps that reference more than 65536 methods are required to use multidex configurations For more information about using multidex, see Building Apps with Over 65K Methods This library is located in the /extras/android/support/multidex/ directory after you download the Android Support Libraries The library does not contain user interface resources To include it in your application project, follow the instructions for Adding libraries without resources The Gradle build script dependency identifier for this library is as follows: com.android.support:multidex:1.0.+ This dependency notation specifies the latest release version with the 1.0 prefix v7 Support Libraries There are several libraries designed to be used with Android 2.1 (API level 7) and higher These libraries provide specific feature sets and can be included in your application independently from each other v7 appcompat library This library adds support for the Action Bar user interface design pattern This library includes support for material design user interface implementations Note: This library depends on the v4 Support Library If you are using Ant or Eclipse, make sure you include the v4 Support Library as part of this library's classpath Here are a few of the key classes included in the v7 appcompat library:  ActionBar  ActionBarActivity  ShareActionProvider - Provides an implementation of the action bar user interface pattern For more information on using the Action Bar, see the Action Bar developer guide - Adds an application activity class that must be used as a base class for activities that uses the Support Library action bar implementation - Adds support for a standardized sharing action (such as email or posting to social applications) that can be included in an action bar This library is located in the /extras/android/support/v7/appcompat/ directory after you download the Android Support Libraries The library contains user interface resources To include it in your application project, follow the instructions for Adding libraries with resources The Gradle build script dependency identifier for this library is as follows: com.android.support:appcompat-v7:21.0.+ This dependency notation specifies the latest release version with the 21.0 prefix v7 cardview library This library adds support for the CardView widget, which lets you show information inside cards that have a consistent look on any app These cards are useful for material design implementations, and are used extensively in layouts for TV apps This library is located in the /extras/android/support/v7/cardview/ directory after you download the Android Support Libraries The library contains user interface resources To include it in your application project, follow the instructions for Adding libraries with resources The Gradle build script dependency identifier for this library is as follows: com.android.support:cardview-v7:21.0.+ This dependency notation specifies the latest release version with the 21.0 prefix v7 gridlayout library This library adds support for the GridLayout class, which allows you to arrange user interface elements using a grid of rectangular cells For detailed information about the v7 gridlayout library APIs, see the android.support.v7.widget package in the API reference This library is located in the /extras/android/support/v7/gridlayout/ directory after you download the Android Support Libraries The library contains user interface resources To include it in your application project, follow the instructions for Adding libraries with resources The Gradle build script dependency identifier for this library is as follows: com.android.support:gridlayout-v7:21.0.+ This dependency notation specifies the latest release version with the 21.0 prefix v7 mediarouter library This library provides MediaRouter, MediaRouteProvider, and related media classes that support Google Cast In general, the APIs in the v7 mediarouter library provide a means of controlling the routing of media channels and streams from the current device to external screens, speakers, and other destination devices The library includes APIs for publishing app-specific media route providers, for discovering and selecting destination devices, for checking media status, and more For detailed information about the v7 mediarouter library APIs, see the android.support.v7.media package in the API reference The v7 mediarouter library is located in the directory after you download the Android Support Library It's provided as a library project with a dependency on the v7 appcompat library, so you'll need to include both libraries in your build path when setting up your project For more information on how to set up your project, follow the instructions in Adding libraries with resources If you are developing in Eclipse/ADT, make sure to include both the android-support-v7-mediarouter.jar and android-support-v7appcompat.jar files /extras/android/support/v7/mediarouter/ If you are using Android Studio, all you need to is specify the Gradle build script dependency identifier com.android.support:support-v7-mediarouter:, where "" is the minimum revision at which the library is available For example: com.android.support:mediarouter-v7:21.0.+ The v7 mediarouter library APIs introduced in Support Library r18 are subject to change in later revisions of the Support Library At this time, we recommend using the library only in connection with Google Cast v7 palette library The v7 palette support library includes the Palette class, which lets you extract prominent colors from an image For example, a music app could use a Palette object to extract the major colors from an album cover, and use those colors to build a color-coordinated song title card This library is located in the /extras/android/support/v7/palette/ directory after you download the Android Support Libraries The library does not contain user interface resources To include it in your application project, follow the instructions for Adding libraries without resources The Gradle build script dependency identifier for this library is as follows: com.android.support:palette-v7:21.0.+ This dependency notation specifies the latest release version with the 21.0 prefix v7 recyclerview library The recyclerview library adds the RecyclerView class This class provides support for the RecyclerView widget, a view for efficiently displaying large data sets by providing a limited window of data items This library is located in the /extras/android/support/v7/recyclerview/ directory after you download the Android Support Libraries The library contains user interface resources To include it in your application project, follow the instructions for Adding libraries with resources The Gradle build script dependency identifier for this library is as follows: com.android.support:recyclerview-v7:21.0.+ This dependency notation specifies the latest release version with the 21.0 prefix v8 Support Library This library is designed to be used with Android (API level 8) and higher It adds support for the RenderScript computation framework These APIs are included in the android.support.v8.renderscript package You should be aware that the steps for including these APIs in your application is very different from other support library APIs For more information about using these APIs in your application, see the RenderScript developer guide Note: Use of RenderScript with the support library is supported with the Android Eclipse plugin and Ant build tools It is not currently supported with Android Studio or Gradle-based builds v13 Support Library This library is designed to be used for Android 3.2 (API level 13) and higher It adds support for the Fragment user interface pattern with the (FragmentCompat) class and additional fragment support classes For more information about fragments, see the Fragments developer guide For detailed information about the v13 Support Library APIs, see the android.support.v13 package in the API reference This library is located in the /extras/android/support/v13/ directory after you download the Android Support Libraries The library does not contain user interface resources To include it in your application project, follow the instructions for Adding libraries without resources The Gradle build script dependency identifier for this library is as follows: com.android.support:support-v13:18.0.+ This dependency notation specifies the latest release version with the 18.0 prefix v17 Leanback Library The android.support.v17.leanback package provides APIs to support building user interfaces on TV devices It provides a number of important widgets for TV apps Some of the notable classes include:  BrowseFragment  DetailsFragment  PlaybackOverlayFragment  SearchFragment - A fragment for creating a primary layout for browsing categories and rows of media items - A wrapper fragment for Leanback details screens - A subclass of DetailsFragment for displaying playback controls and related content - A fragment to handle searches The fragment receives the user's search request and passes it to the application-provided SearchResultProvider The SearchResultProvider returns the search results to the SearchFragment, which renders them into a RowsFragment This library is located in the /extras/android/support/v17/leanback directory after you download the Android Support Libraries For more information on how to set up your project, follow the instructions in Adding libraries with resources The Gradle build script dependency identifier for this library is as follows: com.android.support:leanback-v17:21.0.+ This dependency notation specifies the latest release version with the 21.0 prefix Support Library Setup In this document Downloading the Support Library Choosing Support Libraries Adding Support Libraries Adding libraries without resources Adding libraries with resources Using Support Library APIs Manifest Declaration Changes Code Samples See also Support Library Revisions Support Library Features How you setup the Android Support Libraries in your development project depends on what features you want to use and what range of Android platform versions you want to support with your application This document guides you through downloading the Support Library package and adding libraries to your development environment Downloading the Support Libraries The Android Support Library package is provided as a supplemental download to the Android SDK and is available through the Android SDK Manager Follow the instructions below to obtain the Support Library files To download the Support Library through the SDK Manager: Start the Android SDK Manager In the SDK Manager window, scroll to the end of the Packages list, find the Extras folder and, if necessary, expand to show its contents Select the Android Support Library item Note: If you're developing with Android Studio, select and install the Android Support Repository item instead Click the Install packages button Figure The Android SDK Manager with the Android Support Library selected After downloading, the tool installs the Support Library files to your existing Android SDK directory The library files are located in the following subdirectory of your SDK: /extras/android/support/ directory Choosing Support Libraries Before adding a Support Library to your application, decide what features you want to include and the lowest Android versions you want to support For more information on the features provided by the different libraries, see Support Library Features Adding Support Libraries In order to use a Support Library, you must modify your application's project's classpath dependencies within your development environment You must perform this procedure for each Support Library you want to use Some Support Libraries contain resources beyond compiled code classes, such as images or XML files For example, the v7 appcompat and v7 gridlayout libraries include resources If you are not sure if a library contains resources, check the Support Library Features page The following sections describe how to add a Support Library with or without resources to your application project Adding libraries without resources To add a Support Library without resources to your application project: Using Eclipse Using Android Studio Adding libraries with resources To add a Support Library with resources (such as v7 appcompat for action bar) to your application project: Using Eclipse Using Android Studio Using Support Library APIs Support Library classes that provide support for existing framework APIs typically have the same name as framework class but are located in the android.support class packages, or have a *Compat suffix Caution: When using classes from the Support Library, be certain you import the class from the appropriate package For example, when applying the ActionBar class:  android.support.v7.app.ActionBar  android.app.ActionBar when using the Support Library when developing only for API level 11 or higher Note: After including the Support Library in your application project, we strongly recommend using the ProGuard tool to prepare your application APK for release In addition to protecting your source code, the ProGuard tool also removes unused classes from any libraries you include in your application, which keeps the download size of your application as small as possible For more information, see ProGuard Further guidance for using some Support Library features is provided in the Android developer training classes, guides and samples For more information about the individual Support Library classes and methods, see the android.support packages in the API reference Manifest Declaration Changes If you are increasing the backward compatibility of your existing application to an earlier version of the Android API with the Support Library, make sure to update your application's manifest Specifically, you should update the android:minSdkVersion element of the tag in the manifest to the new, lower version number, as shown below: The manifest setting tells Google Play that your application can be installed on devices with Android 2.1 (API level 7) and higher If you are using Gradle build files, the minSdkVersion setting in the build file overrides the manifest settings apply plugin: 'com.android.application' android { defaultConfig { minSdkVersion } } In this case, the build file setting tells Google Play that the default build variant of your application can be installed on devices with Android 2.2 (API level 8) and higher For more information about build variants, see Build System Overview Note: If you are including the v4 support and v7 appcompat libraries in your application, you should specify a minimum SDK version of "7" (and not "4") The highest support library level you include in your application determines the lowest API version in which it can operate Code Samples Each Support Library includes code samples to help you get started using the support APIs The code is included in the download from the SDK Manager and is placed inside the Android SDK installation directory, as listed below:  4v Samples: /extras/android/support/samples/Support4Demos/  7v Samples: /extras/android/support/samples/Support7Demos/  13v Samples: /extras/android/support/samples/Support13Demos/  App Navigation: /extras/android/support/samples/SupportAppNavigation/ [...]... details and restrictions, see the Content License About Android | Legal | Support Android Studio Tips and Tricks In this document 1 Productivity Features 2 Working with IntelliJ 3 Key Commands See also 1 Download Android Studio 2 IntelliJ IDEA Android Tutorials 3 IntelliJ FAQ on migrating to IntelliJ IDEA If you're unfamiliar with using Android Studio and the IntelliJ IDEA interface, this page provides... 2.5 For details and restrictions, see the Content License About Android | Legal | Support Developer Workflow To develop apps for Android, you use a set of tools that are included in Android Studio In addition to using the tools from Android Studio, you can also access most of the SDK tools from the command line Developing with Android Studio is the preferred method because it can directly invoke the... example that creates an AVD with name "my _android1 .5" and target ID "2" (the standard Android 1.5 system image in the list above): android create avd -n my _android1 .5 -t 2 If the target you selected was a standard Android system image ("Type: platform"), the android tool next asks you whether you want to create a custom hardware profile Android 1.5 is a basic Android platform Do you wish to create a... Here's an example of the command output: Available Android targets: id: 1 or "android- 3" Name: Android 1.5 Type: Platform API level: 3 Revision: 4 Skins: QVGA-L, HVGA-L, HVGA (default), HVGA-P, QVGA-P id: 2 or "android- 4" Name: Android 1.6 Type: Platform API level: 4 Revision: 3 Skins: QVGA, HVGA (default), WVGA800, WVGA854 id: 3 or "android- 7" Name: Android 2.1-update1 Type: Platform API level: 7 Revision:... The android tool also creates an .ini file for the AVD at the root of the android/ avd/ directory on your computer The file specifies the location of the AVD directory and always remains at the root the android directory By default, the android tool creates the AVD directory inside ~/ .android/ avd/ (on Linux/Mac), C:\Documents and Settings\\ .android\ on Windows XP, and C:\Users\\ .android\ ... you would have in Android Studio Figure 1 The development process for Android applications App Workflow The basic steps for developing applications (with or without Android Studio) are shown in figure 1 The development steps encompass four development phases, which include:  Environment Setup During this phase you install and set up your development environment You also create Android Virtual Devices... and develop your Android Studio project and application modules, which contain all of the source code and resource files for your application For more information, see Create an Android project  Building, Debugging and Testing During this phase you build your project into a debuggable apk package(s) that you can install and run on the emulator or an Android- powered device Android Studio uses a build... Android Studio, be familiar with all of the tools below, because you will have to run them from the command line or script android Create and update Android projects and create, move, and delete AVDs Android Emulator Run your Android applications on an emulated Android platform Android Debug Bridge Interface with your emulator or connected device (install apps, shell the device, issue commands, etc.)... and build your Android project into an installable apk file(s) Keytool To generate a keystore and private key, used to sign your apk file Keytool is part of the JDK Jarsigner (or similar signing tool) To sign your apk file with a private key generated by Keytool Jarsigner is part of the JDK If you are using Android Studio, tools such as adb and android are automatically called by Android Studio so you... Manager is a tool you can use to create and manage Android virtual devices (AVDs), which define device configurations for the Android Emulator To launch the AVD Manager:  In Android Studio, select Tools > Android > AVD Manager, or click the AVD Manager icon  in the toolbar Or, use the command line to navigate to your SDK's tools/ directory and execute: $ android avd The AVD Manager main screen shows your

Ngày đăng: 22/06/2016, 15:41

Từ khóa liên quan

Mục lục

  • Android Studio Overview

    • In this document

    • See also

    • Project and File Structure

      • Android Project View

      • New Project and Directory Structure

      • Creating new files

      • Android Build System

        • Android Build System

        • Application ID for Package Identification

        • Debug and Performance

          • Android Virtual Device (AVD) Manager

          • Memory Monitor

          • New Lint inspections

          • Dynamic layout preview

          • Log messages

          • Installation, Setup, and Update Management

            • Android Studio installation and setup wizards

            • Expanded template and form factor support

              • Android Wear and TV support

              • Google App Engine integration (Google Cloud Platform/Messaging)

              • Update channels

              • Other Highlights

                • Translation Editor

                • Editor support for the latest Android APIs

                • Easy access to Android code samples on GitHub

                • Android Studio Tips and Tricks

                  • In this document

Tài liệu cùng người dùng

Tài liệu liên quan