Quản lý dự án trên blackbery

MỤC LỤC HÌNH ẢNH 4 MỤC LỤC CÁC BẢNG 5 LỜI MỞ ĐẦU 6 CHƯƠNG I : TỔNG QUAN VỀ ĐỀ TÀI 7 1.1. GIỚI THIỆU CHUNG 7 1.2. HƯỚNG NGHIÊN CỨU 7 1.2.1. Lý Do Chọn Đề Tài 7 1.2.2. Mục Đích Đề Tài 7 1.3. TỔNG KẾT CHƯƠNG I 7 CHƯƠNG II: CƠ SỞ LÝ THUYẾT 8 2.1. CÁC NỀN TẢNG 8 2.1.1. Windows Mobile 8 2.1.2. iPhone 8 2.1.3 Android 8 2.1.4. Blackberry 8 2.2. GIỚI THIỆU VỀ J2ME 9 2.2.1. Lịch Sử 9 2.2.2. Lý do chọn J2ME 9 2.2.3. Kiến trúc của J2ME 9 2.2.4. Các Thành Phần Trong J2ME 10 2.2.4.1. Định Nghĩa Về Configuration 10 2.2.4.2. Định Nghĩa Về Profile 11 2.3. LẬP TRÌNH BLACKBERRY 12 2.2.1. Giới Thiệu Chung 12 2.2.2. Môi Trường Lập Trình Trên Blackberry 12 2.2.2.1. Blackberry JDE 12 2.2.2.2. Eclipse Plug-in 13 2.2.3. Lập Trình Ứng Dụng Trên BlackBerry 13 2.2.3.1. Làm Việc Với Các UIComponent 13 2.2.3.2. Làm Việc Với Data Trên BlackBerry 15 2.2.3.3. Làm việc với Ksoap 17 2.2.4. Tạo ứng dụng cho BlackBerry 17 2.2.4.1. Bắt đầu một ứng dụng 17 2.2.4.2. Tạo một ứng dụng 17 2.2.4.3. Gọi thread event 18 2.2.4.4. Processing Event 18 2.2.4.5 Thoát ứng dụng 18 2.2.4.6. Tạo ứng dụng mẫu 18 2.4. TỔNG KẾT CHƯƠNG II 33 CHƯƠNG III: ỨNG DỤNG MÔ PHỎNG 34 3.1. GIỚI THIỆU VỀ ỨNG DỤNG BPROJECT MANAGE 34 3.2. CÁC CHỨC NĂNG CHÍNH VÀ MÃ LỆNH 34 3.2.1. Quản lý công việc 34 3.2.2. Quản lý các vấn đề trong quá trình làm dự án 53 3.2.3. Quản lý thành viên 55 3.2.4. Quản lý tiến độ dự án 57 3.2.5. Quản lý nhiều dự án 66 3.3. CÁC LỚP TƯƠNG TÁC VỚI WEBSERVICE 66 3.3.1. Lớp quản lý dự án 66 3.3.2. Lớp quản lý công việc 72 3.3.3. Lớp quản lý những vấn đề trong thời gian làm dự án 81 3.3.4. Lớp quản lý thành viên 88 3.4. TỔNG KẾT CHƯƠNG III 95 TÀI LIỆU THAM KHẢO 96

