Presentation is loading. Please wait.

Presentation is loading. Please wait.

Android Studio IDE Tools Operation Summary. icle.html icle.html.

Similar presentations


Presentation on theme: "Android Studio IDE Tools Operation Summary. icle.html icle.html."— Presentation transcript:

1 Android Studio IDE Tools Operation Summary

2 http://www.vogella.com/tutorials/Android/art icle.html http://www.vogella.com/tutorials/Android/art icle.html

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

4 Project and File Structure -Android

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

6 Project and File Structure - Gradle Scripts

7 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/ direc tories, 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.

8 Memory and CPU monitor Android 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

9 Data file access The Android SDK tools, such as Systrace, logcat, and Traceview, generate performance and debugging data for detailed app analysis.SystracelogcatTraceview 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..hprof

10 Analyzing UI Performance with Systrace https://developer.android.com/tools/help/sys trace.html https://developer.android.com/tools/help/sys trace.html https://developer.android.com/tools/debuggi ng/systrace.html https://developer.android.com/tools/debuggi ng/systrace.html

11 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

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

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

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

15

16 Icon Function Run Debug Run with coverage Attach debugger to Android Process Setting Sync Project with Gradle Files AVD Manager SDK Manager Android Device Monitor Project Structure

17 Run Menu

18 Run App/Debug App

19 Run App

20 Debug App

21 Run

22 Edit Configuration

23 選擇目標活動 ( EX: Mainactivity ) 1. 選擇模擬器 2. 載入活動 3. 啟動模擬器

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

25 Edit Configuration

26 Tools

27 AVD Manager 按右鍵

28 SDK Manager

29 How do I add a library project to the Android Studio? http://stackoverflow.com/questions/1658806 4/how-do-i-add-a-library-project-to-the- android-studio http://stackoverflow.com/questions/1658806 4/how-do-i-add-a-library-project-to-the- android-studio 專案同步鈕

30 Features https://developer.android.com/tools/studio/st udio-features.html#git-samples https://developer.android.com/tools/studio/st udio-features.html#git-samples

31 Android Code Samples on GitHub Clicking Import Samples from the File menu or Welcome page provides seamless access to Google code samples on GitHub.

32 Imported code sample

33

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

35

36 Import Project from Eclipse 可直接在 Android Studio 介面直接 Import Eclipse 發展之專案 可能會發生版本相容性錯誤 請依指示安裝相容之 SDK 版本套件


Download ppt "Android Studio IDE Tools Operation Summary. icle.html icle.html."

Similar presentations


Ads by Google