/[projects]/android/CheckUpdates/src/dk/thoerup/checkupdates/CheckUpdates.java
ViewVC logotype

Diff of /android/CheckUpdates/src/dk/thoerup/checkupdates/CheckUpdates.java

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

revision 720 by torben, Mon May 10 19:35:14 2010 UTC revision 721 by torben, Mon May 10 19:45:11 2010 UTC
# Line 76  public class CheckUpdates { Line 76  public class CheckUpdates {
76                  int newestVersion = 0;                  int newestVersion = 0;
77    
78                  @Override                  @Override
79                  protected Void doInBackground(String... arg0) {                  protected Void doInBackground(String... arg0) {                
80                          String requestUrl = arg0[0] + "?version=" + versionName + "&phone=" + phone_model + "&android=" + androidVersion;                          String requestUrl = arg0[0] + "?version=" + encode(versionName) + "&phone=" + encode(phone_model) + "&android=" + encode(androidVersion);
81                          try {                          try {
82                                  URL url = new URL(requestUrl);                                  URL url = new URL(requestUrl);
83                                  URLConnection conn = url.openConnection();                                  URLConnection conn = url.openConnection();
# Line 96  public class CheckUpdates { Line 96  public class CheckUpdates {
96                          return null;                          return null;
97                  }                  }
98                                    
99                    private String encode(String data) {
100                            try {
101                                    return java.net.URLEncoder.encode(data, "UTF-8");
102                            } catch (Exception e) {
103                                    return data; //if encoding fails, return original and hope all goes well
104                            }
105                    }
106                    
107                  private String readIOStream(InputStream in) throws IOException {                  private String readIOStream(InputStream in) throws IOException {
108                          ByteArrayOutputStream baos = new ByteArrayOutputStream();                          ByteArrayOutputStream baos = new ByteArrayOutputStream();
109                                                    

Legend:
Removed from v.720  
changed lines
  Added in v.721

  ViewVC Help
Powered by ViewVC 1.1.20