84 |
File parent = context.getFilesDir(); |
File parent = context.getFilesDir(); |
85 |
File stationsFile = new File(parent, "stations.bin"); |
File stationsFile = new File(parent, "stations.bin"); |
86 |
|
|
87 |
|
long start = System.currentTimeMillis(); |
88 |
byte data[] = HttpUtil.getContent(XmlUtil.SERVICE_BASE + "/LocateStations?dump=1", 5000); |
byte data[] = HttpUtil.getContent(XmlUtil.SERVICE_BASE + "/LocateStations?dump=1", 5000); |
89 |
Serializer serializer = new Persister(); |
logElapsedTime(start, "download XML"); |
90 |
|
|
91 |
|
|
92 |
|
Serializer serializer = new Persister(); |
93 |
|
|
94 |
|
start = System.currentTimeMillis(); |
95 |
StationBean tmpStations = serializer.read(StationBean.class, new String(data, "ISO-8859-1") ); |
StationBean tmpStations = serializer.read(StationBean.class, new String(data, "ISO-8859-1") ); |
96 |
|
logElapsedTime(start, "parse XML"); |
97 |
|
|
98 |
|
|
99 |
ObjectOutputStream out = new ObjectOutputStream( new FileOutputStream(stationsFile) ); |
ObjectOutputStream out = new ObjectOutputStream( new FileOutputStream(stationsFile) ); |