Code Monkey home page Code Monkey logo

storage-blob-xamarin-image-uploader's Introduction

services platforms author
storage
xamarin
pcibraro

Azure Storage Service - Photo Uploader Sample using Xamarin for Android, iOS and Windows.

This sample demostrates how to upload photo images from the gallery in Android, iOS and Windows Phone into a Block blob in Azure Storage with Xamarin. It shows a button "Select Image" to select an image from the gallery, a button "Upload Image" to upload it to the Azure Storage, a button "List images" to list all the uploaded images. A Shared Asset Project is used for reusing all the common code for the platform specific projects.

Note: This sample uses the Windows Azure Storage client library for .NET available through a Nuget package.

If you don't have a Microsoft Azure subscription you can get a FREE trial account here.

Running this sample in Windows with Visual Studio

This sample can be run using either the Azure Storage Emulator that installs as part of the Windows Azure SDK - or by updating the StorageConnectionString variable defined at Configuration.cs file in the Shared Native Library Project.

To run the sample using the Storage Emulator (Windows Azure SDK / Only on Windows):

  1. Download and Install the Azure Storage Emulator here.
  2. Start the Azure Storage Emulator (once only) by pressing the Start button or the Windows key and searching for it by typing "Azure Storage Emulator". Select it from the list of applications to start it.
  3. Set breakpoints and run the project using F10.

To run the sample using the Storage Service

  1. Open the Configuration.cs file in the Shared Native Library Project "XamarinImageUploader". Replace the StorageConnectionString variable (UseDevelopmentStorage=True) with the connection string for the storage service (AccountName=[]...)
  2. Create a Storage Account through the Azure Portal and provide your [AccountName] and [AccountKey] in the StorageConnectionString variable.
  3. Set breakpoints and run the project using F10.

WARNING: Only use Shared Key authentication for testing purposes! Your account name and account key, which give full read/write access to the associated Storage account, will be distributed to every person that downloads your app. This is not a good practice as you risk having your key compromised by untrusted clients. Please consult following documents to understand and use Shared Access Signatures instead. https://docs.microsoft.com/en-us/rest/api/storageservices/delegating-access-with-a-shared-access-signature and https://docs.microsoft.com/en-us/azure/storage/common/storage-dotnet-shared-access-signature-part-1

Note: You can also run the sample with Xamarin Studio, but only the Android and iOS samples will be available. For the Windows Phone sample, you can only use Visual Studio.

More information

storage-blob-xamarin-image-uploader's People

Contributors

dineshmurthy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

storage-blob-xamarin-image-uploader's Issues

Massive blog image file size

Thanks for the sample code very helpful, but I'm stuck with one issue I don't understand. Images taken on my iPhone 7 are only 2-3MB in size when I copy them directly off the phone (via usb cable to PC), but when I use this sample code to upload the image files to Azure's blob storage the files increase to 10-25MB in size.

Any ideas why?

iOS Image Uploading in Background

My understanding of this sample is that iOS will not be able to continue uploading an image if the app is put in the background because NSUrlSession is not being used by the Azure library.

Am I correct in this? It seems to me that in a production app, you would need to make your own calls to Azure Storage without using a library.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.