Phát triển phần mềm mã nguồn mở - IDE và SDK - Đại học Sài Gòn

Zend Studio • Zend Studio là IDE rất tốt dành cho lập trình viên PHP. • Zend Studio gồm có các thành phần: soạn thảo php, gỡ rối, phân tích, tối ưu, và làm việc với CSDL

pdf40 trang | Chia sẻ: dntpro1256 | Lượt xem: 551 | Lượt tải: 0download
Bạn đang xem trước 20 trang tài liệu Phát triển phần mềm mã nguồn mở - IDE và SDK - Đại học Sài Gòn, để xem tài liệu hoàn chỉnh bạn click vào nút DOWNLOAD ở trên
IDE và SDK Phát triển phần mềm mã nguồn mở Nội dung • Giới thiệu Eclipse • Android SDK • Zend Studio Giới thiệu Eclipse Giới thiệu Eclipse • Eclipse là IDE mã nguồn mở • Cung cấp công cụ để soạn thảo code, biên dịch, và debug. • Đầu tiên chỉ thiết kế riêng cho Java, nhưng nay đã hỗ trợ cho nhiều ngôn ngữ khác. – Hỗ trợ tốt cho C, C++ – Python, PHP, Ruby, v.v • Cần phải cài JDK để chạy Eclipse • Eclipse có thể được tải về từ – – Cần chọn “Eclipse IDE for Java Developers” Cài đặt Eclipse • Giải nén file zip vào một thư mục nào đó. • Trên windows – Thường giải nén vào thư mục C:\eclipse\ – Rồi tạo shortcut trên desktop để thi hành Eclipse • C:\eclipse\eclipse.exe • Trên Linux – Giải nén vào /opt/eclipse/ Chọn Workspace • Với Eclipse, toàn bộ mã nằm trong workspace • Một workspace chỉ là nơi cất giữ mã nguồn • Eclipse cho phép có nhiều workspaces – mỗi workspace được thiết kế theo cách riêng • Chọn nơi muốn lưu trữ file, rồi nhấp OK Welcome to Eclipse • Lần đầu tiên làm việc với Eclipse, ta sẽ thấy màn hình. • Từ đây ta có thể xem khái quát về platform, tài liệu hướng dẫn, code mẫu, v.v • Nhấp vào mũi tiên bên phải để lấy IDE Các thành phần Eclipse IDE Menubars Full drop down menus plus quick access to common functions Editor Pane This is where we edit our source code Perspective Switcher We can switch between various perspectives here Outline Pane This contains a hierarchical view of a source file Package Explorer Pane This is where our projects/files are listed Miscellaneous Pane Various components can appear in this pane – typically this contains a console and a list of compiler problems Task List Pane This contains a list of “tasks” to complete Tạo Project mới • To create a project: File  New  Java Project Tạo Project mới Thư mục src • Eclipse tự động tạo thư mục src để chứa mã Tạo Class • Nhấp vào nút New, rồi chọn Class Class mới được tạo Directory structure for package and actual java file created automatically Source is loaded into the editor pane, already stubbed out Source displayed in a hierarchical fashion listing each method name Biên dịch mã nguồn • Eclipse tự động biên dịch mã nguồn Packages/Classes with errors are marked with a red X Often Eclipse may have suggestions on how to fix the problem – if so, a small light bulb will be displayed next to the line of offending code Error underlined with red squiggly line (just like spelling errors in many word processors) Methods with errors are marked with a red X Position in file is marked with a red line – 1 click allows you to jump to line with error The Problems tab will contain a tabular representation of all errors across all files of all open projects Biên dịch mã nguồn • Eclipse đề nghị thay printn thành print hay println Running Code • Nhấp phải vào class rồi chọn Run As  Java Application Running Code • Kết quả xuất hiện trên Console tab Re-Running Code Debugging Code • Eclipse có bộ gỡ rối đẹp • Set break points ở lề bên trái Debugging Code • Nhấp phải vào class và chọn Debug As  Java Application Debugging Code • Lần đầu tiên debug sẽ thấy dialog sau Quan sát Debug List of breakpoints These buttons allow you to step through the code Note new Debug perspective – click Java to return to normal Variables in scope are listed here along with their current values (by right clicking you can change values of variables as you program is running) Current high level location (class and method) This pane shows the current line of code we broke on Output console, just like in normal run mode Android Tools • Phone • Eclipse ( ) – Android Plugin (ADT) • Android SDK ( ) • Windows Users: cần cài đặt Motorola Driver trực tiếp ( EN/Support-Homepage/Software_and_Drivers/USB-and-PC- Charging-Drivers ) Android SDK • Mỗi lần cài là mở trình SDK Manager • Cài các gói cần thiết • Tạo thiết bị ảo Android Virtual Device (AVD) SDK Manager AVD ADT Plugin • Vào Eclipse, chọn Help → Install New Software • Nhấn ‘Add’ ở góc phải trên • Nhập: – Name: ADT Plugin – Location: https://dl-ssl.google.com/android/eclipse/ • Nhấn OK, chọn ‘Developer Tools’, nhấn Next • Nhấn tiếp Next và nhấn Finish • Sau đó khởi động Eclipse • Định vị SDK (3 slides tiếp theo) – Phải thực hiện điều này mỗi lần khởi động project mới ở nơi mới (ít nhất là trên Windows) ADT Plugin ADT Plugin ADT Plugin ADT Plugin ADT Plugin Tạo Project Tạo Project Chọn thông tin và nhấn Finish Zend Studio • Zend Studio là IDE rất tốt dành cho lập trình viên PHP. • Zend Studio gồm có các thành phần: soạn thảo php, gỡ rối, phân tích, tối ưu, và làm việc với CSDL. Zend Studio Cài đặt ZS trên Windows Cài đặt ZS trên Eclipse Cài đặt ZS trên Eclipse Cài đặt ZS trên Eclipse

Các file đính kèm theo tài liệu này:

  • pdfdh_sai_gonbai_2_opensourceide_sdk_1075_2009121.pdf