Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save srivastavarobin/6022270 to your computer and use it in GitHub Desktop.
Save srivastavarobin/6022270 to your computer and use it in GitHub Desktop.

How-Do-I Guide for Doodly Doo SDK

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?

  1. Add the doodlydoo-sdk.jar to the libs folder of your Android project

  2. Add com.neuv.doodlydoo.doodleboard.DoodleView to the required View in the layout XML (reference available in res/layout/activity_doodle_sample.xml).

  3. Fire up the Activity or the Dialog which contains the DoodleView

  4. Start drawing

How do I play replay the drawn doodle on the screen?

(reference available in src/com/neuv/doodlydoo_sdk_sample/DoodleSampleOnClickListenerImpl)

  1. 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.

  2. 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?

  1. Call doodleView.saveDoodle(DoodleSaveListener doodleSaveListener, String filePath, bool isCompressed) - This method saves the compressed file (if isCompressed is true) at the given filePath, else it saves the uncompressed folder (reference available in src/com/neuv/doodlydoo_sdk_sample/DoodleSampleOnClickListenerImpl).

  2. DoodleSaveListener should be implemented to handle the events of saving of the doodle. It has callbacks which tells about the start of the doodle save process void willSaveDoodle() and whether it was saved or not via void doodleSaved(String savedPath) and void failedToSaveDoodle() respectively (reference available in src/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?

  1. Customizing the doodle drawing with various brush color and sizes
  2. Setting various image backgrounds to the DoodleView
  3. Capturing various stages of doodle drawing and playing
  4. Other auxilirary methods that would provide more flexibility to the SDK
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment