azure media service for xamarin? - xamarin

I have created a console application with azure media service.
in the app i am using the plugin
windowsazure.mediaservices
the way i am doing is
static IAsset CreateAssetAndUploadSingleFile(string filePath, string assetName, AssetCreationOptions options)
{
IAsset asset = _context.Assets.Create(assetName, options);
var assetFile = asset.AssetFiles.Create(Path.GetFileName(filePath));
assetFile.Upload(filePath);
return asset;
}
so i just want to know whether this plugin will work on xamarin(i am not a xamarin devoloper) as its a portable project.
if its not do we have any alternative plugin?
my basic purpose is upload and encode.

That package is for our current .NET SDK
https://www.nuget.org/packages/windowsazure.mediaservices
It does not support .NET Core. See the dependencies.
It's not compiled for Xamarin though, so I don't believe that it works in Xamarin, but i'm not a Xamarin expert at all.
What is your scenario exactly? Why would you want to call the Media Services account directly from Xamarin anyways? You would only need to do that if you are creating a management application for the account Administrator. Otherwise, dont put Media Services directly into any client code! You should hide it in your middle-tier, and only pass Streaming URLs or SAS locators to the client application to upload content to.
For the upload from phone scenario, middle tier should create an Asset, get a writable SAS Locator for the Asset, hand that to the client side. Client can then use Azure Storage APIs to upload the content to that SAS URL directly (it ends up in an Azure storage container then.)
I believe that Xamarin has client side support for the Azure Storage APIs available.

As john answered, you don't do this stuff on a client, you will need to use SaS tokens and what not. I could explain everything here, but there are some nice guides and examples online.
Build 2018 video explaining how it works (including Azure Functions): https://www.youtube.com/watch?v=dEZkQNNpSIQ&feature=youtu.be&rel=0
The github example of this video: https://github.com/Azure-Samples/xamarin-azure-businessreview
To understand it better, I recommend this guide, it is old but it does cover the entire process, just make sure to combine new documentation with this old one.
Old docu: https://learn.microsoft.com/en-us/previous-versions/msp-n-p/dn735912(v%3dpandp.10)
Official current documentation: https://learn.microsoft.com/en-us/azure/media-services/previous/media-services-dotnet-upload-files#upload-multiple-files-with-media-services-net-sdk
Probably useful for new readers.

Related

How to Enable the Client-side Logging with the Azure Storage Client Library(Ver 12) for Java

