Please refer to the doodlydoo-sdk.jar file for library and the DoodleSampleActivity.zip (archived Android project) for the sample code. There is a range of properties and features supported by the SDK, however, for the sake of simplicity this document starts with the basic steps of getting started with the integration.
The doodlydoo-sdk.jar can be found in the libs folder of the sample project.
How do I integrate the doodle drawing?
-
Add the
doodlydoo-sdk.jarto thelibsfolder of your Android project -
Add
com.neuv.doodlydoo.doodleboard.DoodleViewto the requiredViewin the layout XML (reference available inres/layout/activity_doodle_sample.xml). -
Fire up the
Activityor theDialogwhich contains theDoodleView -
Start drawing
How do I play replay the drawn doodle on the screen?
(reference available in src/com/neuv/doodlydoo_sdk_sample/DoodleSampleOnClickListenerImpl)
-
Call
doodleView.previewDrawnDoodle()- This will replay the current doodle drawn on the screen and will allow the user to draw on the screen after play is finished. -
Call
doodleView.replayDoodle()- This will replay the current doodle drawn on the screen and depending the type of doodle being drawn (manually being drawn or an existing doodle being opened), it will decide whether after drawing is finished should it allow draw on the screen or not.
How do I save the content?
-
Call
doodleView.saveDoodle(DoodleSaveListener doodleSaveListener, String filePath, bool isCompressed)- This method saves the compressed file (ifisCompressedistrue) at the givenfilePath, else it saves the uncompressed folder (reference available insrc/com/neuv/doodlydoo_sdk_sample/DoodleSampleOnClickListenerImpl). -
DoodleSaveListenershould be implemented to handle the events of saving of the doodle. It has callbacks which tells about the start of the doodle save processvoid willSaveDoodle()and whether it was saved or not viavoid doodleSaved(String savedPath)andvoid failedToSaveDoodle()respectively (reference available insrc/com/neuv/doodlydoo_sdk_sample/DoodleSaveListenerImpl).
How do I replay the saved content?
Call doodleView.playSaveDoodle(String filePath, boolean isCompressed) - Send the filePath of the saved doodle as one of the argument. If isCompressed is true then the SDK will treat the data on filePath as compressed doodle data else as the path to the uncompressed folder.
##What else do I have in the SDK?
- Customizing the doodle drawing with various brush color and sizes
- Setting various image backgrounds to the
DoodleView - Capturing various stages of doodle drawing and playing
- Other auxilirary methods that would provide more flexibility to the SDK