Android Question Downloading Tiles from Wms Server-Cookies problem?

gvoulg

Member
Licensed User
Longtime User
Attached is a little program I wrote to download tiles from a Wms server and save them into an sqlite database for offline use.
The problem is that I can download and write in database only the first tile that the program asks from the server. Looking at the unfiltered logs I see that a cookie problem shows after the first succes call to server and all the rest fails.
To test the program you should change google maps API KEY in Manifest and package name with a working one of yours.
Best Regards
George
 

Attachments

  • saveTiles.zip
    11.5 KB · Views: 147

gvoulg

Member
Licensed User
Longtime User
Can you post the error message?
from the unfiltered log (a part of it)

http://gis.ktimanet.gr/wms/wmsopen/...&height=256&format=image/png&transparent=true
request 16/37079/25262
http://gis.ktimanet.gr/wms/wmsopen/...&height=256&format=image/png&transparent=true


request 16/37079/25263
http://gis.ktimanet.gr/wms/wmsopen/...&height=256&format=image/png&transparent=true
request 16/37079/25264
http://gis.ktimanet.gr/wms/wmsopen/...&height=256&format=image/png&transparent=true
request 16/37079/25265
http://gis.ktimanet.gr/wms/wmsopen/...&height=256&format=image/png&transparent=true
request 16/37079/25266
http://gis.ktimanet.gr/wms/wmsopen/...&height=256&format=image/png&transparent=true
request 16/37080/25262
http://gis.ktimanet.gr/wms/wmsopen/...&height=256&format=image/png&transparent=true
request 16/37080/25263
http://gis.ktimanet.gr/wms/wmsopen/...&height=256&format=image/png&transparent=true
request 16/37080/25264
http://gis.ktimanet.gr/wms/wmsopen/...&height=256&format=image/png&transparent=true
request 16/37080/25265
http://gis.ktimanet.gr/wms/wmsopen/...&height=256&format=image/png&transparent=true
request 16/37080/25266
http://gis.ktimanet.gr/wms/wmsopen/...&height=256&format=image/png&transparent=true
request 16/37081/25262
http://gis.ktimanet.gr/wms/wmsopen/...&height=256&format=image/png&transparent=true
request 16/37081/25263
http://gis.ktimanet.gr/wms/wmsopen/...&height=256&format=image/png&transparent=true
request 16/37081/25264
http://gis.ktimanet.gr/wms/wmsopen/...&height=256&format=image/png&transparent=true
request 16/37081/25265
http://gis.ktimanet.gr/wms/wmsopen/...&height=256&format=image/png&transparent=true
request 16/37081/25266
http://gis.ktimanet.gr/wms/wmsopen/...&height=256&format=image/png&transparent=true
request 16/37082/25262
http://gis.ktimanet.gr/wms/wmsopen/...&height=256&format=image/png&transparent=true


