Lập trình Androi part 49

Một công cụ trong kho của nhà phát triển Android là Dalvik Debug Dịch vụ Monitor (DDMS). Điều này cũng giống như một con dao quân đội Thụy Sĩ, cho phép bạn làm tất cả mọi thứ từ các tập tin đăng nhập trang, cập nhật vị trí GPS cung cấp bởi mô phỏng, mô phỏng cuộc gọi và tin nhắn và trang lưu trữ trên giả lập để đẩy và kéo tập tin. | CHAPTER 35 Development Tools 321 Delightful Dalvik Debugging Detailed Demoed Another tool in the Android developer s arsenal is the Dalvik Debug Monitor Service DDMS . This is like a Swiss army knife allowing you to do everything from browse log files update the GPS location provided by emulator simulate incoming calls and messages and browse the on-emulator storage to push and pull files. DDMS has a wide range of uses. Here I will introduce some of the most useful features. To launch DDMS run the ddms program inside the tools directory in your Android SDK distribution. It will initially display just a tree of emulators and running programs on the left as shown in Figure 35-7. Figure 35-7. DDMS initial view Clicking an emulator allows you to browse the event log on the bottom and manipulate the emulator via the tabs on the right as shown in Figure 35-8. 322 CHAPTER 35 Development Tools Figure 35-8. DDMS with emulator selected Logging Rather than use adb logcat DDMS lets you view your logging information in a scrollable table. Just highlight the emulator or device you want to monitor and the bottom half of the screen shows the logs. In addition you can do the following Filter the Log tab by any of the five logging levels shown as the V through E toolbar buttons. Create a custom filter so you can view only those entries tagged with your application s tag by pressing the toolbar button and completing the form see Figure 35-9 . The name you enter in the form will be used as the name of another logging output tab in the bottom portion of the DDMS main window. Save the log information to a text file for later perusal or for searching. CHAPTER 35 Development Tools 323 Figure 35-9. DDMS logging filter File Push and Pull While you can use adb pull and adb push to get files to and from an emulator or device DDMS lets you do that visually. Just highlight the emulator or device you wish to work with and then choose Device File Explorer from the main menu. That will bring up .

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.