0

We have an image on the canvas and would like to SAVE the mouse clicks simultaneously with the time at which each mouse click occurred to a file.

This will be an Ipad/Android app. So far we have the mouse coordinates and the time. But how can we save that information to a file? localStorage?

What are your thoughts?

Regards,

HCAI
  • 2,213
  • 8
  • 33
  • 65

1 Answers1

0

It depends on what you want to do with the data you save. If the client application has to remember the data, localStorage is ok, it is implemented in most modern browsers including those on iOS and android.

But the user can clear this local memory like he can erase cookies and cache memory, so the real question is :

How are you going to reuse the data you save ?

How to use localStorage on w3cschool http://www.w3schools.com/html5/html5_webstorage.asp

EDIT

Considering your response, what you want is to save to a file on the user computer. This is not possible using simple javascript (you need browser plugins) for security reasons (read this topic Read/write to file using jQuery ). This plugin is interesting http://jquery.tiddlywiki.org/twFile.html

But, since the files you want to save are simple data and not heavy at all, you might wanna save the files to the server (or even entries in database) so you won't bother the user with install stuff (that might lead them to flee). He would access his file no matter the computer (or mobile device) he uses. The downside is that the user has to log into your application to access his files.

Community
  • 1
  • 1
jazzytomato
  • 6,994
  • 2
  • 31
  • 44
  • The usage is as follows: Regions in the image are clicked sequentially and the coordinates+time are recorded. We would like these to be saved to a new file when a 'New file' button is clicked. However here's my worry: The canvas is to be used offline. Is there a way of saving the datafiles locally to be retrieved later and fed into a database? Please ask if you require further clarification – HCAI May 04 '12 at 14:15
  • I think it is inappropriate to use HTML5-Canvas offline... Why would it be offline I don't get it – jazzytomato May 04 '12 at 14:42
  • Could you clarify your last commend please? Would you suggest a different way of developing this app if no internet connection was available? In fact only a list of buttons is needed (the picture was just more intuitive for the end user) and the user will click them sequentially but we still need to record the time of each click... – HCAI May 04 '12 at 16:28
  • Can this be done though on for an Ipad without going through the Appstore? – HCAI May 07 '12 at 08:13
  • No you can't, sorry I forgot about the mobile thing... :o With regard to what you want, you'll probably have to make concessions – jazzytomato May 07 '12 at 10:15
  • Hi Thomas, could you explain what concessions you are referring to? Everywhere I read it is implied that `Localstorage` requires internet connection, however does not say so explicitly... Is there any way round this? – HCAI May 09 '12 at 11:42