/[projects]/android/TrainInfoService/WebContent/version.jsp
ViewVC logotype

Diff of /android/TrainInfoService/WebContent/version.jsp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1599 by torben, Thu Sep 22 15:21:15 2011 UTC revision 1600 by torben, Fri Sep 23 10:07:22 2011 UTC
# Line 24  BufferedReader in = new BufferedReader( Line 24  BufferedReader in = new BufferedReader(
24    
25  Map<String,Integer> versions = new TreeMap<String,Integer>();  Map<String,Integer> versions = new TreeMap<String,Integer>();
26  Map<String,Integer> phones = new TreeMap<String,Integer>();  Map<String,Integer> phones = new TreeMap<String,Integer>();
27    Map<String,Integer> androids = new TreeMap<String,Integer>();
28    
29  String line;  String line;
30  while ( (line=in.readLine()) != null) {  while ( (line=in.readLine()) != null) {
# Line 31  while ( (line=in.readLine()) != null) { Line 32  while ( (line=in.readLine()) != null) {
32                  continue;                  continue;
33          String version = "";          String version = "";
34          String phone = "";          String phone = "";
35            String android = "";
36    
37          String parts[] = line.split(" ");          String parts[] = line.split(" ");
38    
39          if (parts.length >= 8) {                          if (parts.length >= 8) {                
40                  String uri = parts[7];                  String uri = parts[7];
41                  Map<String,String> params = HttpUtil.decodeUri(uri);                  Map<String,String> params = HttpUtil.decodeUri(uri);
42    
43                  String tmpVer = params.get("version");                  String tmpVer = params.get("version");
                   
                 if (tmpVer != null)  
                         version = tmpVer;  
                   
44                  String tmpPhone = params.get("phone");                  String tmpPhone = params.get("phone");
45                  String tmpAndroid = params.get("android");                  String tmpAndroid = params.get("android");
46                  if (tmpPhone != null && tmpAndroid != null)                  
47                          phone = tmpPhone + " " + tmpAndroid;                  if (tmpVer != null)
48                            version = tmpVer;              
49                    if (tmpPhone != null)
50                            phone = tmpPhone;
51                    if (tmpAndroid != null)
52                            android = tmpAndroid;  
53          }          }
54                    
55          Integer count = versions.get(version);          Integer count = versions.get(version);
# Line 57  while ( (line=in.readLine()) != null) { Line 62  while ( (line=in.readLine()) != null) {
62                  count = 0;                  count = 0;
63          phones.put(phone, count+1);          phones.put(phone, count+1);
64                                    
65            count = androids.get(android);
66            if (count == null)
67                    count = 0;
68            androids.put(android, count+1);
69                    
70  }  }
71    
72  %>  %>
# Line 78  for (String key : versions.keySet()) { Line 88  for (String key : versions.keySet()) {
88  %>  %>
89  </table>  </table>
90    
91  <h2>Phones / Android ver.</h2>  <h2>Phones</h2>
92  <table border='0'>  <table border='0'>
93  <%  <%
94  for (String key : phones.keySet()) {  for (String key : phones.keySet()) {
# Line 89  for (String key : phones.keySet()) { Line 99  for (String key : phones.keySet()) {
99  }  }
100  %>  %>
101  </table>  </table>
102    
103    <h2>Android ver.</h2>
104    <table border='0'>
105    <%
106    for (String key : androids.keySet()) {
107            int val = phones.get(key);
108            %>
109            <tr><td><%=key%></td><td align='right'><%= val %></td></tr>
110            <%
111    }
112    %>
113    </table>
114    
115  </body>  </body>
116  </html>  </html>
117    

Legend:
Removed from v.1599  
changed lines
  Added in v.1600

  ViewVC Help
Powered by ViewVC 1.1.20