request 16/37082/25263
http://gis.ktimanet.gr/wms/wmsopen/...&height=256&format=image/png&transparent=true
request 16/37082/25264
http://gis.ktimanet.gr/wms/wmsopen/...&height=256&format=image/png&transparent=true
request 16/37082/25265
http://gis.ktimanet.gr/wms/wmsopen/...&height=256&format=image/png&transparent=true
request 16/37082/25266
[1] 5.onFinished: Installation state replication succeeded.
** Service (httputils2service) Create **
[DEBUG] GbaRequest - GbaRequest: Constructor Called 222 userAgent null
[DEBUG] NafRequest - NafRequest: NafRequest constructor===useragent null
** Service (httputils2service) Start **
** Service (httputils2service) Start **
** Service (httputils2service) Start **
** Service (httputils2service) Start **
** Service (httputils2service) Start **
** Service (httputils2service) Start **
** Service (httputils2service) Start **
** Service (httputils2service) Start **
** Service (httputils2service) Start **
** Service (httputils2service) Start **
** Service (httputils2service) Start **
** Service (httputils2service) Start **
** Service (httputils2service) Start **
** Service (httputils2service) Start **
** Service (httputils2service) Start **
** Service (httputils2service) Start **
** Service (httputils2service) Start **
** Service (httputils2service) Start **
** Service (httputils2service) Start **
** Service (httputils2service) Start **
pool-14-thread-1(ApacheHTTPLog):Reading from variable values from setDefaultValuesToVariables
stopOutput() output 3, stream 1, session 19612
changeRefCount() stream 1, count 0
stream type [13], return media strategy
stream type [13], return media strategy
stream type [13], return media strategy
stream type [13], return media strategy
stream type [13], return media strategy
stream type [13], return media strategy
stream type [13], return media strategy
getNewDevice() selected device 0
setOutputDevice() output 3 device 0000 force 0 delayMs 100
setOutputDevice() prevDevice (0002)
stream type [13], return media strategy
stream type [13], return media strategy
stream type [13], return media strategy
setOutputDevice() setting same device 0000 or null device for output 3
stream type [13], return media strategy
isRunningFactoryApp=false
setHidden false
sendKeyguardVisibilityChanged(true)
visibility is same
id=14656 Removed nain (10/13)
id=14656 Removed nain (-2/13)
isRunningFactoryApp=false
setHidden false
sendKeyguardVisibilityChanged(true)
visibility is same
Invalid cookie header: "Set-Cookie: ESRI=r2283208742; path=/; expires=Web, 1 Jan 2020 00:00:00 GMT". Unable to parse expires attribute: Web, 1 Jan 2020 00:00:00 GMT
Invalid cookie header: "Set-Cookie: ESRI=r2283210920; path=/; expires=Web, 1 Jan 2020 00:00:00 GMT". Unable to parse expires attribute: Web, 1 Jan 2020 00:00:00 GMT
Invalid cookie header: "Set-Cookie: ESRI=r2206772126; path=/; expires=Web, 1 Jan 2020 00:00:00 GMT". Unable to parse expires attribute: Web, 1 Jan 2020 00:00:00 GMT
Invalid cookie header: "Set-Cookie: ESRI=r2206772126; path=/; expires=Web, 1 Jan 2020 00:00:00 GMT". Unable to parse expires attribute: Web, 1 Jan 2020 00:00:00 GMT
Invalid cookie header: "Set-Cookie: ESRI=r2206772126; path=/; expires=Web, 1 Jan 2020 00:00:00 GMT". Unable to parse expires attribute: Web, 1 Jan 2020 00:00:00 GMT


