android studio ide tools operation summary. icle.html icle.html

36
Android Studio IDE Tools Operation Summary

Upload: norah-french

Post on 05-Jan-2016

228 views

Category:

Documents


5 download

TRANSCRIPT

Page 1: Android Studio IDE Tools Operation Summary.  icle.html  icle.html

Android Studio IDE Tools

Operation Summary

Page 3: Android Studio IDE Tools Operation Summary.  icle.html  icle.html

Project and File Structure-Android

• Shows the most important source directories at the top level of the module hierarchy.

• Groups the build files for all modules in a common folder.

• Groups all the manifest files for each module in a common folder.

• 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.

Page 4: Android Studio IDE Tools Operation Summary.  icle.html  icle.html

Project and File Structure-Android

Page 5: Android Studio IDE Tools Operation Summary.  icle.html  icle.html

Project and File Structure- Gradle Scripts

• 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 four elements at the top level:

• java/ - Source files for the module.• manifests/ - Manifest files for the module.• res/ - Resource files for the module.• Gradle Scripts/ - Gradle build and property files.

Page 6: Android Studio IDE Tools Operation Summary.  icle.html  icle.html

Project and File Structure- Gradle Scripts

Page 7: Android Studio IDE Tools Operation Summary.  icle.html  icle.html

Project and File Structure-Project• When you use the Project view 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/ andsrc/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.

Page 8: Android Studio IDE Tools Operation Summary.  icle.html  icle.html

Memory and CPU monitorAndroid Studio provides a memory and CPU monitor view so you can more easily monitor your app's performance and memory usage to track CPU usage, 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 Android tab in the lower left corner of the runtime window to launch the Android runtime window. Click the Memory or CPU tab.

1. Initiate GC 2. Dump Java Heap 3. Start Allocation Tracking

Page 9: Android Studio IDE Tools Operation Summary.  icle.html  icle.html

Data file access

• The Android SDK tools, such as Systrace, logcat, and Traceview, generate performance and debugging data for detailed app analysis.

• To view the available generated data files, click Captures in the left corner of the runtime window. In the list of the generated files, double-click a file to view the data. Right-click any .hprof files to convert them to a standard .hprof file format.

Page 10: Android Studio IDE Tools Operation Summary.  icle.html  icle.html

Analyzing UI Performance with Systrace

• https://developer.android.com/tools/help/systrace.html

• https://developer.android.com/tools/debugging/systrace.html

Page 11: Android Studio IDE Tools Operation Summary.  icle.html  icle.html

Code inspections• Android Studio enables several lint checks to ensure:• Cipher.getInstance() is used with safe values• 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

Page 12: Android Studio IDE Tools Operation Summary.  icle.html  icle.html

• With Android Studio, you can also run lint inspections for a specific build variant, or for all build variants. You can configure the lint inspections that run by adding a lintOptions property to the Android settings in the build.gradlefile.

Page 13: Android Studio IDE Tools Operation Summary.  icle.html  icle.html

• 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 }

Page 14: Android Studio IDE Tools Operation Summary.  icle.html  icle.html

• You can also manage inspection profiles and configure inspections within Android Studio. Choose File > Settings >, expand the Editor options, and select Inspections. The Inspection Configuration page appears with the supported inspections.

Page 15: Android Studio IDE Tools Operation Summary.  icle.html  icle.html
Page 16: Android Studio IDE Tools Operation Summary.  icle.html  icle.html

Icon Function

RunDebug

Run with coverage

Attach debugger to Android Process

Setting

Sync Project with Gradle Files

AVD Manager

SDK Manager

Android Device MonitorProject Structure

Page 17: Android Studio IDE Tools Operation Summary.  icle.html  icle.html

Run Menu

Page 18: Android Studio IDE Tools Operation Summary.  icle.html  icle.html

Run App/Debug App

Page 19: Android Studio IDE Tools Operation Summary.  icle.html  icle.html

Run App

Page 20: Android Studio IDE Tools Operation Summary.  icle.html  icle.html

Debug App

Page 21: Android Studio IDE Tools Operation Summary.  icle.html  icle.html

Run

Page 22: Android Studio IDE Tools Operation Summary.  icle.html  icle.html

Edit Configuration

Page 23: Android Studio IDE Tools Operation Summary.  icle.html  icle.html

選擇目標活動 (EX: Mainactivity)

1. 選擇模擬器2. 載入活動3. 啟動模擬器

Page 24: Android Studio IDE Tools Operation Summary.  icle.html  icle.html

Debug

• 與 Run相似但結果為顯示 Debug結果

Page 25: Android Studio IDE Tools Operation Summary.  icle.html  icle.html

Edit Configuration

Page 26: Android Studio IDE Tools Operation Summary.  icle.html  icle.html

Tools

Page 27: Android Studio IDE Tools Operation Summary.  icle.html  icle.html

AVD Manager

按右鍵

Page 28: Android Studio IDE Tools Operation Summary.  icle.html  icle.html

SDK Manager

Page 29: Android Studio IDE Tools Operation Summary.  icle.html  icle.html

How do I add a library project to the Android Studio?

• http://stackoverflow.com/questions/16588064/how-do-i-add-a-library-project-to-the-android-studio

專案同步鈕

Page 30: Android Studio IDE Tools Operation Summary.  icle.html  icle.html

Features

• https://developer.android.com/tools/studio/studio-features.html#git-samples

Page 31: Android Studio IDE Tools Operation Summary.  icle.html  icle.html

Android Code Samples on GitHub• Clicking Import Samples from the File menu

or Welcome page provides seamless access to Google code samples on GitHub.

Page 32: Android Studio IDE Tools Operation Summary.  icle.html  icle.html

Imported code sample

Page 33: Android Studio IDE Tools Operation Summary.  icle.html  icle.html
Page 34: Android Studio IDE Tools Operation Summary.  icle.html  icle.html

4.4. Install support library• The support library allows you to use functionality provided by

higher Android releases in lower Android versions.• In the Android SDK Manager select Extras and install the Android

Support Repository. The Android Support Library is for the usage of the Eclipse ADT tooling.

• Android currently has several versions of the library, the v4, v7 and v13 version which are valid as of the respective API level of Android. For example, the support library v7 works as of Android devices with version API 7. Higher versions of the support library require also the lower versions to work. For example, support library v7 requires the v4 library.

Page 35: Android Studio IDE Tools Operation Summary.  icle.html  icle.html
Page 36: Android Studio IDE Tools Operation Summary.  icle.html  icle.html

Import Project from Eclipse

• 可直接在 Android Studio介面直接 Import Eclipse發展之專案

• 可能會發生版本相容性錯誤• 請依指示安裝相容之 SDK版本套件