-1

i have view with canvas undo array(bitmap array), paint array, background bitmap, paths.

now i want to give functionality that user can save view as draft and can use anytime in future.

so how to store whole view locally in file or sqlite or sharedpreference?

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Soham Pandya
  • 386
  • 1
  • 14

1 Answers1

1

The best way is to record all user input (by do this recording procedure in the "onTouch()" or "onGenericMovement()" methods/events) like touch coordinates, pressures, size of the "pen", etc...and then replicate them at runtime when you will have to display the draft again. Storing many undo_Bitmaps could be a waste of storage/database space and could take many seconds depending of the size of the display area. I suggest to store all these informations in a BINARY file that is very fast during the reading/writing procedure.

emandt
  • 2,547
  • 2
  • 16
  • 20