refreshSignalCluster: data=-1 bt=false
checkOverflow(1248), More:false, Req:false Child:4
pool-14-thread-5 calls detatch()
JobName = Job1, Success = true,filename = 16/37082/25266
pool-14-thread-11 calls detatch()
rgc: _jobdone
JobName = Job1, Success = true,filename = 16/37082/25266
android.database.sqlite.SQLiteConstraintException: column tile_id is not unique (code 19)
Waited long enough for: ServiceRecord{46f33e28 u0 com.sec.android.widgetapp.at.hero.accuweather/.WeatherClockService}
pool-14-thread-2 calls detatch()
JobName = Job1, Success = true,filename = 16/37082/25266
android.database.sqlite.SQLiteConstraintException: column tile_id is not unique (code 19)
EDMNativeHelperService is published
pool-14-thread-17 calls detatch()
JobName = Job1, Success = true,filename = 16/37082/25266
android.database.sqlite.SQLiteConstraintException: column tile_id is not unique (code 19)
pool-14-thread-6 calls detatch()
rgc: _jobdone
JobName = Job1, Success = true,filename = 16/37082/25266
android.database.sqlite.SQLiteConstraintException: column tile_id is not unique (code 19)
Invalid cookie header: "Set-Cookie: ESRI=r2283208742; path=/; expires=Web, 1 Jan 2020 00:00:00 GMT". Unable to parse expires attribute: Web, 1 Jan 2020 00:00:00 GMT
Invalid cookie header: "Set-Cookie: ESRI=r2206772126; path=/; expires=Web, 1 Jan 2020 00:00:00 GMT". Unable to parse expires attribute: Web, 1 Jan 2020 00:00:00 GMT
Invalid cookie header: "Set-Cookie: ESRI=r2283210920; path=/; expires=Web, 1 Jan 2020 00:00:00 GMT". Unable to parse expires attribute: Web, 1 Jan 2020 00:00:00 GMT
GC_CONCURRENT freed 8207K, 40% free 17736K/29256K, paused 1ms+4ms, total 32ms
out_standby: enter: usecase(1: low-latency-playback)
stop_output_stream: enter: usecase(1: low-latency-playback)
disable_audio_route: enter: usecase(1)
disable_audio_route: reset mixer path: low-latency-playback
++++ audio_route_update_mixer ==============
Setting mixer control: SLIMBUS_0_RX Audio Mixer MultiMedia5, value: 0
------ audio_route_update_mixer ==============
disable_audio_route: exit
disable_snd_device: snd_device(2: speaker)
++++ audio_route_update_mixer ==============
Setting mixer control: LINEOUT3 Volume, value: 0
Setting mixer control: LINEOUT4 Volume, value: 0
Setting mixer control: RX4 Digital Volume, value: 0
Setting mixer control: RX6 Digital Volume, value: 0
Setting mixer control: RX6 MIX1 INP1, value: 0
Setting mixer control: RX4 MIX1 INP1, value: 0
Setting mixer control: SLIM RX2 MUX, value: 0
Setting mixer control: SLIM_0_RX Channels, value: 0
------ audio_route_update_mixer ==============
stop_output_stream: exit: status(0)
out_standby: exit
ContainerId: 0
pool-14-thread-5 calls detatch()
JobName = Job1, Success = true,filename = 16/37082/25266
android.database.sqlite.SQLiteConstraintException: column tile_id is not unique (code 19)
pool-14-thread-11 calls detatch()
JobName = Job1, Success = true,filename = 16/37082/25266
android.database.sqlite.SQLiteConstraintException: column tile_id is not unique (code 19)
pool-14-thread-20 calls detatch()
rgc: _jobdone
JobName = Job1, Success = true,filename = 16/37082/25266
android.database.sqlite.SQLiteConstraintException: column tile_id is not unique (code 19)
SIOP:: AP = 260, Prev AP = 260, Duration = 10050, PST = 300
Invalid cookie header: "Set-Cookie: ESRI=r2283208742; path=/; expires=Web, 1 Jan 2020 00:00:00 GMT". Unable to parse expires attribute: Web, 1 Jan 2020 00:00:00 GMT
Invalid cookie header: "Set-Cookie: ESRI=r2283210920; path=/; expires=Web, 1 Jan 2020 00:00:00 GMT". Unable to parse expires attribute: Web, 1 Jan 2020 00:00:00 GMT
Invalid cookie header: "Set-Cookie: ESRI=r2206772126; path=/; expires=Web, 1 Jan 2020 00:00:00 GMT". Unable to parse expires attribute: Web, 1 Jan 2020 00:00:00 GMT
Invalid cookie header: "Set-Cookie: ESRI=r2206772126; path=/; expires=Web, 1 Jan 2020 00:00:00 GMT". Unable to parse expires attribute: Web, 1 Jan 2020 00:00:00 GMT
Invalid cookie header: "Set-Cookie: ESRI=r2206772126; path=/; expires=Web, 1 Jan 2020 00:00:00 GMT". Unable to parse expires attribute: Web, 1 Jan 2020 00:00:00 GMT


