/[projects]/android/TrainInfo/src/dk/thoerup/traininfo/provider/OfflineStationProvider.java
ViewVC logotype

Diff of /android/TrainInfo/src/dk/thoerup/traininfo/provider/OfflineStationProvider.java

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

revision 1546 by torben, Wed Jul 6 21:20:49 2011 UTC revision 1551 by torben, Thu Jul 7 20:45:17 2011 UTC
# Line 36  public class OfflineStationProvider impl Line 36  public class OfflineStationProvider impl
36                  if (!stationsFile.exists())                  if (!stationsFile.exists())
37                          return false;                          return false;
38                                    
39                  int size = (int) stationsFile.length();                  /*int size = (int) stationsFile.length();
40                  /*byte data[] = new byte[size];                  byte data[] = new byte[size];
41                                    
42                  RandomAccessFile raf = new RandomAccessFile(stationsFile, "r");                  RandomAccessFile raf = new RandomAccessFile(stationsFile, "r");
43                  raf.readFully(data);                  raf.readFully(data);
# Line 66  public class OfflineStationProvider impl Line 66  public class OfflineStationProvider impl
66                  File parent = context.getFilesDir();                  File parent = context.getFilesDir();
67                  File stationsFile = new File(parent, "stations.bin");                  File stationsFile = new File(parent, "stations.bin");
68    
69                    
70                  byte data[] = HttpUtil.getContent(XmlUtil.SERVICE_BASE + "/LocateStations?dump=1", 5000);                  byte data[] = HttpUtil.getContent(XmlUtil.SERVICE_BASE + "/LocateStations?dump=1", 5000);
71                  Serializer serializer = new Persister();                  Serializer serializer = new Persister();
72                  stations = serializer.read(StationBean.class,  new String(data, "ISO-8859-1") );                  stations = serializer.read(StationBean.class,  new String(data, "ISO-8859-1") );

Legend:
Removed from v.1546  
changed lines
  Added in v.1551

  ViewVC Help
Powered by ViewVC 1.1.20