android - GCM Network Manager, are multiple one off tasks exeucted in sequential order? -


introduction

i have app let's user favourite list of music albums. music albums content stored on device allow offline access.

the favourite choices stored offline via local sqlite database

if internet active favourite request call happens normal however, support in offline mode.

i came across gcm network manager allow me schedule task when network active every favourite request made offline scheduled.

the problem & questions

i've gone through documentations , searched cannot find answers these questions.

  1. can submit multiple one-off tasks have same tag , ensure not overridden? ask because docs setupdatecurrent method of 1 off task builder classis default false suggest not overridden. however, settag method states if tag same pre-existing task updated not want. i want queue same task because unique music album favourite request

  2. i reliased above can solved setting tag of music album id have not know order gcm job manager execute tasks. use example

here 2 tasks, have unique tags, first submitted first , shortly after second.

  • tag = 1a-favourite
    • tag = 1a-unfavourite

will gcm network manager execute these tasks in order submitted? might cause problem if unfavourite request made before favourite.

thanks reading question.

have tried like:

gcmnetworkmanager.canceltask("1a-favourite", mytask.class); gcmnetworkmanager.schedule(myunfavoritetask); 

that should ensure first request either cancelled before sent, or has completed successfully, , second request "un-favorite" item in question.

also, should see tasks replacing each other if tags identical , .setupdatecurrent(true) on builder. pointed out, defaults false.


Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

c - Unrecognised emulation mode: elf_i386 on MinGW32 -