doc96 trang | Chia sẻ: lvcdongnoi | Lượt xem: 2484 | Lượt tải: 0download
Bạn đang xem trước 20 trang tài liệu Quản lý dự án trên blackbery, để xem tài liệu hoàn chỉnh bạn click vào nút DOWNLOAD ở trên
00, EditField.FILTER_DEFAULT); comment = new EditField("Comment: ", tsk.getComment(), 10000, EditField.FILTER_DEFAULT); memberChoiceField = new ObjectChoiceField("Member : ", listMemberName); memberChoiceField.setSelectedIndex(member_index); dateBegin = new DateField("Date Begin: ", System.currentTimeMillis(), DateField.DATE); String strDate = tsk.getBegin_date(); strDate = ProccessMethods.strDateConvert(strDate); Date dateConvert = new Date(HttpDateParser.parse(strDate)); dateBegin.setDate(dateConvert); dateEnd = new DateField("Date End: ", System.currentTimeMillis(), DateField.DATE); strDate = tsk.getEnd_date(); strDate = ProccessMethods.strDateConvert(strDate); dateConvert = new Date(HttpDateParser.parse(strDate)); dateEnd.setDate(dateConvert); VerticalFieldManager fieldManager = new VerticalFieldManager( FIELD_VCENTER); fieldManager.add(taskName); fieldManager.add(priority); fieldManager.add(dateBegin); fieldManager.add(dateEnd); fieldManager.add(duration); fieldManager.add(status); fieldManager.add(memberChoiceField); fieldManager.add(description); fieldManager.add(comment); fieldManager.setPadding(0, 10, 0, 10); add(fieldManager); add(new SeparatorField()); HorizontalFieldManager buttonManager = new HorizontalFieldManager( FIELD_HCENTER); VerticalFieldManager vertical = new VerticalFieldManager(); back = new ButtonField("Back", ButtonField.CONSUME_CLICK); update = new ButtonField("Update", ButtonField.CONSUME_CLICK); reset = new ButtonField("Reset", ButtonField.CONSUME_CLICK); buttonManager.add(back); buttonManager.add(update); buttonManager.add(reset); vertical.add(buttonManager); add(vertical); back.setChangeListener(this); reset.setChangeListener(this); update.setChangeListener(this); dateBegin.setFocusListener(this); dateEnd.setFocusListener(this); taskName.setFocusListener(this); duration.setFocusListener(this); priority.setFocusListener(this); status.setFocusListener(this); memberChoiceField.setFocusListener(this); description.setFocusListener(this); comment.setFocusListener(this); taskName.setChangeListener(this); description.setChangeListener(this); comment.setChangeListener(this); status.setChangeListener(this); memberChoiceField.setChangeListener(this); priority.setChangeListener(this); dateBegin.setChangeListener(this); dateEnd.setChangeListener(this); } protected void makeMenu(Menu menu, int instance) { super.makeMenu(menu, instance); menu.add(new MenuItem("Back", 10, 10) { public void run() { back(); } }); menu.add(new MenuItem("Update", 10, 10) { public void run() { update(); } }); menu.add(new MenuItem("Reset", 10, 10) { public void run() { reset(); } }); } public void select(Field field) { UiApplication.getUiApplication().popScreen(getScreen()); TaskManageScreen taskManageScreen = new TaskManageScreen(); UiApplication.getUiApplication().pushScreen(taskManageScreen); } private void ExitApplication() { int response = Dialog.ask(Dialog.D_YES_NO,"Are you sure you want exit?"); if (response != -1) System.exit(0); } public void LoadScreen() { int count = 0; if (keyword == null) keyword = ""; try { for (int i = 0; i < vt.size(); i++) { tasks[i] = (Task) (vt.elementAt(i)); String strObjectName = tasks[i].getTask_name(); int intStatus = tasks[i].getStatus_id(); String temp = ProccessMethods.StandardString(keyword); temp = temp.toLowerCase(); strObjectName = ProccessMethods.StandardString(strObjectName); strObjectName = strObjectName.toLowerCase(); if (strObjectName.indexOf(temp) == 0&& ((status_id == 0) || (status_id == intStatus))) { LoadButton(i, count); count++; } } } catch (Exception e) { System.out.println(e.toString()); } } public void LoadButton(int index, int count) { int status = tasks[index].getStatus_id(); if (status == 1) { _leftIcon = Bitmap.getBitmapResource("InProgress.png"); } else if (status == 2) { _leftIcon = Bitmap.getBitmapResource("Finish_Icon.png"); } else if (status == 3) { _leftIcon = Bitmap.getBitmapResource("Waiting.png"); } else { _leftIcon = Bitmap.getBitmapResource("Fail.png"); } show_task = new StyleButtonField(_leftIcon,tasks[index].getTask_name(), _caret, 0); tkVector.addElement(show_task); ((StyleButtonField) tkVector.elementAt(count)).task_id = tasks[index] .getTask_id(); ((StyleButtonField) tkVector.elementAt(count)).task_name = tasks[index] .getTask_name(); show_task.setChangeListener(this); show_task.setFocusListener(this); buttonSet.add(show_task); } } 3.2.2. Quản lý các vấn đề trong quá trình làm dự án Quản lý các vấn đề, các sự cố xảy ra trong quá trình làm dự án là quản lý danh sách các vấn đề đã xảy ra, từ chức này người quản lý có thể biết được dự án có bao nhiêu vấn đề cần giải quyêt, chưa giải quyết, mức độ ưu tiên của vấn đề, các vấn đề được giao cho ai xử lý để từ đó có những hành động kịp thời để khắc phục những sự cố. Sau đây là đoạn mã thực hiện những công việc trên: public void LoadListIssue(int index, int count) { int status = project_issues[index].getStatus_id(); if (status == 1) { _leftIcon = Bitmap.getBitmapResource(MessageResource.ICON_WAITING); } else if (status == 2) { _leftIcon = Bitmap.getBitmapResource(MessageResource.ICON_WORKING); } else if (status == 3) { _leftIcon = Bitmap.getBitmapResource(MessageResource.ICON_FINISHED); } else { _leftIcon = Bitmap.getBitmapResource(MessageResource.ICON_FAILED); } show_project_issue = new StyleButtonField(_leftIcon, project_issues[index].getProject_issue_name(), _caret, 0); piVector.addElement(show_project_issue); ((StyleButtonField)piVector.elementAt(count)).project_issue_id = project_issues[index].getProject_issue_id(); ((StyleButtonField)piVector.elementAt(count)).project_issue_name = project_issues[index].getProject_issue_name(); show_project_issue.setChangeListener(this); show_project_issue.setFocusListener(this); buttonSet.add(show_project_issue); } Figure 18 – Màn hình quản lý các vấn đề của dự án trong quá trình làm Trong chức năng này cũng có những chức năng như thêm mới, xóa, cập nhật thông tin. Những lớp và phương thức thực hiện những chức năng này tương tự với chức năng quản lý công việc. 3.2.3. Quản lý thành viên Quản lý thành viên là quản lý những thành viên đang làm trong dự án, các thông tin về thành viên do minh quản lý sẽ nằm trong chức năng này. Đoạn mã thực hiện việc lấy danh sách thành viên như sau: public void LoadListMember(int index, int count) { _leftIcon = Bitmap.getBitmapResource(MessageResource.ICON_MEMBER); show_member = new StyleButtonField(_leftIcon, members[index] .getMember_name(), _caret, 0); mbVector.addElement (show_member); ((StyleButtonField)mbVector.elementAt(count)).member_id= members[index].getMember_id(); ((StyleButtonField)mbVector.elementAt(count)).member_name= members[index].getMember_name(); show_member.setChangeListener(this); show_member.setFocusListener(this); buttonSet.add(show_member); } Figure 19 – Màn hình biểu diễn danh sách thành viên Tương tự như hai chức năng quản lý công việc và quản lý vấn đề trong quá trình làm dự án thì chức năng quản lý thành viên cũng có những chức năng thêm mới, xóa, cập nhật thông tin. Các lớp và phương thức thực hiện những chức năng này tương tư như chức năng quản lý công việc. 3.2.4. Quản lý tiến độ dự án Quản lý tiến độ dự án là một chức năng đặc biệt của ứng dụng này. Ứng dụng dựa vào số lượng công việc và tỉ lệ đã làm, chưa làm của các công việc để tính ra tiến độ thật của dự án. Đồng thời dựa vào kế hoạch ban đầu do người quản lý đặt ra để tính ra tiến độ của dự án dự theo bản kế hoạch đó và sau đó sẽ tổng hợp và vẽ một biểu đồ. Chức năng này có thể cho người quản lý biết được dự án của mình có đi đúng tiến độ hay không, nếu không thì nhanh hay chậm so với kế hoạch ban đầu. Biểu đồ biểu diễn tiến độ của dự án sẽ tương tự như sau: Figure 20 – Màn hình biểu diễn tiến độ của dự án Lớp thực hiện việc vẽ biểu đồ: public class DrawChart extends Field implements DrawStyle { Graphics grap; private int fieldWidth; private int fieldHeight; int numberOfproject; int numberOftask; String[] Dvi = new String[] { "Week", "Month", "Year" }; String DV; private ProjectManagement pm; private TaskManagement tm; private Project proj; public DrawChart() { fieldHeight = Display.getHeight(); fieldWidth = Display.getWidth(); } protected void layout(int width, int height) { setExtent(getPreferredWidth(), getPreferredHeight()); } public int getPreferredWidth() { return fieldWidth; } public int getPreferredHeight() { return fieldHeight; } protected void paint(Graphics grap) { pm = new ProjectManagement(); proj = new Project(); proj = pm.ProjectInfo(ListProjectScreen.project_id); numberOfproject = proj.getDuration(); numberOftask = 100; int numberX; int du; int k = 0; numberX = numberOfproject / 7; du = numberOfproject % 7; DV = "Week"; int a = 40; if (numberX == 24) { a += 10; } else if (numberX < 24) { if (du == 0) { a = a + 240 / numberX; } else { a = a + 240 / (numberX + 1); } } else { numberX = numberOfproject / 30; du = numberOfproject % 30; if (numberX == 24) { DV = "Month"; a += 10; } else if (numberX < 24) { DV = "Month"; if (du == 0) { a = a + 240 / (numberX); } else { a = a + 240 / (numberX + 1); } } else { numberX = numberOfproject / 90; du = numberOfproject % 90; if (numberX == 24) { a += 10; } else if (numberX < 24) { if (du == 0) { a = a + 240 / (numberX); } else { a = a + 240 / (numberX + 1); } } } } int dux = 0; if (du == 0) { k = numberOfproject / numberX; } else { k = numberOfproject / (numberX + 1); dux = numberOfproject % (numberX + 1); } grap.setColor(Color.BLACK); grap.fillRect(40, 20, (int) 2.5, 200); int y = 20; grap.setColor(Color.DARKGRAY); grap.setFont(Font.getDefault().derive(Font.BOLD, 12, Font.PLAIN)); String[] textY = { "10", "20", "30", "40", "50", "60", "70", "80", "90", "100" }; for (int i = 0; i < 10; i++) { if (i == 0) { grap.drawText(textY[9], 15, y); } else { grap.drawText(textY[9 - i], 20, y); } y = y + 20; } // Draw Table String[] text = { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24" }; int x = 43; grap.setFont(Font.getDefault().derive(Font.BOLD, 9, Font.PLAIN)); if (du == 0) { for (int i = 0; i < numberX; i++) { grap.setColor(Color.GREENYELLOW); grap.drawLine(a, 220, a, 20); grap.setColor(Color.DARKGRAY); grap.drawText(text[i], x, 220); x = x + 240 / (numberX); a = a + 240 / (numberX); } // Draw DeadLine grap.setColor(Color.CHOCOLATE); grap.drawLine(a - 240 / (numberX), 220, a - 240 / (numberX), 20); // Draw axis Table x grap.setColor(Color.BLACK); grap.fillRect(40, 220, (a - 240 / (numberX)) - 40, (int) 2.5); // Draw axis Table Y grap.setColor(Color.GREENYELLOW); int b = 20; for (int i = 0; i < 10; i++) { grap.drawLine(40, b, (a - 240 / (numberX)), b); b = b + 20; } } else { int rowEnd = (dux * (240 / (numberX + 1))) / k; for (int i = 0; i < numberX + 1; i++) { grap.setColor(Color.GREENYELLOW); grap.drawLine(a, 220, a, 20); grap.setColor(Color.DARKGRAY); grap.drawText(text[i], x, 220); x = x + 240 / (numberX + 1); a = a + 240 / (numberX + 1); } // Draw DeadLine grap.setColor(Color.CHOCOLATE); grap.drawLine(a + rowEnd - (240 / (numberX + 1)) * 2, 220, a + rowEnd - (240 / (numberX + 1)) * 2, 20); // draw axis Table X grap.setColor(Color.BLACK); grap.fillRect(40, 220, (a - 240 / (numberX + 1)) - 40, (int) 2.5); // Draw axis Table Y grap.setColor(Color.GREENYELLOW); int b = 20; for (int i = 0; i < 10; i++) { grap.drawLine(40, b, (a - 240 / (numberX + 1)), b); b = b + 20; } } // Load database replace this array. tm = new TaskManagement(); int[] plan = tm.taskCount(ListProjectScreen.project_id, k, false); int[] plan1 = { 15, 16, 25, 46, 55, 22, 90, 86, 72, 68, 68, 80, 15, 25, 30, 40, 30, 43, 87, 65, 45, 87, 50, 67 }; // Draw Chart int sumTaskPlan = 0; int sumTaskDone = 0; // draw Plan line int x3 = 40; grap.setColor(Color.BLUE); if (du == 0) { for (int i = 0; i < numberX; i++) { if (i == 0) { grap.drawLine(x3, 220 - 2 * plan[i],x3 + 240 / (numberX), 220 - 2 * plan[i]); } else { grap.drawLine(x3, 220 - 2 * plan[i - 1], x3 + 240/ (numberX), 220 - 2 * plan[i]); } x3 = x3 + 240 / numberX; } } else { int rowEnd = (dux * (240 / (numberX + 1))) / k; for (int i = 0; i < plan.length; i++) { if (i == 0) { grap.drawLine(x3, 220 - 2 * plan[i], x3 + 240 / (numberX + 1), 220 - 2 * plan[i]); } else if (i == plan.length - 1) { grap.drawLine(x3-240 / (numberX + 1), 220 - 2 * plan[i - 1], x3 -240 / (numberX + 1)+ rowEnd,220 - 2 * plan[i]); } else { grap.drawLine(x3, 220 - 2 * plan[i - 1], x3 + 240/ (numberX + 1), 220 - 2 * plan[i]); } x3 = x3 + 240 / (numberX + 1); } } // Draw Real Line int x4 = 40; grap.setColor(Color.RED); if (du == 0) { for (int i = 0; i < numberX - 5; i++) { if (i == 0) { grap.drawLine(x4, 220 - 2 * plan1[i], x4 + 240/ (numberX), 220 - 2 * plan1[i]); } else { grap.drawLine(x4, 220 - 2 * plan1[i - 1], x4 + 240 / (numberX), 220 - 2 * plan1[i]) } x4 = x4 + 240 / numberX; sumTaskDone = sumTaskDone + plan1[i]; } } else { int rowEnd = (3 * (240 / (numberX + 1))) / 7; for (int i = 0; i < numberX - 3; i++) { if (i == 0) { grap.drawLine(x4, 220 - 2 * plan1[i], x4 + 240/ (numberX + 1), 220 - 2 * plan1[i]); } else if (i == numberX - 1) { grap.drawLine(x4, 220 - 2 * plan1[i - 1], x4 + 240/ (numberX + 1) + rowEnd, 220 - 2 * plan1[i]); } else { grap.drawLine(x4, 220 - 2 * plan1[i - 1], x4 + 240 / (numberX + 1), 220 - 2 * plan1[i]); } x4 = x4 + 240 / (numberX + 1); sumTaskDone = sumTaskDone + plan1[i]; } } grap.setColor(Color.RED); grap.drawText("Task done : " + sumTaskDone, 220, 3); grap.setColor(Color.BLUE); grap.drawText("Task plan : " + sumTaskPlan, 40, 3); grap.drawText(DV, 285, 220); grap.setColor(Color.CHOCOLATE); grap.setFont(Font.getDefault().derive(Font.BOLD, 8, Font.PLAIN)); grap.drawText("Time of Project : " + numberOfproject, 120, 3); } protected boolean keyChar(char character, int status, int time) { if (Characters.ESCAPE == character) { back(); return true; } return super.keyChar(character, status, time); } private void back() { UiApplication.getUiApplication().popScreen(getScreen()); GeneralReport listProjectIssueScreen = new GeneralReport(); UiApplication.getUiApplication().pushScreen(listProjectIssueScreen); } } 3.2.5. Quản lý nhiều dự án Vì trong một thời điểm người quản lý dự án có thể quản lý nhiều dự án khác nhau. Chức năng quản lý nhiều dự án này cũng tương tự với chức năng quản lý công việc hay quản lý những vấn đề trong quá trình làm dự án. 3.3. CÁC LỚP TƯƠNG TÁC VỚI WEBSERVICE Vì BlackBerry không hỗ trợ cơ sở dữ liệu SQLite như iPhone và Adroid nên ứng dụng chọn các lưu dữ liệu ở một server và dùng webservice để tương tác với cơ sở dữ liệu đó. Để có được dữ liệu thì BlackBerry phải tương tác với webserview để có thể lấy được dữ liệu từ server. Những lớp tương tác giữa BlackBerry và Webservice gồm có: 3.3.1. Lớp quản lý dự án Là lớp tương tác với webservice để lấy thông tin về những dự án: public class ProjectManagement { private String bean = "Project"; private String service_url = ConnectString.SERVICE_URL; private String service_namespace = ConnectString.SERVICE_NAMESPACE; private String soap_action = ""; private String method = ""; private HttpTransport ht; public Vector ListProject(String keyword) { SetValue sv = new SetValue(); Vector list = new Vector(); method = "ListProject"; if (DeviceInfo.isSimulator()) { service_url = service_url + ";deviceSide=true"; } soap_action = service_namespace + method; SoapObject request = new SoapObject(service_namespace, method); request.addProperty("keyword", keyword); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope( SoapEnvelope.VER11); envelope.headerOut = ConfirmMethods.setHeaderOut(); envelope.bodyOut = request; envelope.dotNet = true; envelope.encodingStyle = SoapSerializationEnvelope.ENC2001; envelope.addMapping(service_namespace + "encodedTypes", "Project", new Project().getClass()); envelope.setOutputSoapObject(request); ht = new HttpTransport(service_url); ht.debug = true; TimerTask task = new TimerTask() { public void run() { ht.reset(); } }; try { new Timer().schedule(task, CustomDialogLogin.TIMEOUT_LIST); ht.call(soap_action, envelope); try { Object myObj = (Object) envelope.getResponse(); list = sv.toArray(myObj.toString(), bean); } catch (Exception e) { System.out.println(e.toString()); } task.cancel(); } catch (Exception ex) { throw new RuntimeException(ProccessMethods.getErrorMessage(ex)); } return list; } public Project ProjectInfo(int project_id) { SetValue sv = new SetValue(); Project proj = new Project(); method = "ProjectInfo"; if (DeviceInfo.isSimulator()) { service_url = service_url + ";deviceSide=true"; } soap_action = service_namespace + method; SoapObject request = new SoapObject(service_namespace, method); request.addProperty("project_id", project_id + ""); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope( SoapEnvelope.VER11); envelope.headerOut = ConfirmMethods.setHeaderOut(); envelope.bodyOut = request; envelope.dotNet = true; envelope.encodingStyle = SoapSerializationEnvelope.ENC2001; envelope.addMapping(service_namespace + "encodedTypes", "Project", new Project().getClass()); envelope.setOutputSoapObject(request); ht = new HttpTransport(service_url); ht.debug = true; TimerTask task = new TimerTask() { public void run() { ht.reset(); } }; try { new Timer().schedule(task, CustomDialogLogin.TIMEOUT_SIMPLE); ht.call(soap_action, envelope); try { Object myObj = (Object) envelope.getResponse(); proj = (Project) sv.toBean(myObj.toString(), bean); } catch (Exception e) { System.out.println(e.toString()); } task.cancel(); } catch (Exception ex) { throw new RuntimeException(ProccessMethods.getErrorMessage(ex)); } return proj; } public boolean AddProject(String project_name, String description, int duration, String begin_date, String end_date, String comment, int status_id) { method = "AddProject"; if (DeviceInfo.isSimulator()) { service_url = service_url + ";deviceSide=true"; } soap_action = service_namespace + method; SoapObject request = new SoapObject(service_namespace, method); request.addProperty("project_name", project_name); request.addProperty("description", description); request.addProperty("duration", duration + ""); request.addProperty("begin_date", begin_date); request.addProperty("end_date", end_date); request.addProperty("comment", comment); request.addProperty("status_id", status_id + ""); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope( SoapEnvelope.VER11); envelope.headerOut = ConfirmMethods.setHeaderOut(); envelope.bodyOut = request; envelope.dotNet = true; envelope.encodingStyle = SoapSerializationEnvelope.ENC2001; envelope.setOutputSoapObject(request); ht = new HttpTransport(service_url); ht.debug = true; TimerTask task = new TimerTask() { public void run() { ht.reset(); } }; try { new Timer().schedule(task, CustomDialogLogin.TIMEOUT_SIMPLE); ht.call(soap_action, envelope); String myObj = envelope.getResponse().toString(); task.cancel(); if (myObj.equals("true")) return true; else return false; } catch (Exception ex) { throw new RuntimeException(ProccessMethods.getErrorMessage(ex)); } } public boolean UpdateProject(int project_id, String project_name, String description, int duration, String begin_date, String end_date, String comment, int status_id) { method = "UpdateProject"; if (DeviceInfo.isSimulator()) { service_url = service_url + ";deviceSide=true"; } soap_action = service_namespace + method; SoapObject request = new SoapObject(service_namespace, method); request.addProperty("project_id", project_id + ""); request.addProperty("project_name", project_name); request.addProperty("description", description); request.addProperty("duration", duration + ""); request.addProperty("begin_date", begin_date); request.addProperty("end_date", end_date); request.addProperty("comment", comment); request.addProperty("status_id", status_id + ""); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope( SoapEnvelope.VER11); envelope.headerOut = ConfirmMethods.setHeaderOut(); envelope.bodyOut = request; envelope.dotNet = true; envelope.encodingStyle = SoapSerializationEnvelope.ENC2001; envelope.setOutputSoapObject(request); ht = new HttpTransport(service_url); ht.debug = true; TimerTask task = new TimerTask() { public void run() { ht.reset(); } }; try { new Timer().schedule(task, CustomDialogLogin.TIMEOUT_SIMPLE); ht.call(soap_action, envelope); String myObj = envelope.getResponse().toString(); task.cancel(); if (myObj.equals("true")) return true; else return false; } catch (Exception ex) { throw new RuntimeException(ProccessMethods.getErrorMessage(ex)); } } public boolean DelProject(int project_id) { method = "DelProject"; if (DeviceInfo.isSimulator()) { service_url = service_url + ";deviceSide=true"; } soap_action = service_namespace + method; SoapObject request = new SoapObject(service_namespace, method); request.addProperty("project_id", project_id + ""); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope( SoapEnvelope.VER11); envelope.headerOut = ConfirmMethods.setHeaderOut(); envelope.bodyOut = request; envelope.dotNet = true; envelope.encodingStyle = SoapSerializationEnvelope.ENC2001; envelope.setOutputSoapObject(request); ht = new HttpTransport(service_url); ht.debug = true; TimerTask task = new TimerTask() { public void run() { ht.reset(); } }; try { new Timer().schedule(task, CustomDialogLogin.TIMEOUT_SIMPLE); ht.call(soap_action, envelope); String myObj = envelope.getResponse().toString(); task.cancel(); if (myObj.equals("true")) return true; else return false; } catch (Exception ex) { throw new RuntimeException(ProccessMethods.getErrorMessage(ex)); } } } 3.3.2. Lớp quản lý công việc Cũng tương tự với lớp quản lý các dự án. Lớp này sẽ tương tác với webservice để lấy dữ liệu công việc từ server: public class TaskManagement { private String bean = "Task"; private String service_url = ConnectString.SERVICE_URL; private String service_namespace = ConnectString.SERVICE_NAMESPACE; private String soap_action = ""; private String method = ""; HttpTransport ht; public Vector ListTask(int project_id, String keyword) { SetValue sv = new SetValue(); Vector list = new Vector(); method = "ListTask"; if (DeviceInfo.isSimulator()) { service_url = service_url + ";deviceSide=true"; } soap_action = service_namespace + method; SoapObject request = new SoapObject(service_namespace, method); request.addProperty("project_id", project_id + ""); request.addProperty("keyword", keyword); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope( SoapEnvelope.VER11); envelope.headerOut = ConfirmMethods.setHeaderOut(); envelope.bodyOut = request; envelope.dotNet = true; envelope.encodingStyle = SoapSerializationEnvelope.ENC2001; envelope.addMapping(service_namespace + "encodedTypes", "Task", new Task().getClass()); envelope.setOutputSoapObject(request); ht = new HttpTransport(service_url); ht.debug = true; TimerTask task = new TimerTask() { public void run() { ht.reset(); } }; try { new Timer().schedule(task, CustomDialogLogin.TIMEOUT_LIST); ht.call(soap_action, envelope); try { Object myObj = (Object) envelope.getResponse(); list = sv.toArray(myObj.toString(), bean); } catch (Exception e) { System.out.println(e.toString()); } task.cancel(); } catch (Exception ex) { throw new RuntimeException(ProccessMethods.getErrorMessage(ex)); } return list; } public Task TaskInfo(int task_id) { SetValue sv = new SetValue(); Task tsk = new Task(); method = "TaskInfo"; if (DeviceInfo.isSimulator()) { service_url = service_url + ";deviceSide=true"; } soap_action = service_namespace + method; SoapObject request = new SoapObject(service_namespace, method); request.addProperty("task_id", task_id + ""); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope( SoapEnvelope.VER11); envelope.headerOut = ConfirmMethods.setHeaderOut(); envelope.bodyOut = request; envelope.dotNet = true; envelope.encodingStyle = SoapSerializationEnvelope.ENC2001; envelope.addMapping(service_namespace + "encodedTypes", "Task", new Task().getClass()); envelope.setOutputSoapObject(request); ht = new HttpTransport(service_url); ht.debug = true; TimerTask task = new TimerTask() { public void run() { ht.reset(); } }; try { new Timer().schedule(task, CustomDialogLogin.TIMEOUT_SIMPLE); ht.call(soap_action, envelope); try { Object myObj = (Object) envelope.getResponse(); tsk = (Task) sv.toBean(myObj.toString(), bean); } catch (Exception e) { System.out.println(e.toString()); } task.cancel(); } catch (Exception ex) { throw new RuntimeException(ProccessMethods.getErrorMessage(ex)); } return tsk; } public boolean AddTask(String task_name, String description, int duration, String begin_date, String end_date, String comment, int project_id, int member_id, int priority_id, int status_id) { method = "AddTask"; if (DeviceInfo.isSimulator()) { service_url = service_url + ";deviceSide=true"; } soap_action = service_namespace + method; SoapObject request = new SoapObject(service_namespace, method); request.addProperty("task_name", task_name); request.addProperty("description", description); request.addProperty("duration", duration + ""); request.addProperty("begin_date", begin_date); request.addProperty("end_date", end_date); request.addProperty("comment", comment); request.addProperty("project_id", project_id + ""); request.addProperty("member_id", member_id + ""); request.addProperty("priority_id", priority_id + ""); request.addProperty("status_id", status_id + ""); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope( SoapEnvelope.VER11); envelope.headerOut = ConfirmMethods.setHeaderOut(); envelope.bodyOut = request; envelope.dotNet = true; envelope.encodingStyle = SoapSerializationEnvelope.ENC2001; envelope.setOutputSoapObject(request); ht = new HttpTransport(service_url); ht.debug = true; TimerTask task = new TimerTask() { public void run() { ht.reset(); } }; try { new Timer().schedule(task, CustomDialogLogin.TIMEOUT_SIMPLE); ht.call(soap_action, envelope); String myObj = envelope.getResponse().toString(); task.cancel(); if (myObj.equals("true")) return true; else return false; } catch (Exception ex) { throw new RuntimeException(ProccessMethods.getErrorMessage(ex)); } } public boolean UpdateTask(int task_id, String task_name, String description, int duration, String begin_date, String end_date, String comment, int project_id, int member_id, int priority_id, int status_id) { method = "UpdateTask"; if (DeviceInfo.isSimulator()) { service_url = service_url + ";deviceSide=true"; } soap_action = service_namespace + method; SoapObject request = new SoapObject(service_namespace, method); request.addProperty("task_id", task_id + ""); request.addProperty("task_name", task_name); request.addProperty("description", description); request.addProperty("duration", duration + ""); request.addProperty("begin_date", begin_date); request.addProperty("end_date", end_date); request.addProperty("comment", comment); request.addProperty("project_id", project_id + ""); request.addProperty("member_id", member_id + ""); request.addProperty("priority_id", priority_id + ""); request.addProperty("status_id", status_id + ""); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope( SoapEnvelope.VER11); envelope.headerOut = ConfirmMethods.setHeaderOut(); envelope.bodyOut = request; envelope.dotNet = true; envelope.encodingStyle = SoapSerializationEnvelope.ENC2001; envelope.setOutputSoapObject(request); ht = new HttpTransport(service_url); ht.debug = true; TimerTask task = new TimerTask() { public void run() { ht.reset(); } }; try { new Timer().schedule(task, CustomDialogLogin.TIMEOUT_SIMPLE); ht.call(soap_action, envelope); String myObj = envelope.getResponse().toString(); task.cancel(); if (myObj.equals("true")) return true; else return false; } catch (Exception ex) { throw new RuntimeException(ProccessMethods.getErrorMessage(ex)); } } public boolean DelTask(int task_id) { method = "DelTask"; if (DeviceInfo.isSimulator()) { service_url = service_url + ";deviceSide=true"; } soap_action = service_namespace + method; SoapObject request = new SoapObject(service_namespace, method); request.addProperty("task_id", task_id + ""); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope( SoapEnvelope.VER11); envelope.headerOut = ConfirmMethods.setHeaderOut(); envelope.bodyOut = request; envelope.dotNet = true; envelope.encodingStyle = SoapSerializationEnvelope.ENC2001; envelope.setOutputSoapObject(request); ht = new HttpTransport(service_url); ht.debug = true; TimerTask task = new TimerTask() { public void run() { ht.reset(); } }; try { new Timer().schedule(task, CustomDialogLogin.TIMEOUT_SIMPLE); ht.call(soap_action, envelope); String myObj = envelope.getResponse().toString(); task.cancel(); if (myObj.equals("true")) return true; else return false; } catch (Exception ex) { throw new RuntimeException(ProccessMethods.getErrorMessage(ex)); } } public int[] taskCount(int project_id, int segment, boolean finish) { TaskManagement tm = new TaskManagement(); ProjectManagement pm = new ProjectManagement(); Vector vt = new Vector(); Project proj = new Project(); try { vt = tm.ListTask(project_id, ""); proj = pm.ProjectInfo(project_id); } catch (RuntimeException e) { throw new RuntimeException( "Web Service Connection Error!"); } DateField endDateProj = new DateField(); if (!finish) endDateProj = ProccessMethods.dateConvert(proj.getEnd_date()); else endDateProj.setDate(System.currentTimeMillis()); DateField beginDateProj = ProccessMethods.dateConvert(proj .getBegin_date()); DateField incDate; int projDuration; if (!finish) projDuration = proj.getDuration(); else projDuration = ProccessMethods.dateSubtract(endDateProj, beginDateProj); int pointSegment; int[] tempTaskCount; DateField[] segmentArray; Task task; boolean done; int count; pointSegment = projDuration / segment; if (projDuration % segment != 0) pointSegment++; pointSegment++; segmentArray = new DateField[pointSegment]; incDate = beginDateProj; segmentArray[0] = beginDateProj; for (int i = 1; i < segmentArray.length - 1; i++) { segmentArray[i] = ProccessMethods.plusDate(incDate, segment); incDate = ProccessMethods.plusDate(incDate, segment); } segmentArray[segmentArray.length - 1] = ProccessMethods.plusDate( endDateProj, 1); tempTaskCount = new int[pointSegment - 1]; for (int i = 0; i < vt.size(); i++) { task = new Task(); task = (Task) vt.elementAt(i); done = false; count = 0; incDate = ProccessMethods.dateConvert(task.getEnd_date()); if (!finish || (task.getStatus_id() == 1)) while (!done && (count < tempTaskCount.length)) { count++; if (((ProccessMethods.dateCompare(segmentArray[count - 1], incDate) == 0) || (ProccessMethods.dateCompare( segmentArray[count - 1], incDate) == -1)) && (ProccessMethods.dateCompare( segmentArray[count], incDate) == 1)) { done = true; tempTaskCount[count - 1]++; } } } return tempTaskCount; } } 3.3.3. Lớp quản lý những vấn đề trong thời gian làm dự án public class ProjectIssueManagement { private String bean = "Project_issue"; private String service_url = ConnectString.SERVICE_URL; private String service_namespace = ConnectString.SERVICE_NAMESPACE; private String soap_action = ""; private String method = ""; HttpTransport ht; public Vector ListProjIssue(int project_id, String keyword) { SetValue sv = new SetValue(); Vector list = new Vector(); method = "ListProjIssue"; if (DeviceInfo.isSimulator()) { service_url = service_url + ";deviceSide=true"; } soap_action = service_namespace + method; SoapObject request = new SoapObject(service_namespace, method); request.addProperty("project_id", project_id + ""); request.addProperty("keyword", keyword); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope( SoapEnvelope.VER11); envelope.headerOut = ConfirmMethods.setHeaderOut(); envelope.bodyOut = request; envelope.dotNet = true; envelope.encodingStyle = SoapSerializationEnvelope.ENC2001; envelope.addMapping(service_namespace + "encodedTypes", "Project_issue", new Project_issue().getClass()); envelope.setOutputSoapObject(request); ht = new HttpTransport(service_url); ht.debug = true; TimerTask task = new TimerTask() { public void run() { ht.reset(); } }; try { new Timer().schedule(task, CustomDialogLogin.TIMEOUT_LIST); ht.call(soap_action, envelope); try { Object myObj = (Object) envelope.getResponse(); list = sv.toArray(myObj.toString(), bean); } catch (Exception e) { System.out.println(e.toString()); } task.cancel(); } catch (Exception ex) { throw new RuntimeException(ProccessMethods.getErrorMessage(ex)); } return list; } public Project_issue ProjIssueInfo(int project_issue_id) { SetValue sv = new SetValue(); Project_issue proj_issue = new Project_issue(); method = "ProjIssueInfo"; if (DeviceInfo.isSimulator()) { service_url = service_url + ";deviceSide=true"; } soap_action = service_namespace + method; SoapObject request = new SoapObject(service_namespace, method); request.addProperty("project_issue_id", project_issue_id + ""); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope( SoapEnvelope.VER11); envelope.headerOut = ConfirmMethods.setHeaderOut(); envelope.bodyOut = request; envelope.dotNet = true; envelope.encodingStyle = SoapSerializationEnvelope.ENC2001; envelope.addMapping(service_namespace + "encodedTypes", "Project_issue", new Project_issue().getClass()); envelope.setOutputSoapObject(request); ht = new HttpTransport(service_url); ht.debug = true; TimerTask task = new TimerTask() { public void run() { ht.reset(); } }; try { new Timer().schedule(task, CustomDialogLogin.TIMEOUT_SIMPLE); ht.call(soap_action, envelope); try { Object myObj = (Object) envelope.getResponse(); proj_issue = (Project_issue) sv.toBean(myObj.toString(), bean); } catch (Exception e) { System.out.println(e.toString()); } task.cancel(); } catch (Exception ex) { throw new RuntimeException(ProccessMethods.getErrorMessage(ex)); } return proj_issue; } public boolean AddProjIssue(String project_issue_name, String description, String occur_date, String treatment_date, int duration, String comment, int project_id, int priority_id, int status_id, int member_id) { method = "AddProjIssue"; if (DeviceInfo.isSimulator()) { service_url = service_url + ";deviceSide=true"; } soap_action = service_namespace + method; SoapObject request = new SoapObject(service_namespace, method); request.addProperty("project_issue_name", project_issue_name); request.addProperty("description", description); request.addProperty("occur_date", occur_date); request.addProperty("treatment_date", treatment_date); request.addProperty("duration", duration + ""); request.addProperty("comment", comment); request.addProperty("project_id", project_id + ""); request.addProperty("priority_id", priority_id + ""); request.addProperty("status_id", status_id + ""); request.addProperty("member_id", member_id + ""); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope( SoapEnvelope.VER11); envelope.headerOut = ConfirmMethods.setHeaderOut(); envelope.bodyOut = request; envelope.dotNet = true; envelope.encodingStyle = SoapSerializationEnvelope.ENC2001; envelope.setOutputSoapObject(request); ht = new HttpTransport(service_url); ht.debug = true; TimerTask task = new TimerTask() { public void run() { ht.reset(); } }; try { new Timer().schedule(task, CustomDialogLogin.TIMEOUT_SIMPLE); ht.call(soap_action, envelope); String myObj = envelope.getResponse().toString(); task.cancel(); if (myObj.equals("true")) return true; else return false; } catch (Exception ex) { throw new RuntimeException(ProccessMethods.getErrorMessage(ex)); } } public boolean UpdateProjIssue(int project_issue_id, String project_issue_name, String description, String occur_date, String treatment_date, int duration, String comment, int project_id, int priority_id, int status_id, int member_id) { method = "UpdateProjIssue"; if (DeviceInfo.isSimulator()) { service_url = service_url + ";deviceSide=true"; } soap_action = service_namespace + method; SoapObject request = new SoapObject(service_namespace, method); request.addProperty("project_issue_id", project_issue_id + ""); request.addProperty("project_issue_name", project_issue_name); request.addProperty("description", description); request.addProperty("occur_date", occur_date); request.addProperty("treatment_date", treatment_date); request.addProperty("duration", duration + ""); request.addProperty("comment", comment); request.addProperty("project_id", project_id + ""); request.addProperty("priority_id", priority_id + ""); request.addProperty("status_id", status_id + ""); request.addProperty("member_id", member_id + ""); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope( SoapEnvelope.VER11); envelope.headerOut = ConfirmMethods.setHeaderOut(); envelope.bodyOut = request; envelope.dotNet = true; envelope.encodingStyle = SoapSerializationEnvelope.ENC2001; envelope.setOutputSoapObject(request); ht = new HttpTransport(service_url); ht.debug = true; TimerTask task = new TimerTask() { public void run() { ht.reset(); } }; try { new Timer().schedule(task, CustomDialogLogin.TIMEOUT_SIMPLE); ht.call(soap_action, envelope); String myObj = envelope.getResponse().toString(); task.cancel(); if (myObj.equals("true")) return true; else return false; } catch (Exception ex) { throw new RuntimeException(ProccessMethods.getErrorMessage(ex)); } } public boolean DelProjIssue(int project_issue_id) { method = "DelProjIssue"; if (DeviceInfo.isSimulator()) { service_url = service_url + ";deviceSide=true"; } soap_action = service_namespace + method; SoapObject request = new SoapObject(service_namespace, method); request.addProperty("project_issue_id", project_issue_id + ""); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope( SoapEnvelope.VER11); envelope.headerOut = ConfirmMethods.setHeaderOut(); envelope.bodyOut = request; envelope.dotNet = true; envelope.encodingStyle = SoapSerializationEnvelope.ENC2001; envelope.setOutputSoapObject(request); ht = new HttpTransport(service_url); ht.debug = true; TimerTask task = new TimerTask() { public void run() { ht.reset(); } }; try { new Timer().schedule(task, CustomDialogLogin.TIMEOUT_SIMPLE); ht.call(soap_action, envelope); String myObj = envelope.getResponse().toString(); task.cancel(); if (myObj.equals("true")) return true; else return false; } catch (Exception ex) { throw new RuntimeException(ProccessMethods.getErrorMessage(ex)); } } } 3.3.4. Lớp quản lý thành viên Là lớp tương tác với webservice để lấy thông tin về những thành viên thuộc đội dự án: public class MemberManagement { private String bean = "Member"; private String service_url = ConnectString.SERVICE_URL; private String service_namespace = ConnectString.SERVICE_NAMESPACE; private String soap_action = ""; private String method = ""; private HttpTransport ht; public Vector ListMember(int project_id, String keyword) { SetValue sv = new SetValue(); Vector list = new Vector(); method = "ListMember"; if (DeviceInfo.isSimulator()) { service_url = service_url + ";deviceSide=true"; } soap_action = service_namespace + method; SoapObject request = new SoapObject(service_namespace, method); request.addProperty("project_id", project_id + ""); request.addProperty("keyword", keyword); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope( SoapEnvelope.VER11); envelope.headerOut = ConfirmMethods.setHeaderOut(); envelope.bodyOut = request; envelope.dotNet = true; envelope.encodingStyle = SoapSerializationEnvelope.ENC2001; envelope.addMapping(service_namespace+ "encodedTypes", "Member", new Member().getClass()); envelope.setOutputSoapObject(request); ht = new HttpTransport(service_url); ht.debug = true; TimerTask task = new TimerTask() { public void run() { ht.reset(); } }; try { new Timer().schedule(task, CustomDialogLogin.TIMEOUT_LIST); ht.call(soap_action, envelope); try { Object myObj = (Object) envelope.getResponse(); list = sv.toArray(myObj.toString(), bean); } catch (Exception e) { System.out.println(e.toString()); } task.cancel(); } catch (Exception ex) { throw new RuntimeException(ProccessMethods.getErrorMessage(ex)); } return list; } public Member MemberInfo(int member_id) { SetValue sv = new SetValue(); Member mem = new Member(); method = "MemberInfo"; if (DeviceInfo.isSimulator()) { service_url = service_url + ";deviceSide=true"; } soap_action = service_namespace + method; SoapObject request = new SoapObject(service_namespace, method); request.addProperty("member_id", member_id + ""); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope( SoapEnvelope.VER11); envelope.headerOut = ConfirmMethods.setHeaderOut(); envelope.bodyOut = request; envelope.dotNet = true; envelope.encodingStyle = SoapSerializationEnvelope.ENC2001; envelope.addMapping(service_namespace+ "encodedTypes", "Member", new Member().getClass()); envelope.setOutputSoapObject(request); ht = new HttpTransport(service_url); ht.debug = true; TimerTask task = new TimerTask() { public void run() { ht.reset(); } }; try { new Timer().schedule(task, CustomDialogLogin.TIMEOUT_SIMPLE); ht.call(soap_action, envelope); try { Object myObj = (Object) envelope.getResponse(); mem = (Member) sv.toBean(myObj.toString(), bean); } catch (Exception e) { System.out.println(e.toString()); } task.cancel(); } catch (Exception ex) { throw new RuntimeException(ProccessMethods.getErrorMessage(ex)); } return mem; } public boolean AddMember(String member_name, String email, String skype, String phone, int project_id, int poition_id) { method = "AddMember"; if (DeviceInfo.isSimulator()) { service_url = service_url + ";deviceSide=true"; } soap_action = service_namespace + method; SoapObject request = new SoapObject(service_namespace, method); request.addProperty("member_name", member_name); request.addProperty("email", email); request.addProperty("skype", skype + ""); request.addProperty("phone", phone); request.addProperty("project_id", project_id + ""); request.addProperty("poition_id", poition_id + ""); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope( SoapEnvelope.VER11); envelope.headerOut = ConfirmMethods.setHeaderOut(); envelope.bodyOut = request; envelope.dotNet = true; envelope.encodingStyle = SoapSerializationEnvelope.ENC2001; envelope.setOutputSoapObject(request); ht = new HttpTransport(service_url); ht.debug = true; TimerTask task = new TimerTask() { public void run() { ht.reset(); } }; try { new Timer().schedule(task, CustomDialogLogin.TIMEOUT_SIMPLE); ht.call(soap_action, envelope); String myObj = envelope.getResponse().toString(); task.cancel(); if (myObj.equals("true")) return true; else return false; } catch (Exception ex) { throw new RuntimeException(ProccessMethods.getErrorMessage(ex)); } } public boolean UpdateMember(int member_id, String member_name, String email, String skype, String phone, int project_id, int poition_id) { method = "UpdateMember"; if (DeviceInfo.isSimulator()) { service_url = service_url + ";deviceSide=true"; } soap_action = service_namespace + method; SoapObject request = new SoapObject(service_namespace, method); request.addProperty("member_id", member_id + ""); request.addProperty("member_name", member_name); request.addProperty("email", email); request.addProperty("skype", skype); request.addProperty("phone", phone); request.addProperty("project_id", project_id + ""); request.addProperty("poition_id", poition_id + ""); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope( SoapEnvelope.VER11); envelope.headerOut = ConfirmMethods.setHeaderOut(); envelope.bodyOut = request; envelope.dotNet = true; envelope.encodingStyle = SoapSerializationEnvelope.ENC2001; envelope.setOutputSoapObject(request); ht = new HttpTransport(service_url); ht.debug = true; TimerTask task = new TimerTask() { public void run() { ht.reset(); } }; try { new Timer().schedule(task, CustomDialogLogin.TIMEOUT_SIMPLE); ht.call(soap_action, envelope); String myObj = envelope.getResponse().toString(); task.cancel(); if (myObj.equals("true")) return true; else return false; } catch (Exception ex) { throw new RuntimeException(ProccessMethods.getErrorMessage(ex)); } } public boolean DelMember(int member_id) { method = "DelMember"; if (DeviceInfo.isSimulator()) { service_url = service_url + ";deviceSide=true"; } soap_action = service_namespace + method; SoapObject request = new SoapObject(service_namespace, method); request.addProperty("member_id", member_id + ""); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope( SoapEnvelope.VER11); envelope.headerOut = ConfirmMethods.setHeaderOut(); envelope.bodyOut = request; envelope.dotNet = true; envelope.encodingStyle = SoapSerializationEnvelope.ENC2001; envelope.setOutputSoapObject(request); ht = new HttpTransport(service_url); ht.debug = true; TimerTask task = new TimerTask() { public void run() { ht.reset(); } }; try { new Timer().schedule(task, CustomDialogLogin.TIMEOUT_SIMPLE); ht.call(soap_action, envelope); String myObj = envelope.getResponse().toString(); task.cancel(); if (myObj.equals("true")) return true; else return false; } catch (Exception ex) { throw new RuntimeException(ProccessMethods.getErrorMessage(ex)); } } } 3.4. TỔNG KẾT CHƯƠNG III Trong chương III, tôi đã giới thiệu về ứng dụng bProjectManage, một ứng dụng quản lý dự án cho điện thoại BlackBerry. Các chức năng chính của ứng dung, các lớp thực hiện các chức năng trên cũng đã được tôi giới thiệu trong chương này. KẾT LUẬN Như đã nêu, đồ án trình bày về một ứng dụng quản lý cho thiết bị di động cụ thể ở đây là điện thoại BlackBerry. Đây là dòng sản phẩm có hỗ trợ về mạng tốt nhất trong tất cả các dòng di động khác. Đồ án đã tập trung nghiên cứu các vấn đề liên quan như sau: Chương 1 đã đưa ra cái nhìn tổng quan về đề tài, lý do chọn đề tài và mục đích của đề tài. Chương 2 đã đưa ra những cơ sở lý thuyết để tham khảo như các nền tảng mobile phổ biến hiện nay, giới thiệu về J2ME ngôn ngữ được sử dụng để làm nên sản phẩm mô phỏng và những cở sở lý thuyết được sử dụng trong đề tài này như các công cụ lập trình, cách tạo một ứng dụng và cách làm việc với các thành phần giao diện của ứng dụng BlackBerry. Chương 3 đưa ra ứng dụng bProjectManage dùng để mô phỏng cho đề tài và các đoạn mã lệnh chính của ứng dụng. Qua quá trình làm tôi đã rút ra được những ưu điểm và nhược điểm của đồ án như sau: Ưu điểm, đồ án đã đưa ra một hướng nghiên cứu mới hiện nay đó là lập trình ứng dụng cho thiết bị di động. Trong đồ án này thiết bị cụ thể được dùng để mô phỏng đó là BlackBerry. Đồ án cũng đã trình bày rất kỹ về các cơ sở lý thuyết để sử dụng trong thực tiễn. Nhược điểm, do đề tài này quá lớn và có quá nhiều vấn đề nghiên cứu mà thời gian để thực hiện còn hạn chế nên đề tài chưa đạt được kết quả tốt nhất. Từ những ưu và nhược điểm trên hướng nghiên cứu tiếp theo của để tài là: Thứ nhất, hoàn thiện các chức năng đã làm được của ứng dụng để có thể đưa vào sử dụng thực tế. Thứ hai, khắc phục nhược điểm của ứng dụng cụ thể ở đây là cơ sở dữ liệu của ứng dụng. TÀI LIỆU THAM KHẢO [1] Anthony Rizk, Beginning BlackBerry Development [2] Kim Topley, J2ME in a Nutshell [3] Chris King, Advanced BlackBerry Development [4] BlackBerry Guidline, BlackBerry Java Development Environment, Version: 4.6.0 [5] Matthew MacDonald, Beginning ASP.NET 3.5 in C# 2008: From Novice to Professional, Second Edition [6] Rob Cameron, Dale Michalk, Pro ASP.NET 3.5 Server Controls and AJAX Components

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

  • docQuản lý dự án trên blackbery.doc