06-06-2013 06:13 PM
OK - I know what Phil's after now so here's the problem
You have a small amount of text to transmit to the user but you can't be sure that you're online
This is a situation that happens a lot - SMS is the most obvious example like that I can think of
In cases like this you need to know something has happened so that you can try again if it fails
A simple example would be to use local storage (LS for brevity) - here's how that scanario would go
1) write a JSON record to LS
2) try to send it
3) did it go?
Depending on the answer to (3) leave it where it is in LS (failed) or delete it from LS (went)
This provides any app with resiliance when transferring information to an external source
The important thing is catering for the cases where your initial message didn't get through and you have to cater for as many as viable
Things that can go wrong are numerous, the worst example I can think of is that the server and device are up but the signal is bad so it gets garbled on the way.
For this reason I would suggest hashing your data before send then get the endpoint to reply with its own hash of the data it got - compare the numbers, if same it got thru
I would also number the messages sent as you may send more than one at the same time and you won't know which one comes back first
For failed messages you need to try resending them every so often
Basically everything lives on the device until it's hit somewhere you know it can reliably be transferred from
Once it's gone, remove it from LS and forget about it
06-06-2013 06:50 PM
Seems pointless to connect to a server. Sending data from the device to the server and back to the device?
I think I used filesystem api in the past to save a Base64 so maybe that code can be modified for CSV.
It would be awesome if in the future BlackBerry allowed you to invoke the browser with a datastring.
06-06-2013 07:18 PM
We can continue this in private if you like but the above is your basic method of knowing it went thru.
Obviously the download button on your app wants to transfer data [somewhere] and not back onto the device
If you simply ask me the Q you want answered
Handshaking is extremely important.
Send a message and confirm reciept of the message without ambiguity - the reply is small regardless of the size of the sent data
For example, we've got that encryption extension on git now - that would quickly calc a MD5 / SHA1
You're after hash compare ONLY
I could send a gig to a server and know it arrived simply via a hash returned via AJAX
I don't see the problem