Hello
I'm a student and have a project to create an application for registering different loans. I created the web application using asp.mvc and EF to connect to sql db. Now my new task is to create for the same application a mobile one so I found out Xamarin and thought that this is my solution. However I was wondering is that what I need and can you tell me the basic things of what should be done for transforming my app into a mobile ..
The next problem which I have a wonderings is regarding the db because now I;m using SQL db but I saw that in the tutorials they're using SQLite db..
Thank you in advance!
Hi!
Yes, Xamarin will do what you want.
I assume that you want to use the same SQL database for both your web and mobile application. In general, you should not architect a solution such that you connect your mobile apps directly to an external database. Instead, you should expose the neccessary operations via an API and call that from your mobile application instead.
Since you are using the MSFT stack already, I would recommend looking into Web API for putting an API over your database.
For calling it from the device, I would recommend Refit for a no-fuss, typed and async-friendly solution. With your project structured correctly, you can share your data transfer object definitions (that is, your classes that you send back and forth) between the server and the app, making calls clean and simple.
Answers
Hi!
Yes, Xamarin will do what you want.
I assume that you want to use the same SQL database for both your web and mobile application. In general, you should not architect a solution such that you connect your mobile apps directly to an external database. Instead, you should expose the neccessary operations via an API and call that from your mobile application instead.
Since you are using the MSFT stack already, I would recommend looking into Web API for putting an API over your database.
For calling it from the device, I would recommend Refit for a no-fuss, typed and async-friendly solution. With your project structured correctly, you can share your data transfer object definitions (that is, your classes that you send back and forth) between the server and the app, making calls clean and simple.
Thank you for the answer Ryan
Yes I want to be the same db, I'll start researching about the api's and to do it that way.
Just curious, what do you want to use the same DB? To save time and effort or is it a project requirement?
well, I definetely don't have a lot of knowledge so I might tell stupid things but now when the web app is working and is uploaded on azure, the next task is to create a mobile version of the same application for simplicity of the users so the final result to be: the users of the system to be able to use it from web and from the phones as well.
So I think I need to use the same db, I mean the user to be able to create a new loan from the web service and the record to be registered in the mobile app as well, just I wasn't sure how to do that but now from Ryan's response I understood I need from these APIs
Otherwise I know that even now the web app is available for the mobile users with good results but I want to create a mobile version and whe I found out for Xamarin it sounded to me very cool to create one app for all three platforms..
Just now I'm trying to find out some more guides and knowledge how to use my asp.mvc app and to create the mobile one with the easiest way cause I have a time limit..
@RyanDavis is absolutely spot on. You want to share your data between multiple clients ( web and mobile ) so yes make it available through a RESTful api and you're golden.