1.小組成員:
邢路 163班 1600802098: https://www.cnblogs.com/xinglu1600802098/
覃朗 163班 1600802105:https://www.cnblogs.com/WildFrontier/
唐梵 163班 1600802095:https://www.cnblogs.com/TF2095/
2.APK下載地址:
另附:
2.Android文件夾為本項目的后台部分,是eclipse創建的項目,不能直接部署到tomcat服務器。
3.后台已經部署到騰訊雲服務器上,IP為

4.2234Job文件夾為安卓項目,SDK版本為28。
3.項目地址:
安卓項目:https://coding.net/u/XL_1600802098/p/Android/git
Servlet后台:https://git.coding.net/XL_1600802098/Android_Servlet.git
4.1團隊項目的總體效果截圖:
首頁:
登錄及注冊頁面:
發布信息頁面:
個人信息頁面:
推薦頁面:
錄屏效果鏈接:
https://pan.baidu.com/s/17xL6sQp6BuUGfpzGah5VCg
4.2 實現的功能及其效果的描述
項目名稱:2234招聘網
簡介:一個人才信息招聘app,該項目想法來源於我們本學期的創新創業課程,該項目獲得了創新創業課程的優秀項目。因此借此次安卓課程的學習我們將該項目實現。
功能介紹:(1)實現登錄、注冊的功能。
(2)登錄后使用者有兩種角色,招聘者和求職者,可以在app中的個人信息頁面自由切換。
(3)求職者可以發布求職信息,在推薦一欄中瀏覽招聘者發布的招聘信息。招聘者可以發布招聘信息,在推薦一欄中瀏覽求職者發布的求職信息。其中學歷、性別和年 齡需求在點擊后可以出現相應的選項,便於求職者與招聘者明確信息。
(4)在推薦一欄中同時顯示了招聘者與求職者的信息,包括職位、學歷、年齡、工作年限、薪水等等。
5.關鍵代碼
鏈接數據庫:
if (userStatus.equals("Applicant")) { Thread t = new Thread() { //運行子線程 @Override public void run() { @SuppressWarnings("deprecation") String path = "http://118.24.132.157:8080/Android/GetApplicantInfo"; try { URL url = new URL(path); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setRequestMethod("POST"); conn.setConnectTimeout(2000); conn.setReadTimeout(2000); if (conn.getResponseCode() == 200) { InputStream is = conn.getInputStream(); String text = Util.getTextFromStream(is); Message msg = handler_interviewer.obtainMessage(); msg.obj = text; handler_interviewer.sendMessage(msg); flag = true; destroy(); } } catch (Exception e) { e.printStackTrace(); } } }; t.start(); while(true){ if(flag){ setContentView(R.layout.recommend_get); listView = (ListView) findViewById(R.id.recommend_list); ApplicantAdapter adapter = new ApplicantAdapter(RecommendActivity.this, R.layout.recommend_interviewer, applicantList); listView.setAdapter(adapter); break; } } }
處理json數據
private Handler handler_interviewer = new Handler(){ public void handleMessage(Message msg){ //獲得消息中攜帶的數據 String data = (String) msg.obj; MyJSONObjection myJson = null; try { JSONObject json = new JSONObject(data); int size = json.getInt("size"); for(int i = 1;i<=size;i++){ //每條json數據都轉換成實例保存到List中 JSONObject line = json.getJSONObject(Integer.toString(i)); ApplicantInfo info = new ApplicantInfo(); try { myJson = new MyJSONObjection(line.toString()); } catch (Exception e) { e.printStackTrace(); } try { info = (ApplicantInfo) myJson.getBean(ApplicantInfo.class); applicantList.add(info); } catch (Exception e) { e.printStackTrace(); } } } catch (JSONException e) { e.printStackTrace(); } } };
存儲用戶登錄信息:
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setCharacterEncoding("utf-8"); response.setContentType("text/html; charset=utf-8"); Connection conn =null; Statement stmt = null; ResultSet rs = null; try { String url = "jdbc:mysql://localhost:3306/android?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=UTF-8"; String dbuser = "root"; String dbpass ="root"; Class.forName("com.mysql.jdbc.Driver"); conn = DriverManager.getConnection(url,dbuser,dbpass); StringBuffer sql = new StringBuffer(200); sql.append("select * from applicant "); stmt = conn.createStatement(); rs = stmt.executeQuery(sql.toString()); //List<ApplicantInfo> applicantList= new ArrayList<ApplicantInfo>(); JSONObject responseJson = new JSONObject(); int i = 1; while(rs.next()) { ApplicantInfo info = new ApplicantInfo(); info.setUsername(rs.getString(1)); info.setWantpositon(rs.getString(2)); info.setWantplace(rs.getString(3)); info.setEdulevel (rs.getString(4)); info.setWantyear(rs.getString(5)); info.setWantjobnature(rs.getString(6)); info.setWantsex(rs.getString(7)); info.setWantage(rs.getString(8)); info.setWantprossional(rs.getString(9)); responseJson.put(i, info); i++; } responseJson.put("size", i); PrintWriter pw = response.getWriter(); pw.write(responseJson.toString()); pw.flush(); pw.close(); return ; }catch (Exception e) { e.printStackTrace(); }finally { try { if (stmt != null) stmt.close(); }catch (Exception e1) { } try { if (conn != null) conn.close(); }catch (Exception e1) {e1.getMessage();}} } }
數據庫截圖:
6.對其他組APK的評價
1)許宇偉組:小游戲
總結:模式簡潔,圖標有一定創意。
優點:操作簡潔方便。
缺點:玩法過於單一。
我組建議:增加游戲模式與難度選擇,改換美工風格。
2)韓璐組:音樂播放器
總結:基礎功能較全,美工出眾。
優點:美工出眾。
缺點:缺少滾動歌詞。
我組建議:完善功能。
3)洪居興組旅游攻略
總結:洪居興組旅游攻略本實現了旅游攻略的基本功能,登錄注冊,手機驗證,攻略查看等,功能完備。
優點:界面十分美觀,能使用手機驗證碼進行驗證。
缺點:雖然十分貼近生活,極有用處,但同類APP已有很多,需要增加一些自己的創新功能,能夠吸引用戶。
我組建議:增加一些自己的創新功能,用以吸引用戶。
4)李凱組:打卡
總結:樣式極簡,功能全面。
優點:功能全面,添加計划,計算時間與 進度。
缺點:界面單一,只有日夜間模式。
我組建議:增加更多的主題界面,提高用戶體驗。
5)5.劉宇瑩組
描述:功能齊全,用戶友好。
優點:功能齊全:登錄、注冊,瀏覽物品、管理拍賣物品。
缺點:沒有物品的詳細信息。
我組建議:加上物品的更詳細的信息,讓用戶可以了解更多的關於物品的信息。
7.
以下問題為團隊成員個人認為棘手的問題:
1) 同時在安裝apk的時候也出現了一個這個錯誤。android installation failed with message invalid通過查詢網上的建議,找到了解決方案:
1.點擊工具欄上的Build中的Clean Project
2.再點擊工具欄上的Build中的Rebulid Projec
2)開發的時候突然出現仿真器卡死的情況,反復重啟會彈出如下的提示:
Guest isn’t online after 7 seconds, retrying ADB connections
經過檢驗發現需要手動在Tools-->AVD Manager-->相應虛擬機-->Boot Code Now
3)啟動虛擬機后,點擊按鈕閃退。經過反復校驗發現是由於調用函數時參數未初始化導致相應模板無法加載。
4)ScrollView無法顯示所有的TextView,原因是底端的LinearLayout覆蓋住了最后一個TextView,需要在ScrollView中添加android:layout_above="@+id/(LinearLayout的id)"個才能使LinearLayout不覆蓋住ScrollView的內容
5)繼承JSONObject寫了一個MyJSONObjection類 ,在將json轉換成對象的過程中,需要獲取對象的屬性個數,測試時報錯拋出空指針錯誤,DEBUG發現$change為空,原來fs數組中除了對象的屬性還多出兩個屬性。
解決:由於不知道這兩個屬性是干嘛用的,這里使用了投機取巧的方法,將for循環的次數減去2,結果成功。
8.團隊分工
姓名 | 分工 | 工作比例 | 得分(10) |
邢路 | 后台服務器、數據庫。 功能實現:登錄、注冊、推薦 | 40% | 4 |
覃朗 | 功能實現:主頁、發布、我的信息 | 30% | 3 |
唐梵 | UI、前端 | 30% | 3 |