I am builing a Windows Phone Store App at the moment and I am planning to build a Windows Store App in the future (Universal Windows App). I want to synchronize the items stored in the local SQLite database with a remote database and between the different platforms (Windows Phone, Windows, ...).
So, I did a few searches about mobile backends and I ended up at Microsoft Azure App Services for Mobile with offline sync. Before I start, I want to clarify some important questions for me.
I have different users which will authenticate via Facebook, Microsoft Account, etc. How will the different entries be distinguished for each user? Do I have to add an userId property on each table and select only entries with relation to the userId?
I am currently using the NuGet package sqlite-net with sqlite-net extensions for support of relationships like One-to-Many, Many-to-Many, etc. Azure Mobile Apps seems to support only simple objects and I have to manage the relationship via a foreign key manually.
How much will Microsoft Azure App Services for Mobile Apps cost for a few thousands user, if I only use the remote database with offline sync?
I'm not sure this is the correct way but yes. Then you can customize the PullAsync to return only records that relate to a specified user (https://github.com/Azure/azure-mobile-apps-net-client/issues/181).
Yes. Currently it does not support relations for the client SQLite database. You have to do it manually in your client. Have a look at Adrian's answer here: (Offline Data Sync in Azure Mobile Apps with Views or Stored Procedure)
It depends on your data and the database type. If you are using Azure SQL Server, a basic plan with a monthly fee of ($5 to $10) may be good to go. And for the Azure Mobile App you can start the free plan.
Related
I have a Teams application (Tab). I am an ISV provider, and provide a multi-tenant application that is installed by customers via Teams App Store in their organizations.
How do I save settings for my application organization-wide for the customers? For example, CustomerA has installed the app and then CustomerB. I want some storage that would be unique for CustomerA and CustomerB and the app, and located in customer's environment. The settings I want to save are not per-user, but per-organization (tenant).
Somewhat similar to "App Data" folder you have in Windows Desktop for example.
Does such a storage exist? Does API for this storage exist?
A tab app is a simply a web application that you render inside of Teams. As a result, what the app does, and where and how it does it, is totally up to you. This includes any data storage you choose to have behind the scenes. For example, your tab could be built in PHP and use MySQL, or built in ASP.Net and use SQL Azure or CosmosDB. It's totally up to you, but you need to implement it yourself, as an ISV.
The important piece to differentiate clients, however, is being aware of the TenantId for each user, so you can look up which client's settings you need from the database. The most simple way to do this is simply the tid property on the Teams tab context. You can read more about that here. Unfortunately, because it's just accessed via Javascript, it's not entirely secure - for a more secure mechanism, you should be creating an Azure Application, and generating jwt tokens that you can authenticate against in your backend. It's a much more complex topic, but hopefully this answer at least gives the background you need. For more info on the security aspects (validating the token etc.), please see this question: How to restrict access to Azure Function to only allow requests from a custom Microsoft Teams App?.
I've read many articles and tutorials that demonstrate how to use the Azure mobile service however I'm left unclear with many things.
I have an existing web app that uses Azure SQL database and is published with Azure. I'm trying to integrate the already created database into the Xamarin Android App I'm developing.
I'm confused with the following things.
Do I need to change the .Net back end to be able to use the database tables in the Xamarin app? The way I see it, I shouldn't need to since the Xamarin app communicates with the SQL database, not the .Net app.
How does the data get stored into the SQL table? Do I just reference the Mobile service inside my Xamarin app and it will create a bridge between the SQL database and my application or do I need to first create the tables or import the existing tables from the database?
The web app is currently deployed to Azure Web service. Does it need to be deployed to Mobile App service?
I would really appreciate if someone can help me out with these questions.
Your mobile app is not communicating directly with your SQL database. It is likely going through an Azure App Service - this is a web-enabled piece of middleware that projects tables within the SQL database to an OData feed. So you have three pieces - the SQL database, the Azure App Service and your client.
1) Yes, you need to update the ASP.NET backend to support your database tables. If this is an existing database, then you also need to update your database to support the mobile projection. I wrote a blog on this: https://shellmonger.com/2016/05/11/30-days-of-zumo-v2-azure-mobile-apps-day-19-asp-net-table-controllers/ but you may want to start earlier in the series that that.
2) You add the Azure Mobile client to your Xamarin app - this coordinates the transfer of data between your client and the backend. You can find a tutorial on this that I recommend walking through here: https://azure.microsoft.com/en-us/documentation/articles/app-service-mobile-xamarin-android-get-started/ - you can also read the HOWTO here: https://azure.microsoft.com/en-us/documentation/articles/app-service-mobile-dotnet-how-to-use-client-library/ - the tutorial and HOWTO cover both offline and online data access scenarios.
3) If you are using the new portal (portal.azure.com), then there is really no difference between a Mobile App and a Web App. The Mobile App is simply a web app with a specific SDK deployed within your ASP.NET (or Node.js) backend code and with a connected database. The minor difference is that if you create a Mobile App then clicking on Quickstarts (within Settings) will get you a mobile quick start; if you do the same with a Web App, then clicking on Quickstarts will get you a web quick start.
We hope to implement Couch base Mobile for our mobile application to add the offline support.
Is it possible to sync our existing oracle data base with Couch base server.
Our mobile application developed using xamarin and it is a xamarin form application that support the ios, android and windows.
We want update existing oracle database with offline support.
Usually what happens with Couchbase Mobile users is that they use the change worker pattern as refered here: http://developer.couchbase.com/mobile/develop/guides/sync-gateway/changes-worker/pattern/index.html
and also webhooks: http://blog.couchbase.com/sync-gateway-webhooks
This allow mobile users to integrate with external solutions like an Oracle database.
I am developing a windows phone application which will track user movements and collects some statistics. I want to store this information at some place (if user permits and this data wont shared with anyone) so that I can read that data again.
Any ideas on how I can do this in windows phone ?
You basically need a web service. You can use Azure Mobile Services, your own hosted or on Azure web service. Or you can use any other number of services such as Buddy or Parse. It's up to you to decide depending on the pricing and features of each service.
One way is to use Azure Mobile Services to store data off to the cloud. There's a tutorial here for Windows 8. It looks like you've tagged the question with Windows Phone 7, though, which the mobile services package isn't available for (that I know of). In that case you can create a webservice that your phone app can send data to, which can then store it wherever it pleases - a database, Azure Table storage, or wherever.
you have three options
1 ) If you want to store it locally then use : IsolatedStorage for Windows Phone.
2 ) If you want it to be somewhere outside your device : Write your own service code and connect it to a database (one end) and give a call to it from your windows device (other end)
Service not necessarily has to be Azure ... You can write any service connect it to ur database and store the value there.
I am now self-studying how to developing an App for Windows 8 with C# and XAML and I want to use Windows Azure service as a cloud server for my database, just like SQL. I am new to this technology and as far as I know mobile service is not for all-purpose tools, but still, I wonder if I can use it just like SQL, in which many tables are related to each other.
If not, what Windows Azure service I should use instead? Virtual Machine, perhaps?
The way you can simplify it as Windows Azure Mobile service replaces the basic requirement basic of any currently available SQL Database access API instead using WAMS your application can connect to same SQL Database over a Mobile service endpoint available to your app and that what makes independent to any app connecting to WAMS.
WAMS simplify quick creation and access to data backend (hosted in Windows Azure) from any mobile app so yes you sure can use WAMS with SQL DB as long as you have a fixed access scope with your SQL DB requirement. When I say fixed means even when Windows Azure Mobile Service (WAMS) use SQL Database as backend you will be limited within the functionality provided within WAMS framework compare to accessing your DB over API. As you already know there are tone of other things you could do directly with SQL DB (using API or other interfaces) but not by using WAMS. However once the SQL DB is created you still can access it outside the scope of WAMS and still can do the rest.