I want to log the request/response at client site with Azure blob storage for Java sdk(ver12).
In microsoft online document [https://learn.microsoft.com/en-us/rest/api/storageservices/client-side-logging-with-the-microsoft-azure-storage-sdk-for-java], I found this sample code.
// Set logging off by default.
OperationContext.setLoggingEnabledByDefault(false);
OperationContext ctx = new OperationContext();
ctx.setLoggingEnabled(true);
// Create an operation to add a new customer to the people table.
TableOperation insertCustomer1 = TableOperation.insertOrReplace(customer1);
// Submit the operation to the table service.
table.execute(insertCustomer1, null, ctx);
But it does not work. OperationContext can not be found in libs. Maybe it is a older version sample.
I hope someone can give me a sample code, Thanks.
The OperationContext is a class of com.microsoft.azure.storage, while the latest version is 8.6.3.
You can get the OperationContext class in Microsoft Azure Storage SDK v8 for Java.
If you would like to access our latest Java SDK, please refer to the Storage SDK v12 for Java link in the table below. If you would like more information on our decision to upgrade our Java SDK and the path forward, please refer to this document. If you would like more information on Azure's burgeoning effort to coordinate the development of the SDKs across services, of which this change is a part, please refer to this article.

Need to tell users when update occurs

I want to notify all the app users to update the app (through a popup in the app itself) whenever there is a new version deployed in the stores. Can someone suggest the best way to do that?
Luckily, we do have solution for iOS app store
string url = "http://itunes.apple.com/lookup?bundleId=com.xxx.xxxxx";
HttpClient httpClient = new HttpClient();
Task<string> jsonString = httpClient.GetStringAsync(string.Format(
var lookup = JsonConvert.DeserializeObject<Dictionary<string, object>>(jsonString.Result);
But Now I need to get the current version of App from Google Play Store?
Let's say you want to notify the users about a new version of the app every time they open the application, then you should just trigger a simple GET call to retrieve the latest version info or use a third party lib to act accordingly.
0 cost simple solutions
One option would be to ask the API (if there is any) if a new version is available - basically delegate the problem to someone else. If there is no backend the app could do the check itself. There are different options from having a simple txt file hosted somewhere with the latest app version to scraping App Store and Play Store for the current published version of the app.
Existing solutions
https://appgrades.io/
https://github.com/ArtSabintsev/Siren
Use Push Notifications to notify your users
You will find more if you google it
Platform specific solutions
For iStuff (Apple) you could use iTunes Search API as mentioned here
Other platforms may have their own APIs
Depends on the specific case you can decide what will work better for you.
P.S.: Be sure to handle the versioning correctly by bumping the app version on each release.

Is there a way to translate a Fusion 360 model to Inventor without creating an App?

From Translate a Source File into OBJ Format:
Before You Begin
Register an app
Successfully acquire an OAuth token with the data:write and data:read scopes.
Upload a source file to OSS, as described in the Create an App-Managed Bucket and Upload a File tutorial, and note the source URN.
I assume that the above steps are to be followed to translate a Fusion 360 model to an Inventor model.
I find it very inconvenient to create an App for the sole purpose of translating a Fusion 360 model to Inventor. I would like to avoid creating such an App.
Is there a way to translate/export a Fusion 360 model to Inventor without creating an App or without using the interactive web interface? If there is, can you please answer with the steps and/or point to a place where I can find that information?
Unfortunately, converting a Fusion 360 model to Inventor file format is only possible interactively on the A360 website at the moment.
Fusion 360 does have an API (see ExportManager object) but it only exposes those file formats which the desktop app can convert to directly, and are available through File >> Export:
Converting from Fusion 360 to Inventor file format might be possible through the Forge API's later on, but still, you'd have to register an App on the Forge developer site in order to use it.
There is a confusion here - the Autodesk Forge API is not meant to translate from Fusion360 to Inventor today (as August 22nd, 2016). We may add this possibility later, but Fusion360 can import from/export to Inventor native. Checkout this post for more details, it contains a lot of details on how to import or export as well as the format supported. Hope that helps,

Is it possible for extensions access the containing-app's container directory?

Is it possible for extensions access the containing-app's container directory?
For iOS5-based app, i don't want to move all my old data into shared-contatiner, i wish that main-app can remain the same, and the extension just read & write the old data directly, that will be perfect!~
Your widget may never access the containing app's data directly, only if the containing app puts that data into a shared container using app groups. The documentation (including the WWDC videos) is pretty clear about this.
There's a high chance that your iOS-5-based app needs major changes anyway to work nicely on iOS 8.

How To upload a Photo To Azure Blob with SAS from a WP App?

I am able to upload photos to blob with SAS from an Azure MVC web role with the code below:
using (var WS = new HLServiceClient())
{
/* Getting a SAS Write URI */
var sasUri = WS.GetSasUriForBlobWrite(HLServiceReference.BusinessLogicMediaUsage.News, fileName);
var writeBlob = new CloudBlob(sasUri);
writeBlob.UploadFromStream(fileData.InputStream);
}
I would like to do the same thing from a WP app. But I can't figure out how to do it. I DON'T HAVE A LOT OF PROGRAMMING SKILL.
Can you tell me how to upload a photo to blob from a WP app with SAS?
There is a Windows Azure Storage Client Library for Windows Phone available on NuGet: Phone.Storage, it says "Class library for Windows Phone to communicate with Windows Azure storage services directly", I was hoping to find a simple solution using that: http://www.nuget.org/packages/Phone.Storage
I found a video tutorial on the Phone.Storage NuGet:
http://channel9.msdn.com/posts/Using-the-Windows-Phone-Storage-NuGets-for-Windows-Azure
There is also a sample application demonstrating the usage of the Phone.Storage NuGet.
http://www.nuget.org/packages/Phone.Storage.Sample
Still, though, it evades me if I can implement this in my application scenario?
First, you need to generate the SAS from a hosted service. You can use the CloudBlob.GetSharedAccessSignature method (refer to http://msdn.microsoft.com/en-us/library/windowsazure/ee772922.aspx for a sample).
On the Windows Phone side, for small files, you simply need to issue an HTTP request to the SAS URL. You can use HttpWebRequest to do that. Try to search the web, and you can find a lot of samples, such as http://blogs.msdn.com/b/devfish/archive/2011/04/07/httpwebrequest-fundamentals-windows-phone-services-consumption-part-2.aspx.
For large files (larget than 64 MB), you need to divide them into smaller pieces, upload each piece as a block, and then commit the blob list (PUT block list: http://msdn.microsoft.com/en-us/library/windowsazure/dd179467). This is a tedious but not difficult task. You need to create quite a few HTTP requests.
The Windows Azure Toolkit for Windows Phone may also help: http://watwp.codeplex.com/. It contains a library that is similar to the Windows Azure library for .NET.

Resources