1 / 36

Android Studio IDE Tools

Android Studio IDE Tools. Operation Summary. http://www.vogella.com/tutorials/Android/article.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.

Download Presentation

Android Studio IDE Tools

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Android Studio IDE Tools Operation Summary

  2. http://www.vogella.com/tutorials/Android/article.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/ 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.

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

  10. Analyzing UI Performance with Systrace • https://developer.android.com/tools/help/systrace.html • https://developer.android.com/tools/debugging/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. Icon Function AVD Manager Run Setting Debug SDK Manager Project Structure Run with coverage Android Device Monitor Sync Project with Gradle Files Attach debugger to Android Process

  16. Run Menu

  17. Run App/Debug App

  18. Run App

  19. Debug App

  20. Run

  21. Edit Configuration

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

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

  24. Edit Configuration

  25. Tools

  26. AVD Manager 按右鍵

  27. SDKManager

  28. 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 專案同步鈕

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

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

  31. Imported code sample

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

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

More Related