Permalink
Browse files

Mobile: many new and updated tutorials

  • Loading branch information...
1 parent 06ba5b6 commit 4faf0d95e939288efa96b4e41729f853aa4ab1ea @ggailey777 ggailey777 committed Mar 27, 2014
Showing with 447 additions and 212 deletions.
  1. BIN articles/media/mobile-services-dotnet-backend-android-get-started/mobile-data-browse.png
  2. BIN articles/media/mobile-services-dotnet-backend-android-get-started/mobile-data-tab.png
  3. BIN articles/media/mobile-services-dotnet-backend-android-get-started/mobile-eclipse-quickstart.png
  4. BIN ...les/media/mobile-services-dotnet-backend-android-get-started/mobile-portal-quickstart-android.png
  5. BIN .../media/mobile-services-dotnet-backend-android-get-started/mobile-quickstart-completed-android.png
  6. BIN ...es/media/mobile-services-dotnet-backend-android-get-started/mobile-quickstart-startup-android.png
  7. BIN articles/media/mobile-services-dotnet-backend-android-get-started/mobile-quickstart-steps-vs.png
  8. BIN ...dia/mobile-services-dotnet-backend-android-get-started/mobile-services-import-android-project.png
  9. BIN ...a/mobile-services-dotnet-backend-android-get-started/mobile-services-import-android-workspace.png
  10. BIN articles/media/mobile-services-dotnet-backend-ios-get-started/mobile-quickstart-steps-ios.png
  11. BIN .../media/mobile-services-dotnet-backend-schedule-recurring-tasks/add-linq2twitter-nuget-package.png
  12. BIN articles/media/mobile-services-dotnet-backend-schedule-recurring-tasks/create-new-job.png
  13. BIN articles/media/mobile-services-dotnet-backend-schedule-recurring-tasks/manage-sql-azure-database.png
  14. BIN ...les/media/mobile-services-dotnet-backend-schedule-recurring-tasks/mobile-schedule-new-job-cli.png
  15. BIN articles/media/mobile-services-dotnet-backend-schedule-recurring-tasks/mobile-services-selection.png
  16. BIN articles/media/mobile-services-dotnet-backend-schedule-recurring-tasks/sample-job-run-once.png
  17. BIN .../mobile-services-how-to-register-twitter-authentication/mobile-services-twitter-register-app1.png
  18. +2 −2 articles/mobile-services-android-get-started.md
  19. +148 −0 articles/mobile-services-dotnet-backend-android-get-started.md
  20. +54 −0 articles/mobile-services-dotnet-backend-how-to-use-code-first-migrations.md
  21. +167 −144 articles/mobile-services-dotnet-backend-schedule-recurring-tasks.md
  22. +2 −2 articles/mobile-services-dotnet-backend-windows-phone-get-started-users.md
  23. +3 −56 articles/mobile-services-windows-phone-get-started-users.md
  24. +13 −1 includes/mobile-services-dotnet-backend-create-custom-api.md
  25. +2 −0 includes/mobile-services-filter-user-results-dotnet-backend.md
  26. +3 −7 includes/mobile-services-restrict-permissions-dotnet-backend.md
  27. +53 −0 includes/mobile-services-windows-phone-authenticate-app.md
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -14,10 +14,10 @@
<a href="/en-us/documentation/articles/mobile-services-javascript-backend-phonegap-get-started/" title="PhoneGap">PhoneGap</a>
</div>
-<!--<div class="dev-center-tutorial-subselector">
+<div class="dev-center-tutorial-subselector">
<a href="/en-us/documentation/articles/mobile-services-dotnet-backend-android-get-started/" title=".NET backend">.NET backend</a> |
<a href="/en-us/documentation/articles/mobile-services-android-get-started/" title="JavaScript backend" class="current">JavaScript backend</a>
-</div>-->
+</div>
<div class="dev-onpage-video-clear clearfix">
<div class="dev-onpage-left-content">
@@ -0,0 +1,148 @@
+<properties pageTitle="Get Started with Azure Mobile Services for Android apps" metaKeywords="Azure android application, mobile service android, getting started Azure android, azure droid, getting started droid windows" description="Follow this tutorial to get started using Azure Mobile Services for Android development." metaCanonical="" services="" documentationCenter="Mobile" title="Get started with Mobile Services" authors="glenga" solutions="" manager="" editor="" />
+
+# <a name="getting-started"> </a>Get started with Mobile Services
+
+<div class="dev-center-tutorial-selector sublanding">
+ <a href="/en-us/documentation/articles/mobile-services-dotnet-backend-windows-store-get-started" title="Windows Store">Windows Store</a>
+ <a href="/en-us/documentation/articles/mobile-services-dotnet-backend-windows-phone-get-started" title="Windows Phone">Windows Phone</a>
+ <a href="/en-us/documentation/articles/mobile-services-dotnet-backend-ios-get-started" title="iOS">iOS</a>
+ <a href="/en-us/documentation/articles/mobile-services-dotnet-backend-android-get-started" title="Android" class="current">Android</a>
+</div>
+
+<div class="dev-center-tutorial-subselector">
+ <a href="/en-us/documentation/articles/mobile-services-dotnet-backend-android-get-started/" title=".NET backend" class="current">.NET backend</a> |
+ <a href="/en-us/documentation/articles/mobile-services-android-get-started/" title="JavaScript backend">JavaScript backend</a>
+</div>
+
+This tutorial shows you how to add a cloud-based backend service to an Android app using Azure Mobile Services. In this tutorial, you will create both a new mobile service and a simple _To do list_ app that stores app data in the new mobile service. The mobile service that you will create uses the supported .NET languages using Visual Studio for server-side business logic and to manage the mobile service. To create a mobile service that lets you write your server-side business logic in JavaScript, see the [JavaScript backend version](/en-us/documentation/articles/mobile-services-android-get-started/) of this topic.
+
+A screenshot from the completed app is below:
+
+![][0]
+
+Completing this tutorial requires the [Android Developer Tools][Android SDK], which includes the Eclipse integrated development environment (IDE), Android Developer Tools (ADT) plugin, and the latest Android platform. Android 4.2 or a later version is required.
+
+The downloaded quickstart project contains the Mobile Services SDK for Android. While this project requires Android 4.2 or a later version, the Mobile Services SDK requires only Android 2.2 or a later version.
+
+<div class="dev-callout"><strong>Note</strong> <p>To complete this tutorial, you need an Azure account. If you don't have an account, you can create a free trial account in just a couple of minutes. For details, see <a href="http://www.windowsazure.com/en-us/pricing/free-trial/?WT.mc_id=AE564AB28" target="_blank">Azure Free Trial</a>.</p></div>
+
+## <a name="create-new-service"> </a>Create a new mobile service
+
+[WACOM.INCLUDE [mobile-services-create-new-service](../includes/mobile-services-create-new-service.md)]
+
+## Download the mobile service to your local computer
+
+Now that you have created the mobile service, download your personalized mobile service project that you can run on your local computer or virtual machine.
+
+1. Click the mobile service that you just created, then in the quickstart tab, click **Android** under **Choose platform** and expand **Create a new Android app**.
+
+2. If you haven't already done so, download and install [Visual Studio Professional 2013](https://go.microsoft.com/fwLink/p/?LinkID=391934), or a later version.
+
+3. Click **Download** under **Download and publish your service to the cloud**.
+
+ This downloads the Visual Studio project that implements your mobile service. Save the compressed project file to your local computer, and make a note of where you saved it.
+
+4. Also, download your publish profile, save the downloaded file to your local computer, and make a note of where you save it.
+
+## Test the mobile service
+
+[WACOM.INCLUDE [mobile-services-dotnet-backend-test-local-service](../includes/mobile-services-dotnet-backend-test-local-service.md)]
+
+## Publish your mobile service
+
+[WACOM.INCLUDE [mobile-services-dotnet-backend-publish-service](../includes/mobile-services-dotnet-backend-publish-service.md)]
+
+## Create a new Android app
+
+In this section you will create a new Android app that is connected to your mobile service.
+
+1. In the [Management Portal], click **Mobile Services**, and then click the mobile service that you just created.
+
+2. In the quickstart tab, click **Android** under **Choose platform** and expand **Create a new Android app**.
+
+3. If you haven't already done so, download and install the [Android Developer Tools][Android SDK] on your local computer or virtual machine.
+
+4. Click **Create TodoItem table** to create a table to store app data.
+
+5. Under **Download and run your app**, click **Download**.
+
+ This downloads the project for the sample _To do list_ application that is connected to your mobile service. Save the compressed project file to your local computer, and make a note of where you save it.
+
+## Run your Android app
+
+The final stage of this tutorial is to build and run your new app.
+
+1. Browse to the location where you saved the compressed project files and expand the files on your computer.
+
+2. In Eclipse, click **File** then **Import**, expand **Android**, click **Existing Android Code into Workspace**, and then click **Next.**
+
+ ![][14]
+
+3. Click **Browse**, browse to the location of the expanded project files, click **OK**, make sure that the TodoActivity project is checked, then click **Finish**.
+
+ ![][15]
+
+ This imports the project files into the current workspace.
+
+ ![][8]
+
+4. From the **Run** menu, click **Run** to start the project in the Android emulator.
+
+ <div class="dev-callout"><strong>Note</strong> <p>To be able to run the project in the Android emulator, you must define a least one Android Virtual Device (AVD). Use the AVD Manager to create and manage these devices.</p></div>
+
+5. In the app, type meaningful text, such as _Complete the tutorial_, and then click **Add**.
+
+ ![][10]
+
+ This sends a POST request to the new mobile service hosted in Azure. Data from the request is inserted into the TodoItem table. Items stored in the table are returned by the mobile service, and the data is displayed in the list.
+
+ <div class="dev-callout"><strong>Note</strong>
+ <p>You can review the code that accesses your mobile service to query and insert data, which is found in the ToDoActivity.java file.</p>
+ </div>
+
+<!--This shows how to run your new client app against the mobile service running in Azure. Before you can test the Android app with the mobile service running on a local computer, you must configure the Web server and firewall to allow access from your Android development computer. For more information, see [Configure the local web server to allow connections to a local mobile service](/en-us/documentation/articles/mobile-services-dotnet-backend-how-to-configure-iis-express).-->
+
+## <a name="next-steps"> </a>Next Steps
+Now that you have completed the quickstart, learn how to perform additional important tasks in Mobile Services:
+
+* [Get started with data]
+ <br/>Learn more about storing and querying data using Mobile Services.
+
+* [Get started with authentication]
+ <br/>Learn how to authenticate users of your app with an identity provider.
+
+* [Get started with push notifications]
+ <br/>Learn how to send a very basic push notification to your app.
+
+<!-- Anchors. -->
+[Getting started with Mobile Services]:#getting-started
+[Create a new mobile service]:#create-new-service
+[Define the mobile service instance]:#define-mobile-service-instance
+[Next Steps]:#next-steps
+
+<!-- Images. -->
+[0]: ./media/mobile-services-dotnet-backend-android-get-started/mobile-quickstart-completed-android.png
+[1]: ./media/mobile-services-dotnet-backend-android-get-started/mobile-quickstart-steps-vs.png
+
+
+
+
+[6]: ./media/mobile-services-dotnet-backend-android-get-started/mobile-portal-quickstart-android.png
+[7]: ./media/mobile-services-dotnet-backend-android-get-started/mobile-quickstart-steps-android.png
+[8]: ./media/mobile-services-dotnet-backend-android-get-started/mobile-eclipse-quickstart.png
+
+[10]: ./media/mobile-services-dotnet-backend-android-get-started/mobile-quickstart-startup-android.png
+[11]: ./media/mobile-services-dotnet-backend-android-get-started/mobile-data-tab.png
+[12]: ./media/mobile-services-dotnet-backend-android-get-started/mobile-data-browse.png
+
+[14]: ./media/mobile-services-dotnet-backend-android-get-started/mobile-services-import-android-workspace.png
+[15]: ./media/mobile-services-dotnet-backend-android-get-started/mobile-services-import-android-project.png
+
+<!-- URLs. -->
+[Get started with data]: /en-us/documentation/articles/mobile-services-dotnet-backend-android-get-started-data
+[Get started with authentication]: /en-us/documentation/articles/mobile-services-dotnet-backend-android-get-started-users
+[Get started with push notifications]: /en-us/documentation/articles/mobile-services-dotnet-backend-android-get-started-push
+[Android SDK]: https://go.microsoft.com/fwLink/p/?LinkID=280125
+[Mobile Services Android SDK]: https://go.microsoft.com/fwLink/p/?LinkID=266533
+
+[Management Portal]: https://manage.windowsazure.com/
@@ -0,0 +1,54 @@
+<properties pageTitle="How to use Code First Migrations .NET backend (Mobile Services)" metaKeywords="" description="" metaCanonical="" services="" documentationCenter="" title="Considerations for supporting multiple clients from a single mobile service" authors="glenga" solutions="" writer="glenga" manager="dwrede" editor="" />
+
+# How to use Code First Migrations with Mobile Services .NET backend
+
+In a .NET backend project, the default Entity Framework database initializer derives from the [DropCreateDatabaseIfModelChanges] class. Because of this, Entity Framework drops and recreates the database whenever it detects a data model change in the Code First model definition. The .NET backend tutorials continue to use this initializer because you don't need to maintain the TodoItem data you generate during the tutorials. However, for situations where you want to make data model changes and maintain existing data in the database, you must use Code First Migrations.
+
+>[WACOM.NOTE]When developing and testing your mobile service project against live Azure services, you should always use a mobile service instance that is dedicated for testing. You should never develop or test against a mobile service that is currently in production or being used by client apps.
+
+This topic shows how to use Code First Migrations to make data model changes without losing existing data. This procedure assumes that you have already published your mobile service project to Azure, that there is existing data in your database, and that the remote and local data models are still in sync.
+
+1. In Visual Studio in the Solution Explorer, expand the App_Start folder, open the WebApiConfig.cs project, and comment-out the call to the **Database.SetInitializer** method, which looks like this:
+
+ Database.SetInitializer(new todolistInitializer());
+
+ This disables the default Code First database initializer that drops and recreates the database. At this point, any data model changes will result in an InvalidOperationException when the data is accessed. Going forward, your service must use Code First Migrations to migrate data model changes to the database.
+
+2. Right-click the mobile service project and click **Set as startup project**.
+
+3. From the **Tools** menu, expand **NuGet Package Manager**, then click **Package Manager Console**.
+
+ This displays the Package Manager Console, which you will use to manage your Code First Migrations.
+
+4. In the Package Manager Console, run the following command:
+
+ PM> Enable-Migrations
+
+ This turns on Code First Migrations for your project and generates a migration for the existing database.
+
+5. In the console, run the following command:
+
+ Add-Migration -Name MySchemaChange -IgnoreChanges
+
+ This creates a new migration, with the specified name. If you have have already made a pending data model change, use the -IgnoreChanges parameter.
+
+6. In the console, run the following command:
+
+ Update-Database
+
+ This generates the code for a migration that will make the data model change in your database.
+
+9. Rerun the app locally, and verify that the we can still read data without getting the “out of sync” errors.
+10. Now make a model change, like adding a “Foot” property.
+11. Rebuild.
+12. IN the PM console:
+a. Add-Migration Foot
+ i. Note: if you look at the code generated for the “Foot” migration, you’ll see that it has the correct schema (when using the latest bits):
+AddColumn("jcooketestNet031301.TodoItems", "Foot", c => c.String());
+b. Update-Database
+13. Rerun app locally, and verify that the new property is returned when querying the table.
+
+
+<!-- URLs -->
+
+[DropCreateDatabaseIfModelChanges]: http://msdn.microsoft.com/query/dev12.query?appId=Dev12IDEF1&l=EN-US&k=k("System.Data.Entity.DropCreateDatabaseIfModelChanges`1");k(TargetFrameworkMoniker-.NETFramework,Version%3Dv4.5);k(DevLang-csharp)&rd=true
Oops, something went wrong.

0 comments on commit 4faf0d9

Please sign in to comment.