Using iOS for existing .Net MVC database [closed] - c#

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I currently have an MVC 4 app running on a Windows Azure website. Some of the users need to use the app, but may be at a location without internet access. The goal is to have an iPad app with offline capability, and will push the changes to the Windows Azure database when an internet connection is established. I am in the planning process, and I have questions about how both apps can use the same database concurrently. When I create a Windows Azure Mobile Service and use the same database the Azure dashboard does not show the existing tables used by the MVC app. Is it possible for both the iOS app and MVC 4 app to use the same tables, or am I going to have to go a different way? Thanks.

You would have to write web api against your database,its very easy to Write Web Api 2 that can easily communicate with any sort of device or application because it is HTTP based.I personally have done this. Web api returns xml or JSON based data you can use this to populate your local database in your iOS Application.
You can also implement some logic to save data back to the database when you got connected to the internet.

The iOS app should absolutely not connect directly to your database. I actually don't think it's possible through the iOS SDK to do that if you wanted to, anyways, but just in case: don't.
Instead, your iOS app should connect to an API that you will need to build. The API, alone, will interact with the database. You can also retrofit your existing website to use the API as well, removing database concurrency issues entirely.

Related

How to implement ASP.NET MVC fetching its information from a remote web-service? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
I have an android application which fetch its information from a web-service which itself apply some rules to information read from database and returns it to android application.
Currently I'm going to develop a web application which mimics android application and use it temporarily for iOS users.
I'm going to use an ASP.NET MVC application for this purpose (since I know ASP.NET MVC) and implement it like architecture represented in below picture:
Prior to this I have developed web-api and asp.net MVC application but both of theme were reading information from database but currently I'm going to read information from a remote webservice and I don't know how to do this?
I want to know which method or APIs should I use to fetch information from remote database and populate my models.
For the actual retrieval of data, you can use HttpClient to send requests to your remote web service and get data from it.
For accessing the data internally, you can do this by implementing the Repository pattern to create the internal interface(s) for getting data to your controllers (or services first if needed).

Best way creating a mobile app and connecting with a database [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
I'm trying to find the best way creating a mobile application, and connected with a cloud database(or server).
So my first question is: Is it good practice to communicate directly into a database from a mobile app?
If yes, which is the best database for this work? Azure? Oracle? Firebase...?
If no, which is the best service to communicate first? And which protocol?
What is the most recommended way? Does it matter what os(windows?mac?) my server will use?
The best approach if to build a REST API to communicate with your server. But if you don't want to do that, you should look for Firebase. Firebase is one of the best platform to build mobile and web application really fast. It provide you with Authentication, Real-Time Database, Storage, hosting crash reports and many more. Using firebase, you can set security rules on who can write to you database thus it eliminate the risk of unauthorized access to the database.
Also keep in mind that, if you use firebase, you should structure your db in such a way that the number of read and write requests are as minimal as possible, as firebase could be a bit expensive if not used properly.
Its better to build a api in between. Doing queries in your app is kinda risky.
You could use a nodejs framework for this e.g. Sails.js or Express.js
For a cloud database, Firebase is a very easy to implement and work with Database. There are plenty of information resources about the setup and work process.

Extending heavy client by a mobile application [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I have a normal desktop application written in C#. Now I want an extra mobile application that uses the same information / data from the desktop application.
My question is how can I make a connection between my desktop application and my mobile application?
Atm I got two solution in mind:
-Make a webservice to provide data for the mobile application
-Use a database where the application can write stuff and the mobile application can read stuff from here
What do you guys think?
The best thing todo is to make like a REST service for it. This REST services communicates with your database to get the needed data from your database to your mobile application.
In your mobile application you make calls to this service using httpclient to get the data on your phone. You could chose to save this data locally in an SQLite database ( so people can use the app also offline ).
Hope this helps

How to connect online DB Xamarin? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
please tell me how to retrieve a data from online database(table)?. I just created a table in enter link description here
And I made a SQL database. And can anyone tell me how to retrieve a data from that?
It is strongly advised for you to not directly connect to a database straight from Xamarin for (at the very least) 2 distinctive reasons:
1. Your credentials for the database will be in your app code, meaning anyone can just decompile your app and read your login info - huge security risk.
2. By connecting to a online database straight from Xamarin you'll most probably overload the database server (they allow only a small number of connections).
Usually when you need data from a database you work with an API that you build yourself. For example A php site, or an ASP.NET web api.
Xamarin communicates with your web site (e.g. www.yoursite.com/api/getinformation). This way your credentials are safe in the website, and your app connects only to your site, which is better because you can cache information there, preventing an overload on your site.
Reading material that will help you:
Xamarin forum link to php+mysql+Xamarin
Consuming REST-API's with

Data-sync design in .net [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I have an existing cloud based solution with a web api that brokers data to and from the backend SQL database to client applications. All very standard. My web api is built using .NET Core. This is working well and I utilise the existing web api with various web clients that have been built. The architecture looks like this:
The current solution needs to be extended to support native mobile client applications using the web api (nothing out of the ordinary here - normally they'd call the web api the same as any other client) BUT I have to meet the requirement that these new client applications can be used in an offline scenario. This means I cannot expect a data connection to exist on the device in order to call my web api every time I need. I need to look at synchronising data so it can be offline and sent back to the server when needed.
Thinking about it, the data will be synchronised in one of two ways:
One-way sync - data from the server to client but no changes will be
made to this data e.g. system lookup tables.
Two-way sync - existing
data will be synchronised to the client, modified and sent back to
the server OR new data is created on the client and sent up e.g. new
order.
New architecture will be as follows:
So - getting to my question - does anyone know of a good design pattern to follow with regards synchronising data (one-way and two-way) OR maybe a NuGet Package which has synchronisation code built in? I'm trying to avoid reinventing the wheel with regards sync, if possible.
NOTE: Just for information purposes, the native mobile apps will be built using Xamarin in Visual Studio 2015.
I've not used it yet (just starting to look into as I have a similar situation to yours) but it looks like Xamarin has facility for this already (if you're using Azure anyway...):
Offline Data Sync in Azure Mobile Apps

Categories