diff --git a/ChangeLog.txt b/ChangeLog.txt index 126f399..b86de01 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,4 +1,7 @@ -2014.12.22 Version 0.4.0 +2015.01 Version 0.4.1 + * Fixed a bug for Android 5.0 only that caused auth failures on deletes. + +2014.12 Version 0.4.0 * Deprecated getSubDirectoryReference() for blob directories and file directories. Use getDirectoryReference() instead. * Fixed a bug where maxResults was not verified to be positive for list operations. * Deprecated AuthenticationScheme and its getter and setter. In the future only SharedKey will be used. @@ -6,15 +9,15 @@ * Fixed a bug where high precision Date values stored on Table Entites were forced to fit into milliseconds resulting in inaccuracies. Precision is limited to 1 millisecond by the Android Date class. If greater precision is required, the String should be used directly. * Added TableRequestOptions.dateBackwardCompatibility, which supports reading Date values on Table Entities written using versions of this library prior to 0.4.0. See http://go.microsoft.com/fwlink/?LinkId=523753 for more details. -2014.10.10 Version 0.3.1 +2014.10 Version 0.3.1 * Fixed a bug where a NullPointerException was thrown instead of a NetworkOnMainThreadException if code was executed on the main thread. -2014.08.01 Version 0.3.0 +2014.08 Version 0.3.0 * Added the NameValidator class which contains helpers that check to see if resource names are valid. * Fixed a bug where the RequestUrl of a LogRecord was not correctly HTML4 decoded. * Made FileRange class and ListFilesAndDirectories method in the CloudFileDirectory class public. -2014.07.02 Version 0.2.0 +2014.07 Version 0.2.0 * Added File Service support. The File Service and the associated SDK APIs are in preview. * Added CloudAnalyticsClient and related methods to simplify Storage Analytics logging and metrics use case scenarios. * Fixed a bug where an empty file would be left over during the downloadToFile error case. diff --git a/README.md b/README.md index e716e8b..590a188 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ First, add mavenCentral to your repositories by adding the following to your gra Then, add a dependency by adding the following to your gradle build file: dependencies { - compile 'com.microsoft.azure.android:azure-storage-android:0.3.0@aar' + compile 'com.microsoft.azure.android:azure-storage-android:0.4.1@aar' } ###Option 4: aar via Maven @@ -55,7 +55,7 @@ To get the binaries of this library as distributed by Microsoft, ready for use w com.microsoft.azure.android azure-storage-android - 0.3.1 + 0.4.1 aar ``` @@ -77,63 +77,9 @@ Make sure the storage client library is added as a project dependency. If using If using Maven or Gradle, Jackson-Core should be automatically added to the build path. Otherwise, please download the jar and add it to your build path. Also, please make sure that the jar will be added to your project's apk. To do this in Eclipse, right click your project, select "Build Path->Configure Build Path", navigate to the "Order and Export" tab and check the box next to the jackson-core jar. -##Code Sample - -The following is a quick example on how to upload a file to azure blob and download it back. You may also download and view the samples in the microsoft-azure-storage-samples folder. For additional information on using the Android client library, the Java [general documentation](http://azure.microsoft.com/en-us/develop/java/) and Java How To guides for [blobs](http://azure.microsoft.com/en-us/documentation/articles/storage-java-how-to-use-blob-storage/), [queues](http://azure.microsoft.com/en-us/documentation/articles/storage-java-how-to-use-queue-storage/), [tables](http://azure.microsoft.com/en-us/documentation/articles/storage-java-how-to-use-table-storage/) may be helpful. - -```java -import java.io.*; - -import com.microsoft.azure.storage.*; -import com.microsoft.azure.storage.blob.*; - -public class BlobSample { - public static final String storageConnectionString = - "DefaultEndpointsProtocol=http;" - + "AccountName=your_account_name;" - + "AccountKey= your_account_key"; - - public static void main(String[] args) { - try { - CloudStorageAccount account = CloudStorageAccount.parse(storageConnectionString); - CloudBlobClient serviceClient = account.createCloudBlobClient(); - - // Container name must be lower case. - CloudBlobContainer container = serviceClient.getContainerReference("myimages"); - container.createIfNotExists(); - - // Set anonymous read access on the container. - BlobContainerPermissions containerPermissions = new BlobContainerPermissions(); - containerPermissions.setPublicAccess(BlobContainerPublicAccessType.CONTAINER); - container.uploadPermissions(containerPermissions); - - // Upload an image file. - CloudBlockBlob blob = container.getBlockBlobReference("image1.jpg"); - File sourceFile = new File("c:\\myimages\\image1.jpg"); - blob.upload(new FileInputStream(sourceFile), sourceFile.length()); - - // Download the image file. - File destinationFile = new File(sourceFile.getParentFile(), "image1Download.tmp"); - blob.downloadToFile(destinationFile.getAbsolutePath()); - } - catch (FileNotFoundException fileNotFoundException) { - System.out.print("FileNotFoundException encountered: "); - System.out.println(fileNotFoundException.getMessage()); - System.exit(-1); - } - catch (StorageException storageException) { - System.out.print("StorageException encountered: "); - System.out.println(storageException.getMessage()); - System.exit(-1); - } - catch (Exception e) { - System.out.print("Exception encountered: "); - System.out.println(e.getMessage()); - System.exit(-1); - } - } -} -``` +##Code Samples + +Runnable samples for blob, queue, and table may be found in the microsoft-azure-storage-samples directory. To run these samples, specify a connection string in the MainActivity class and add a dependency on the Android client library. For additional information on using the Android client library, the Java [general documentation](http://azure.microsoft.com/en-us/develop/java/) and Java How To guides for [blobs](http://azure.microsoft.com/en-us/documentation/articles/storage-java-how-to-use-blob-storage/), [queues](http://azure.microsoft.com/en-us/documentation/articles/storage-java-how-to-use-queue-storage/), [tables](http://azure.microsoft.com/en-us/documentation/articles/storage-java-how-to-use-table-storage/) may be helpful. #Need Help? diff --git a/microsoft-azure-storage-samples/AndroidManifest.xml b/microsoft-azure-storage-samples/AndroidManifest.xml index 37c8d4f..8bc8ff4 100644 --- a/microsoft-azure-storage-samples/AndroidManifest.xml +++ b/microsoft-azure-storage-samples/AndroidManifest.xml @@ -1,13 +1,28 @@ + android:versionName="0.4.1" > + android:targetSdkVersion="21" /> + + + + + + + + + \ No newline at end of file diff --git a/microsoft-azure-storage-samples/res/drawable-hdpi/ic_launcher.png b/microsoft-azure-storage-samples/res/drawable-hdpi/ic_launcher.png new file mode 100644 index 0000000..288b665 Binary files /dev/null and b/microsoft-azure-storage-samples/res/drawable-hdpi/ic_launcher.png differ diff --git a/microsoft-azure-storage-samples/res/drawable-mdpi/ic_launcher.png b/microsoft-azure-storage-samples/res/drawable-mdpi/ic_launcher.png new file mode 100644 index 0000000..6ae570b Binary files /dev/null and b/microsoft-azure-storage-samples/res/drawable-mdpi/ic_launcher.png differ diff --git a/microsoft-azure-storage-samples/res/drawable-xhdpi/ic_launcher.png b/microsoft-azure-storage-samples/res/drawable-xhdpi/ic_launcher.png new file mode 100644 index 0000000..d4fb7cd Binary files /dev/null and b/microsoft-azure-storage-samples/res/drawable-xhdpi/ic_launcher.png differ diff --git a/microsoft-azure-storage-samples/res/drawable-xxhdpi/ic_launcher.png b/microsoft-azure-storage-samples/res/drawable-xxhdpi/ic_launcher.png new file mode 100644 index 0000000..85a6081 Binary files /dev/null and b/microsoft-azure-storage-samples/res/drawable-xxhdpi/ic_launcher.png differ diff --git a/microsoft-azure-storage-samples/res/layout/activity_main.xml b/microsoft-azure-storage-samples/res/layout/activity_main.xml new file mode 100644 index 0000000..25b5590 --- /dev/null +++ b/microsoft-azure-storage-samples/res/layout/activity_main.xml @@ -0,0 +1,8 @@ + + diff --git a/microsoft-azure-storage-samples/res/layout/fragment_main.xml b/microsoft-azure-storage-samples/res/layout/fragment_main.xml new file mode 100644 index 0000000..fcba066 --- /dev/null +++ b/microsoft-azure-storage-samples/res/layout/fragment_main.xml @@ -0,0 +1,70 @@ + + + + +