This is my personal approach for a Google Drive application for Windows Phone!
It is not intended to be a full featured Google Drive client, but rather a way for me to show how I normally code my Windows Phone apps with an MVVM architecture, and also how you can easily create a Google Drive client for Windows Phone (since Google didn't build one themselves...)
Please feel free to fork, download, copy, change, alter, comment, trash...
The application is using Google Drive API version 2.
Currently, this is what you can do:
- Multiple accounts support
- OAuth 2 account login
- List files and folders with their metadata
- Navigate the folder tree
- Create new folders
- Upload files (just pictures, that's what Windows Phone SDK allows us to do!)
- Star/Unstar files
- Trash files
On my backlog, this is what you can find:
- Copy/Move files
- Improve caching
- Implement some sort of service call stack
- Use Google API RPC calls (in order to group requests, quite useful to get the files metadata)
- Fix leaks!
- Grab some cimbalino expresso coffee...
The project requires the following external components to work:
- MVVMLight Toolkit
- Cimbalino Windows Phone Toolkit
- Silverlight for Windows Phone Toolkit
To make things easier, the project is configured with NuGet ability to restore missing packages (available since version 1.6). You can read here about this feature and how you can activate it in your Visual Studio.
Also, before running the code you'll need to get access to the Google Drive API:
- Enter the Google APIs Console here.
- Go to Services and activate the Drive API. Read the presented Terms of Service, check the "I agree" checkbox and click "Accept".
- Go to API Access, and click on "Create an OAuth 2.0 client ID...".
- Enter a product name, click "Next".
- Check "Installed application" and "Other" on the "Application type" and "Installed application type" option groups respectively. Click on "Create client ID".
- You can now copy the Client ID and Client secret values back to the ViewModelLocator.cs, updating the two constants on top of the file, with these values.
- Build the code, run the app, test it now!
- Google Drive SDK API Reference
- Google APIs Explorer
- Google Accounts Authentication and Authorization: Using OAuth 2.0 for Login
See the LICENSE.txt file for details.