Project

General

Profile

Download (15.4 KB) Statistics
| Branch: | Tag: | Revision:

magiccube / src / main / java / org / distorted / scores / RubikScoresDownloader.java @ a4259b7f

1 fdec60a3 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
2
// Copyright 2019 Leszek Koltunski                                                               //
3
//                                                                                               //
4
// This file is part of Magic Cube.                                                              //
5
//                                                                                               //
6
// Magic Cube is free software: you can redistribute it and/or modify                            //
7
// it under the terms of the GNU General Public License as published by                          //
8
// the Free Software Foundation, either version 2 of the License, or                             //
9
// (at your option) any later version.                                                           //
10
//                                                                                               //
11
// Magic Cube is distributed in the hope that it will be useful,                                 //
12
// but WITHOUT ANY WARRANTY; without even the implied warranty of                                //
13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                 //
14
// GNU General Public License for more details.                                                  //
15
//                                                                                               //
16
// You should have received a copy of the GNU General Public License                             //
17
// along with Magic Cube.  If not, see <http://www.gnu.org/licenses/>.                           //
18
///////////////////////////////////////////////////////////////////////////////////////////////////
19
20 f0e87514 Leszek Koltunski
package org.distorted.scores;
21 fdec60a3 Leszek Koltunski
22 1780dcb0 Leszek Koltunski
import android.content.pm.PackageInfo;
23
import android.content.pm.PackageManager;
24
25 66e777b0 Leszek Koltunski
import androidx.fragment.app.FragmentActivity;
26 4895fff6 Leszek Koltunski
27 9c2f0c91 Leszek Koltunski
import org.distorted.objects.ObjectList;
28 4888e97c Leszek Koltunski
29 36e2cbdd Leszek Koltunski
import java.io.InputStream;
30
import java.net.HttpURLConnection;
31
import java.net.URL;
32 cc5ec229 Leszek Koltunski
import java.net.UnknownHostException;
33 86cbdab1 Leszek Koltunski
import java.security.MessageDigest;
34
import java.security.NoSuchAlgorithmException;
35 36e2cbdd Leszek Koltunski
36 9c2f0c91 Leszek Koltunski
import static org.distorted.objects.ObjectList.MAX_LEVEL;
37 211b48f2 Leszek Koltunski
38 fdec60a3 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
39
40 211b48f2 Leszek Koltunski
public class RubikScoresDownloader implements Runnable
41 fdec60a3 Leszek Koltunski
  {
42 211b48f2 Leszek Koltunski
  public interface Receiver
43 b8b38548 Leszek Koltunski
    {
44 1c90c64a Leszek Koltunski
    void receive(String[][][] country, String[][][] name, float[][][] time);
45 4895fff6 Leszek Koltunski
    void message(String mess);
46 4c0cd600 Leszek Koltunski
    void error(String error);
47 b8b38548 Leszek Koltunski
    }
48
49 286d73ae Leszek Koltunski
  public static final int MAX_PLACES = 10;
50 d8aa4ba8 Leszek Koltunski
51 b8b38548 Leszek Koltunski
  private static final int DOWNLOAD   = 0;
52
  private static final int SUBMIT     = 1;
53
  private static final int IDLE       = 2;
54
55 36e2cbdd Leszek Koltunski
  private final String[] hex = {
56
    "%00", "%01", "%02", "%03", "%04", "%05", "%06", "%07",
57
    "%08", "%09", "%0a", "%0b", "%0c", "%0d", "%0e", "%0f",
58
    "%10", "%11", "%12", "%13", "%14", "%15", "%16", "%17",
59
    "%18", "%19", "%1a", "%1b", "%1c", "%1d", "%1e", "%1f",
60
    "%20", "%21", "%22", "%23", "%24", "%25", "%26", "%27",
61
    "%28", "%29", "%2a", "%2b", "%2c", "%2d", "%2e", "%2f",
62
    "%30", "%31", "%32", "%33", "%34", "%35", "%36", "%37",
63
    "%38", "%39", "%3a", "%3b", "%3c", "%3d", "%3e", "%3f",
64
    "%40", "%41", "%42", "%43", "%44", "%45", "%46", "%47",
65
    "%48", "%49", "%4a", "%4b", "%4c", "%4d", "%4e", "%4f",
66
    "%50", "%51", "%52", "%53", "%54", "%55", "%56", "%57",
67
    "%58", "%59", "%5a", "%5b", "%5c", "%5d", "%5e", "%5f",
68
    "%60", "%61", "%62", "%63", "%64", "%65", "%66", "%67",
69
    "%68", "%69", "%6a", "%6b", "%6c", "%6d", "%6e", "%6f",
70
    "%70", "%71", "%72", "%73", "%74", "%75", "%76", "%77",
71
    "%78", "%79", "%7a", "%7b", "%7c", "%7d", "%7e", "%7f",
72
    "%80", "%81", "%82", "%83", "%84", "%85", "%86", "%87",
73
    "%88", "%89", "%8a", "%8b", "%8c", "%8d", "%8e", "%8f",
74
    "%90", "%91", "%92", "%93", "%94", "%95", "%96", "%97",
75
    "%98", "%99", "%9a", "%9b", "%9c", "%9d", "%9e", "%9f",
76
    "%a0", "%a1", "%a2", "%a3", "%a4", "%a5", "%a6", "%a7",
77
    "%a8", "%a9", "%aa", "%ab", "%ac", "%ad", "%ae", "%af",
78
    "%b0", "%b1", "%b2", "%b3", "%b4", "%b5", "%b6", "%b7",
79
    "%b8", "%b9", "%ba", "%bb", "%bc", "%bd", "%be", "%bf",
80
    "%c0", "%c1", "%c2", "%c3", "%c4", "%c5", "%c6", "%c7",
81
    "%c8", "%c9", "%ca", "%cb", "%cc", "%cd", "%ce", "%cf",
82
    "%d0", "%d1", "%d2", "%d3", "%d4", "%d5", "%d6", "%d7",
83
    "%d8", "%d9", "%da", "%db", "%dc", "%dd", "%de", "%df",
84
    "%e0", "%e1", "%e2", "%e3", "%e4", "%e5", "%e6", "%e7",
85
    "%e8", "%e9", "%ea", "%eb", "%ec", "%ed", "%ee", "%ef",
86
    "%f0", "%f1", "%f2", "%f3", "%f4", "%f5", "%f6", "%f7",
87
    "%f8", "%f9", "%fa", "%fb", "%fc", "%fd", "%fe", "%ff"
88
    };
89
90 b8b38548 Leszek Koltunski
  private static boolean mRunning = false;
91
  private static int mMode = IDLE;
92
  private static Receiver mReceiver;
93 4895fff6 Leszek Koltunski
  private static String mVersion;
94 b8b38548 Leszek Koltunski
95 9c2f0c91 Leszek Koltunski
  private static int mTotal = ObjectList.getTotal();
96 f3e12931 Leszek Koltunski
  private static String mScores = "";
97 85b09df4 Leszek Koltunski
  private static String[][][] mCountry = new String[mTotal][MAX_LEVEL][MAX_PLACES];
98
  private static String[][][] mName    = new String[mTotal][MAX_LEVEL][MAX_PLACES];
99
  private static  float[][][] mTime    = new  float[mTotal][MAX_LEVEL][MAX_PLACES];
100 f3e12931 Leszek Koltunski
101 85b09df4 Leszek Koltunski
  private static int[][] mPlaces = new int[mTotal][MAX_LEVEL];
102 bc511ea5 Leszek Koltunski
  private static RubikScoresDownloader mThis;
103 329c0aeb Leszek Koltunski
104 4895fff6 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
105
106 86cbdab1 Leszek Koltunski
  private static String computeHash(String stringToHash, byte[] salt)
107 4895fff6 Leszek Koltunski
    {
108 86cbdab1 Leszek Koltunski
    String generatedPassword;
109
110
    try
111
      {
112
      MessageDigest md = MessageDigest.getInstance("MD5");
113
      md.update(salt);
114
      byte[] bytes = md.digest(stringToHash.getBytes());
115
      StringBuilder sb = new StringBuilder();
116
117
      for (byte aByte : bytes)
118
        {
119
        sb.append(Integer.toString((aByte & 0xff) + 0x100, 16).substring(1));
120
        }
121
122
      generatedPassword = sb.toString();
123
      }
124
    catch (NoSuchAlgorithmException e)
125
      {
126
      return "NoSuchAlgorithm";
127
      }
128
129
    return generatedPassword;
130 4895fff6 Leszek Koltunski
    }
131
132
///////////////////////////////////////////////////////////////////////////////////////////////////
133
134 17f9a695 Leszek Koltunski
  private boolean fillValues()
135 f3e12931 Leszek Koltunski
    {
136 d8aa4ba8 Leszek Koltunski
    int begin=-1 ,end, len = mScores.length();
137 17f9a695 Leszek Koltunski
    String row;
138 f3e12931 Leszek Koltunski
139 4c0cd600 Leszek Koltunski
    if( len==0 )
140
      {
141
      mReceiver.error("1");
142
      return false;
143
      }
144 90fd47b0 Leszek Koltunski
    else if( len<=2 )
145 4c0cd600 Leszek Koltunski
      {
146
      mReceiver.error(mScores);
147
      return false;
148
      }
149
150 4888e97c Leszek Koltunski
    for(int i=0; i<mTotal; i++)
151 85b09df4 Leszek Koltunski
      for(int j=0; j<MAX_LEVEL; j++)
152 329c0aeb Leszek Koltunski
        {
153
        mPlaces[i][j] = 0;
154
        }
155
156 d8aa4ba8 Leszek Koltunski
    while( begin<len )
157
      {
158
      end = mScores.indexOf('\n', begin+1);
159
      if( end<0 ) end = len;
160 286d73ae Leszek Koltunski
161
      try
162
        {
163 17f9a695 Leszek Koltunski
        row = mScores.substring(begin+1,end);
164 4c0cd600 Leszek Koltunski
        fillRow(row);
165 286d73ae Leszek Koltunski
        }
166
      catch(Exception ex)
167
        {
168
        // faulty row - ignore
169
        }
170
171 d8aa4ba8 Leszek Koltunski
      begin = end;
172
      }
173 17f9a695 Leszek Koltunski
174
    return true;
175 f3e12931 Leszek Koltunski
    }
176
177
///////////////////////////////////////////////////////////////////////////////////////////////////
178
179 d8aa4ba8 Leszek Koltunski
  private void fillRow(String row)
180 f3e12931 Leszek Koltunski
    {
181 d8aa4ba8 Leszek Koltunski
    int s1 = row.indexOf(' ');
182
    int s2 = row.indexOf(' ',s1+1);
183
    int s3 = row.indexOf(' ',s2+1);
184
    int s4 = row.indexOf(' ',s3+1);
185 286d73ae Leszek Koltunski
    int s5 = row.length();
186 d8aa4ba8 Leszek Koltunski
187
    if( s5>s4 && s4>s3 && s3>s2 && s2>s1 && s1>0 )
188
      {
189 9c2f0c91 Leszek Koltunski
      int object = ObjectList.unpackObjectFromString( row.substring(0,s1) );
190 b8b38548 Leszek Koltunski
191 286d73ae Leszek Koltunski
      if( object>=0 && object<mTotal )
192 d8aa4ba8 Leszek Koltunski
        {
193 8e3898c8 Leszek Koltunski
        int level      = Integer.parseInt( row.substring(s1+1,s2) );
194 286d73ae Leszek Koltunski
        String name    = row.substring(s2+1, s3);
195
        int time       = Integer.parseInt( row.substring(s3+1,s4) );
196
        String country = row.substring(s4+1, s5);
197 d8aa4ba8 Leszek Koltunski
198 8e3898c8 Leszek Koltunski
        if(level>=0 && level<MAX_LEVEL)
199 d8aa4ba8 Leszek Koltunski
          {
200 8e3898c8 Leszek Koltunski
          int p = mPlaces[object][level];
201
          mPlaces[object][level]++;
202 329c0aeb Leszek Koltunski
203 8e3898c8 Leszek Koltunski
          mCountry[object][level][p] = country;
204
          mName   [object][level][p] = name;
205 79e752b3 Leszek Koltunski
          mTime   [object][level][p] = ((float)(time/10))/100.0f;
206 d8aa4ba8 Leszek Koltunski
          }
207
        }
208
      }
209 874c37b1 Leszek Koltunski
    else
210
      {
211 5d50e7a7 Leszek Koltunski
      tryDoCommand(row);
212
      }
213
    }
214
215
///////////////////////////////////////////////////////////////////////////////////////////////////
216
217
  private void tryDoCommand(String row)
218
    {
219
    if( row.startsWith("comm") )
220
      {
221
      int colon = row.indexOf(':');
222
223
      if( colon>0 )
224 874c37b1 Leszek Koltunski
        {
225 5d50e7a7 Leszek Koltunski
        String commandNumber = row.substring(4,colon);
226
        int number;
227
228
        try
229
          {
230
          number = Integer.parseInt(commandNumber);
231
          }
232
        catch(NumberFormatException ex)
233
          {
234
          number=0;
235
          }
236 874c37b1 Leszek Koltunski
237 5d50e7a7 Leszek Koltunski
        if(number==1)
238 874c37b1 Leszek Koltunski
          {
239
          String country = row.substring(colon+1);
240
          RubikScores scores = RubikScores.getInstance();
241
          scores.setCountry(country);
242
          }
243
        }
244
      }
245 f3e12931 Leszek Koltunski
    }
246
247 36e2cbdd Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
248
249
  private String URLencode(String s)
250
    {
251
    StringBuilder sbuf = new StringBuilder();
252
    int len = s.length();
253
254
    for (int i = 0; i < len; i++)
255
      {
256
      int ch = s.charAt(i);
257
258
           if ('A' <= ch && ch <= 'Z') sbuf.append((char)ch);
259
      else if ('a' <= ch && ch <= 'z') sbuf.append((char)ch);
260
      else if ('0' <= ch && ch <= '9') sbuf.append((char)ch);
261
      else if (ch == ' '             ) sbuf.append('+');
262
      else if (ch == '-' || ch == '_'
263
            || ch == '.' || ch == '!'
264
            || ch == '~' || ch == '*'
265
            || ch == '\'' || ch == '('
266
            || ch == ')'             ) sbuf.append((char)ch);
267
      else if (ch <= 0x007f)           sbuf.append(hex[ch]);
268
      else if (ch <= 0x07FF)
269
        {
270
        sbuf.append(hex[0xc0 | (ch >> 6)]);
271
        sbuf.append(hex[0x80 | (ch & 0x3F)]);
272
        }
273
      else
274
        {
275
        sbuf.append(hex[0xe0 | (ch >> 12)]);
276
        sbuf.append(hex[0x80 | ((ch >> 6) & 0x3F)]);
277
        sbuf.append(hex[0x80 | (ch & 0x3F)]);
278
        }
279
      }
280
281
    return sbuf.toString();
282
    }
283
284 f3e12931 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
285
286 4895fff6 Leszek Koltunski
  private boolean network(String url)
287 f3e12931 Leszek Koltunski
    {
288 36e2cbdd Leszek Koltunski
    try
289
      {
290 4895fff6 Leszek Koltunski
      java.net.URL connectURL = new URL(url);
291 36e2cbdd Leszek Koltunski
      HttpURLConnection conn = (HttpURLConnection)connectURL.openConnection();
292
293
      conn.setDoInput(true);
294
      conn.setDoOutput(true);
295
      conn.setUseCaches(false);
296
      conn.setRequestMethod("GET");
297
      conn.connect();
298
      conn.getOutputStream().flush();
299
300 a675474f Leszek Koltunski
      try( InputStream is = conn.getInputStream() )
301 36e2cbdd Leszek Koltunski
        {
302
        int ch;
303
        StringBuilder sb = new StringBuilder();
304
        while( ( ch = is.read() ) != -1 )
305
          {
306
          sb.append( (char)ch );
307
          }
308
        mScores = sb.toString();
309
        }
310 cc5ec229 Leszek Koltunski
      catch( final Exception e)
311 36e2cbdd Leszek Koltunski
        {
312 4895fff6 Leszek Koltunski
        mReceiver.message("Failed to get an answer from the High Scores server");
313 a675474f Leszek Koltunski
        return false;
314 36e2cbdd Leszek Koltunski
        }
315
      }
316 cc5ec229 Leszek Koltunski
    catch( final UnknownHostException e )
317
      {
318 4895fff6 Leszek Koltunski
      mReceiver.message("No access to Internet");
319 cc5ec229 Leszek Koltunski
      return false;
320
      }
321
    catch( final SecurityException e )
322
      {
323 4895fff6 Leszek Koltunski
      mReceiver.message("Application not authorized to connect to the Internet");
324 cc5ec229 Leszek Koltunski
      return false;
325
      }
326
    catch( final Exception e )
327 36e2cbdd Leszek Koltunski
      {
328 4895fff6 Leszek Koltunski
      mReceiver.message(e.getMessage());
329 a675474f Leszek Koltunski
      return false;
330 36e2cbdd Leszek Koltunski
      }
331
332 329c0aeb Leszek Koltunski
    if( mScores.length()==0 )
333
      {
334 4895fff6 Leszek Koltunski
      mReceiver.message("Failed to download scores");
335 329c0aeb Leszek Koltunski
      return false;
336
      }
337
338 a675474f Leszek Koltunski
    return true;
339 b8b38548 Leszek Koltunski
    }
340 d8aa4ba8 Leszek Koltunski
341 17f9a695 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
342
343
  private String constructDownloadURL()
344
    {
345
    RubikScores scores = RubikScores.getInstance();
346
    String name = URLencode(scores.getName());
347
    String veri = scores.isVerified() ? name : "";
348
    int numRuns = scores.getNumRuns();
349
    int numPlay = scores.getNumPlays();
350 874c37b1 Leszek Koltunski
    String country = scores.getCountry();
351 17f9a695 Leszek Koltunski
352
    String url="https://distorted.org/magic/cgi-bin/download.cgi";
353 874c37b1 Leszek Koltunski
    url += "?n="+name+"&v="+veri+"&r="+numRuns+"&p="+numPlay+"&c="+country+"&e="+mVersion+"d";
354 9c2f0c91 Leszek Koltunski
    url += "&o="+ ObjectList.getObjectList()+"&min=0&max="+MAX_LEVEL+"&l="+MAX_PLACES;
355 17f9a695 Leszek Koltunski
356
    return url;
357
    }
358
359
///////////////////////////////////////////////////////////////////////////////////////////////////
360
361
  private String constructSubmitURL()
362
    {
363
    RubikScores scores = RubikScores.getInstance();
364
    String name = URLencode(scores.getName());
365
    String veri = scores.isVerified() ? name : "";
366
    int numRuns = scores.getNumRuns();
367
    int numPlay = scores.getNumPlays();
368
    int deviceID= scores.getDeviceID();
369 6570171b Leszek Koltunski
    String reclist = scores.getRecordList("&o=","&l=","&t=");
370 17f9a695 Leszek Koltunski
    String country = scores.getCountry();
371 86cbdab1 Leszek Koltunski
    long epoch = System.currentTimeMillis();
372 fb377dae Leszek Koltunski
    String salt = "cuboid";
373 17f9a695 Leszek Koltunski
374 86cbdab1 Leszek Koltunski
    String url1="https://distorted.org/magic/cgi-bin/submit.cgi";
375
    String url2 = "n="+name+"&v="+veri+"&r="+numRuns+"&p="+numPlay+"&i="+deviceID+"&e="+mVersion+"d";
376 6570171b Leszek Koltunski
    url2 += reclist+"&c="+country+"&f="+epoch+"&oo="+ ObjectList.getObjectList();
377
    url2 += "&min=0&max="+MAX_LEVEL+"&lo="+MAX_PLACES+"&h="+computeHash( url2, salt.getBytes() );
378 17f9a695 Leszek Koltunski
379 86cbdab1 Leszek Koltunski
    return url1 + "?" + url2;
380 17f9a695 Leszek Koltunski
    }
381
382 d8aa4ba8 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
383
384
  private boolean gottaDownload()
385 b8b38548 Leszek Koltunski
    {
386 d8aa4ba8 Leszek Koltunski
    return ((mScores.length()==0) && !mRunning);
387 f3e12931 Leszek Koltunski
    }
388 b8b38548 Leszek Koltunski
389 d8aa4ba8 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
390
391 4f9f99a2 Leszek Koltunski
  @Override
392 d8aa4ba8 Leszek Koltunski
  public void run()
393
    {
394 a675474f Leszek Koltunski
    boolean success=true;
395
396 17f9a695 Leszek Koltunski
    try
397 d8aa4ba8 Leszek Koltunski
      {
398 17f9a695 Leszek Koltunski
      if( mMode==DOWNLOAD && gottaDownload() )
399 d8aa4ba8 Leszek Koltunski
        {
400 17f9a695 Leszek Koltunski
        mRunning = true;
401
        success = network(constructDownloadURL());
402 d8aa4ba8 Leszek Koltunski
        }
403 17f9a695 Leszek Koltunski
      if( mMode==SUBMIT )
404 4895fff6 Leszek Koltunski
        {
405 17f9a695 Leszek Koltunski
        mRunning = true;
406 4895fff6 Leszek Koltunski
407 17f9a695 Leszek Koltunski
        if( RubikScores.getInstance().thereAreUnsubmittedRecords() )
408
          {
409
          success = network(constructSubmitURL());
410
          }
411
        }
412 d8aa4ba8 Leszek Koltunski
      }
413 17f9a695 Leszek Koltunski
    catch( Exception e )
414 d8aa4ba8 Leszek Koltunski
      {
415 17f9a695 Leszek Koltunski
      mReceiver.message("Exception downloading records: "+e.getMessage() );
416 4895fff6 Leszek Koltunski
      }
417 286d73ae Leszek Koltunski
418 17f9a695 Leszek Koltunski
    if( mRunning )
419
      {
420
      success = fillValues();
421
      mRunning = false;
422
      }
423 a675474f Leszek Koltunski
424
    if( success )
425
      {
426 cc5ec229 Leszek Koltunski
      mReceiver.receive(mCountry, mName, mTime);
427 17f9a695 Leszek Koltunski
428
      if( mMode==SUBMIT )
429
        {
430
        RubikScores.getInstance().successfulSubmit();
431
        }
432 a675474f Leszek Koltunski
      }
433 d8aa4ba8 Leszek Koltunski
    }
434 4f9f99a2 Leszek Koltunski
435 bc511ea5 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
436
437
  private RubikScoresDownloader()
438
    {
439
440
    }
441
442 4f9f99a2 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
443
// PUBLIC API
444
///////////////////////////////////////////////////////////////////////////////////////////////////
445
446
  public static void onPause()
447
    {
448
    mRunning = false;
449
    }
450
451 bc511ea5 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
452
453
  public static RubikScoresDownloader getInstance()
454
    {
455
    if( mThis==null )
456
      {
457
      mThis = new RubikScoresDownloader();
458
      }
459
460
    return mThis;
461
    }
462
463 4f9f99a2 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
464
465 1780dcb0 Leszek Koltunski
  private void start(Receiver receiver, FragmentActivity act, int mode)
466 4f9f99a2 Leszek Koltunski
    {
467
    mReceiver = receiver;
468 1780dcb0 Leszek Koltunski
    mMode     = mode;
469
470
    try
471
      {
472
      PackageInfo pInfo = act.getPackageManager().getPackageInfo( act.getPackageName(), 0);
473
      mVersion = pInfo.versionName;
474
      }
475
    catch (PackageManager.NameNotFoundException e)
476
      {
477 6570171b Leszek Koltunski
      mVersion = "0.9.2";
478 1780dcb0 Leszek Koltunski
      }
479 6f8e5dfc Leszek Koltunski
480 4f9f99a2 Leszek Koltunski
    Thread networkThrd = new Thread(this);
481
    networkThrd.start();
482
    }
483 bc511ea5 Leszek Koltunski
484
///////////////////////////////////////////////////////////////////////////////////////////////////
485
486 1780dcb0 Leszek Koltunski
  public void download(Receiver receiver, FragmentActivity act)
487 bc511ea5 Leszek Koltunski
    {
488 1780dcb0 Leszek Koltunski
    start(receiver, act, DOWNLOAD);
489
    }
490 bc511ea5 Leszek Koltunski
491 1780dcb0 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
492
493
  public void submit(Receiver receiver, FragmentActivity act)
494
    {
495
    start(receiver, act, SUBMIT);
496 bc511ea5 Leszek Koltunski
    }
497 b8b38548 Leszek Koltunski
}