Questions tagged [square-tape]

Tape is a collection of queue-related classes for Android and Java.

Tape is a collection of queue-related classes for Android and Java.

QueueFile is a lightning-fast, transactional, file-based FIFO. Addition and removal from an instance is an O(1) operation and is atomic. Writes are synchronous; data will be written to disk before an operation returns. The underlying file is structured to survive process and even system crashes and if an I/O exception is thrown during a mutating change, the change is aborted.

An ObjectQueue represents an ordering of arbitrary objects which can be backed either by the filesystem (via QueueFile) or in memory only.

TaskQueue is a special object queue which holds Tasks, objects which have a notion of being executed. Instances are managed by an external executor which prepares and executes enqueued tasks.

Source: http://square.github.io/tape/

9 questions
58
votes
1 answer

EOFException when reading QueueFile tape

I'm using Square's Tape library to queue uploads of data to the server. The queue is stored in File in JSON format. When the app starts I init the queue and start uploading (i.e if on Wifi) However on some devices on users I'm seeing EOFException…
scottyab
  • 23,621
  • 16
  • 94
  • 105
5
votes
1 answer

Can Square Tape file backed queue be used from the main thread in android?

Square has an open source project name Tape http://square.github.io/tape/ that implements a persistent file backed queue. All of the examples seem to indicate that objects can be added to the queue from the main thread. However, every other best…
apschexn
  • 81
  • 1
  • 3
3
votes
0 answers

Successor to Square's Tape for persistent queues on Android

https://square.github.io/tape/ Is there modern alternative to Square's Tape library for implementing persistent queues on Android? I notice Tape hasn't been upgraded in a while, but trying to search for other solutions to the problem all seem to…
Mikey Chen
  • 2,370
  • 1
  • 19
  • 31
3
votes
3 answers

How can I ensure that my Android app doesn't access a file simultaneously?

I am building a fitness app which continually logs activity on the device. I need to log quite often, but I also don't want to unnecessarily drain the battery of my users which is why I am thinking about batching network calls together and…
2
votes
0 answers

Dagger to Inject a retrofit's service in a tape Task

I have a retrofit service : public interface MyService { @POST("/dosomething") String doSomething(@Part("param") MyType param); } and in a dagger module : @Provides @Singleton MyService provideService(RestAdapter restAdapter){ return…
Mouna Cheikhna
  • 38,870
  • 10
  • 48
  • 69
2
votes
1 answer

Using Square's Tape library how do i handle calling abstract classes

I'm using Square's Tape library and i've run in to a requirement where i basically need to have an abstract TapeTask class. The problem though is that the deserialization process for the GsonConverter (which implements the library's…
KG -
  • 7,130
  • 12
  • 56
  • 72
2
votes
0 answers

How do you remove "bad" Tasks from a Tape ObjectQueue?

I'm using Square's Tape library to persist HTTP Request Tasks to disk so that if I make a request and it fails due to things like network errors or server issues, the request won't be lost and can be tried again later. Is there a recommended…
Matthew
  • 6,356
  • 9
  • 47
  • 59
1
vote
1 answer

Queue file gets corrupted some times leading to JSONSyntax exception while peeking

I am using Square Tape Queue (https://github.com/square/tape/) in order to store data. But i find this weird text sometimes and this leads to "JSONSyntaxException : Expected BEGIN_OBJECT but found String" while reading from Queue.
androidbash
  • 390
  • 1
  • 4
  • 21
1
vote
0 answers

Using Google Volley with Square Tape on Android

Android noob here. I have been asked to fix an app some other noobs wrote for a hand held device a couple of months ago. The problem with it is that the devices are mostly used in areas where network is unreliable and weak. As a result, most of our…
341008
  • 9,862
  • 11
  • 52
  • 84