pool-14-thread-11 calls detatch()
JobName = Job1, Success = true,filename = 16/37082/25266
android.database.sqlite.SQLiteConstraintException: column tile_id is not unique (code 19)
pool-14-thread-5 calls detatch()
pool-14-thread-20 calls detatch()
JobName = Job1, Success = true,filename = 16/37082/25266
GC_CONCURRENT freed 3450K, 41% free 17550K/29256K, paused 3ms+3ms, total 37ms
WAIT_FOR_CONCURRENT_GC blocked 34ms
android.database.sqlite.SQLiteConstraintException: column tile_id is not unique (code 19)
rgc: _jobdone
JobName = Job1, Success = true,filename = 16/37082/25266
android.database.sqlite.SQLiteConstraintException: column tile_id is not unique (code 19)
pool-14-thread-17 calls detatch()
JobName = Job1, Success = true,filename = 16/37082/25266
android.database.sqlite.SQLiteConstraintException: column tile_id is not unique (code 19)
pool-14-thread-6 calls detatch()
JobName = Job1, Success = true,filename = 16/37082/25266
android.database.sqlite.SQLiteConstraintException: column tile_id is not unique (code 19)
Invalid cookie header: "Set-Cookie: ESRI=r2283210920; path=/; expires=Web, 1 Jan 2020 00:00:00 GMT". Unable to parse expires attribute: Web, 1 Jan 2020 00:00:00 GMT
Invalid cookie header: "Set-Cookie: ESRI=r2283208742; path=/; expires=Web, 1 Jan 2020 00:00:00 GMT". Unable to parse expires attribute: Web, 1 Jan 2020 00:00:00 GMT
Invalid cookie header: "Set-Cookie: ESRI=r2206772126; path=/; expires=Web, 1 Jan 2020 00:00:00 GMT". Unable to parse expires attribute: Web, 1 Jan 2020 00:00:00 GMT
Invalid cookie header: "Set-Cookie: ESRI=r2206772126; path=/; expires=Web, 1 Jan 2020 00:00:00 GMT". Unable to parse expires attribute: Web, 1 Jan 2020 00:00:00 GMT
EDMNativeHelperService is published
pool-14-thread-11 calls detatch()
JobName = Job1, Success = true,filename = 16/37082/25266
android.database.sqlite.SQLiteConstraintException: column tile_id is not unique (code 19)
pool-14-thread-20 calls detatch()
JobName = Job1, Success = true,filename = 16/37082/25266
GC_CONCURRENT freed 3589K, 42% free 17064K/29256K, paused 3ms+2ms, total 37ms
WAIT_FOR_CONCURRENT_GC blocked 34ms
android.database.sqlite.SQLiteConstraintException: column tile_id is not unique (code 19)
pool-14-thread-17 calls detatch()
rgc: _jobdone
JobName = Job1, Success = true,filename = 16/37082/25266
android.database.sqlite.SQLiteConstraintException: column tile_id is not unique (code 19)
pool-14-thread-5 calls detatch()
JobName = Job1, Success = true,filename = 16/37082/25266
android.database.sqlite.SQLiteConstraintException: column tile_id is not unique (code 19)
Invalid cookie header: "Set-Cookie: ESRI=r2283210920; path=/; expires=Web, 1 Jan 2020 00:00:00 GMT". Unable to parse expires attribute: Web, 1 Jan 2020 00:00:00 GMT
Invalid cookie header: "Set-Cookie: ESRI=r2283208742; path=/; expires=Web, 1 Jan 2020 00:00:00 GMT". Unable to parse expires attribute: Web, 1 Jan 2020 00:00:00 GMT
Invalid cookie header: "Set-Cookie: ESRI=r2206772126; path=/; expires=Web, 1 Jan 2020 00:00:00 GMT". Unable to parse expires attribute: Web, 1 Jan 2020 00:00:00 GMT
ContainerId: 0
pool-14-thread-20 calls detatch()
JobName = Job1, Success = true,filename = 16/37082/25266
android.database.sqlite.SQLiteConstraintException: column tile_id is not unique (code 19)
received broadcast android.intent.action.BATTERY_CHANGED
handleBatteryUpdate
level:100, scale:100, status:3, health:2, present:true, voltage: 4246, temperature: 217, technology: Li-ion, AC powered:false, USB powered:true, Wireless powered:false, icon:17303439, invalid charger:0, online:4, current avg:-350, charge type:1
Sending ACTION_BATTERY_CHANGED.
mBrightnessEnablebySettings = true mBrightnessEnablebyBattery = true mBrightnessEnablebyDisableFlag = true mPmsBrightnessEnablebySettings = true
pool-14-thread-17 calls detatch()
rgc: _jobdone
JobName = Job1, Success = true,filename = 16/37082/25266
checkOverflow(1248), More:false, Req:false Child:4
ACTION_BATTERY_CHANGED : level:100 status:3 health:2


Thank you
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Do YOU set this cookie?

expires=Web, 1 Jan 2020 00:00:00 GMT
What is "Web" a acronym for?

OffTopic: If i should answer this Question then i would say "Web" is an universal day. Like "Monday till Sunday" in MY case :D
 
Upvote 0

gvoulg

Member
Licensed User
Longtime User
Don't use the same HttpJob object for all the requests.
Add: Dim Job As HttpJob in your for loop.
That's it.
Thanks Erel
ps.
One more thing.
How do I know that all the jobs are finished?
What is the event for that?
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
How do I know that all the jobs are finished?
You need to know yourself which jobs you have started and which are finished
What is the event for that?
There is no such event. Each Job you start results in one JobDone-Event-raise

You can get some inspiration on this Post, It shows you the principle of doing similar things
 
Upvote 0
Top