Cache images using MD5 hash instead of random UUID

Use an MD5 hash of the Bitmap contents instead of a random UUID for each
image, so that multiple images will not be stored on disk for the same
resource. If the same content is use for an additional image field of
DataCard or DataCardImage, the existing cached image will be reused.

Change-Id: Ie36d6e7cb745a58d9c01ddf1a00ad19e839f478c
Fix bug so new cards are built with builder.

In CmHomeApiCardProvider, new cards were still instantiating the base
card ApiCard class, instead of using the proper DataCardBuilderFactory.
Fixed this.

Change-Id: Ide11aa30f288113ae82b122818ddd1927b07df5d
CmHome : Add updates for apiCard

Change-Id: I4378e96bcb4220861935735670f5bde562c5309b
Move stream close into it's own try/catch.

One stream could possibly not be closed when storing cached bitmap
images. Move this into its own try/catch to fix this bug.

Change-Id: I8a6f1385ba28aabe3eb97afaaba84cfa7c5d61fd
Fix DataCard publish and unpublish issues.

Cards were not using their updated ContentProvided authority to
unpublish and publish. Fix these problems. Unpublish was incorrectly
deleting the DataCard before deleting related images, which would fail
as they have a foreign key referencing the DataCard. Delete images
first, then the DataCard.

Change-Id: Id770a87d9badf7f0f35398996f3849104e6a8f8a
Support a broadcast when cards are deleted.

If the extension developer chooses to implement a BroadcastReceiver that
subclasses CmHomeCardChangeReceiver, they can receive a broadcast every
time a card is deleted with information about that card.

Change-Id: I6f8f593647be5296c8999df344a8f8fe8e91f15b
CmHome : Make api cards unpublish on swipe

Change-Id: I89aed9dc3b22b4cd8cee9da1822276e6fc44532c
Set the card ID if updating from DataCard.

If an ApiCard is updated with a new backing DataCard, set the ID to the
correct value.

Change-Id: I05d7fddc6434630949c15678bfa282c0c4f3b14c
Add constructor to DataCardImage without DataCard.

Change-Id: Ib7b075b34d577c07bc8136b25e4c69c970734c5b
Avert confusion by renaming DataCard to CardData.

Massive confusion has been reported by many, due to the fact that the crucial
object backing DataCards is also called DataCard. Which is also not to
be confused with any other type of card. Cards, cards, cards...

SO... bite the bullet and rename all of the many instances of *Data*Card*
to CardData, as this object represents the data that backs an actual card.

Change-Id: I17a035cfd56c46f04da339b143a6289518b1deb7
Monitor for any API package changes.

Update cards in memory and display/remove them if a CM Home API extension has been installed,
removed or changed. Track and display changes to any CardDataImage rows
in any of the API ContentProviders. Any change to a CardDataImage row
will be reflected in the associated DataCard.

Change-Id: Ia4c2978638ee281cd9b9e38bcd1856adf9731278
Implement onDestroy handling for providers.

Implement onDestroy that host applications will call for CardProviders.
Call CMHomeApiManager.destroy() when this happens to release
ContentObservers and unregister the BroadcastReceiver.

Change-Id: I47c19a301d01ecb89cb545feb6dec6a237704853
Add Javadocs for SDK.

Change-Id: Id402b7cd5f4522bf0bb35835d492398ee9ae09cc
Update README.md to include an sdk tutorial.

Change-Id: I6349a8387c596c4b1a1cacfb47317d1dfab0a474
Fix bugs related to deleting CardDataImage rows.

Extension apps and/or Catapult could crash because IDs were not handled
correctly. Fixed that. Removed extra '/' in Uri path constants. Fixed id
parsing in PublishableCard.

Change-Id: Icc730383f50680b34fce8768967c91e5ff8e72ba
Refactor cards so that API card extends a base Card.

Change-Id: I0ad0e3750998625e318cbb74d67180d6c8cab93e
Do not unregister BroadcastReceiver multiple times.

Although the package changed BroadcastReceiver in CMHomeApiManager
should be registered and unregistered exactly once, in some cases it
could be unregistered multiple times. Prevent this by setting the
reference to null on the first unregister.

Change-Id: I0e50679a88db0b72630162814dd6ecfda669ac9b
Unpublish CardDataImages on CardData unpublish.

Force CardDataImages to be a child of exactly one CardData. Remove any
CardDataImages that have been removed from a CardData when a CardData is
published.

Change-Id: Id658a8064209ccda77ac1213eb016a221696d8c8
Handle the case where a CardData no longer matches.

If a CardData has mutated to the point where it no longer matches it's
original card, remove the first card and re-add it as a new one. Adjust
the thread handling so that the CmHomeApiCardProvider and
CMHomeApiManager no longer worry about thread handling. Let CM Home make
sure UI updates occur on the main thread.

Change-Id: I26f022fa208adda119c5f24d86adf3ef163193a2
Hide internal methods from documentation.

Change-Id: I5d37031a19b9d5939e01bab68132dbb5027c338d