DK Development

The random output of a Windows developer.

DK Development

The random output of a Windows developer.




DropNet2 - async/await, WinRT and more!

UPDATE: DropNet2 has now been renamed to DropNetRT, check out the DropNetRT documentation for more details

DropNet has been in NuGet now for 2 years! (As of March 31st). Which means its getting old and some of the methods and technologies it was built off are out of date.

Working on my own Windows Phone Dropbox client BoxShot I started running into some limitations of DropNet then finding that DropNet was actually being held back from by RestSharp. No offence to John Sheehan or any of the RestSharp contributers, they have built an excellent library which still use for numerous projects. However I wanted something more flexible and I wanted to use new technologies such as async/await and support for WinRT (ARM).

So it was time to rewrite DropNet from the ground up using not RestSharp but the new portable HTTP Client from Microsoft's Base Class Library which now supports Windows Phone (7.5+).

And here it is: DropNet2 (I'm not very good at naming things). Source is available on Github including a basic Windows Phone 8 sample project (login and folder contents functionality).

Fork

What different about it you say? Lets have a look at the code. I kept the API pretty similar to the original.

{
	var client = new DropNetClient("APIKEY", "APPSECRET");
	client.SetUserToken("TOKEN", "SECRET");

	var rootMetaData = await client.GetMetaData("/");
	var myFile = await client.GetFile("/MyFile.txt");
}

supported API functions

  • oauth/request_token
  • oauth/access_token
  • account/info
  • metadata
  • shares
  • search
  • media
  • files (GetFile and Upload)
  • fileops/delete
  • fileops/copy
  • fileops/move
  • fileops/create_folder
  • thumbnails
  • delta


platform support

  • .NET 4.5
  • .NET for Windows Store apps (WinRT)
  • Windows Phone 7.5 and higher
  • Silverlight 4 and higher


future plans

  • Implement remaining API functions
  • Progress feedback on upload and download functions
  • Better error handling
  • Support for Mono
  • Unit Tests
blog comments powered by Disqus