c# database access code on android with angular nativescript - c#

I want to create a native android app by using angular nativescript because I already have angular knowledge. I do not need to re-use angular code because of a parallel existing web app. There will just be the android app.
The user will create and save some data which could be stored on a sqlite/room database on the smartphone. All links about data access I found are about JAVA.
How can I write the backend database access code with C#. Even better would be an ORM to access the local persistent store. I do not want to create a database on azure and make it available via C# web api. Thats total overhead for my situation.

Related

Blazor WebAsembly Access Database

I am just thinking that, Since Blazor Webassembly can running in browser independently(off-line), how can it access database without a WebAPI?
Can Blazor Webassembly use sqlite in browser directly?
You can use in browser DBs IndexedDB, Web SQL or local storage throught JSInteropt
How can it access database without a WebAPI?
It can't access any database without a Web Api. You can only access the JavaScript localStorage and sessionStorage Apis, using JSInterop. Right now Blazor does not support such adventures, but I'm not much acquainted with products created by third parties and the community... perhaps they've created something that can be useful for you.
No Blazor Webassembly can not use sqlite in browser directly.
Blazor Webassembly can running in browser independently(off-line),
it can access database without a WebAPI but first you have to start creating project by chossing
Blazor Web assembly project then use ASP.Net Core Hosted and Prograssive Web App selected.
Now you can use database and share logic. And for Off line capability you have to change in worker.js according to your need.
And You can use in browser DBs IndexedDB, Web SQL or local storage or JSON File

Can Web Application Retrieve Data from Firebase Database using C#?

I have an Android mobile application that used to upload image and text to Firebase Database. Now, I have another web application that using C#, this is used to retrieve the data (which uploaded by the mobile app) from the Firebase. I found some examples regarding on how to retrieve data using C#, but it needs to "Add Firebase to your Web App" . Is it possible that not adding web app? Thank you.
I mean, is it possible that my mobile and web applications use the same Firebase Database/Storage, and both applications can add, edit, delete the data in the same Firebase Database/Storage?
Yes, it is possible to have an ios and web application using the same realtime database and same storage.
From the firebase docs:
The Firebase Realtime Database is a cloud-hosted database. Data is stored as JSON and synchronized in realtime to every connected client. When you build cross-platform apps with our iOS, Android, and JavaScript SDKs, all of your clients share one Realtime Database instance and automatically receive updates with the newest data.
To add web or ios to the project, you need to go to the firebase console and then click on add another app and choose if ios/android/web and just follow the steps.

Getting help from web cloud services (calling from asp.net mvc site)

I have a website, but some of the back-end infrastructure is little slow.
So I am planning to get help from CLOUD, I haven't decided which one yet.
I need to know does Microsoft Cloud does the same thing.
What I need is following,
1) Have database on external web resource.
2) Have code and http enabled methods that I will write in C# and place it on Cloud.
3) And call the methods in step 3 from my asp.net MVC wesite's codebehind and client side(javascript).
I need to know if I get support from Microsoft Cloud platform, will I get the solution required in above 3 mentioned points?
And if I get support from Microsoft Cloud, then the coding syntax for SQL, will be same as if I run queries against normal SQL Server database
Thanks,
If I am understanding you correctly in that you are looking to have a cloud hosted SQL database and HTTP access to this database through custom C# code, then yes to all three of these.
You can set up your database as an Azure SQL database and create an ASP.NET WebAPI application to open up your database to HTTP calls as you see fit. Then you can use the REST client of your choice to access your database from your MVC controllers or through Javascript in your views.
Also, yes, SQL syntax for Azure SQL is the same as for regular SQL Server.

Looking to create a webservice for client authentication and need some advice

I am developing an android application to accommodate some desktop software that I created. I would like for the user of the mobile app to have to verify their identity through authentication. Basically the web service will have to act as a central hub to both authenticate and hold information that the android app will need. The way I think it should work is to
-Set up a central web service
-Allow user to create account from desktop client using email/password
-The desktop client will send the information to the webservice that the android app will need.
-when android app is authenticated it will then retrieve the data it needs that was posted from the client.
So basically the service will need to be able to send and receive data.
I will only be using .net (either C# or vb.net ) for the service, so this leads me to a couple of questions:
Should I be using WCF for this? If so should I create a WCF Service library or WCF Service application?
Should I be using the Sign Sign on service approach?
The web service doesn't need to be fancy it just needs to get the job done. Is their any boilerplate project templates or projects out their I could use to help build a foundation?
I recently discovered SudzC.com which generates classes and methods for Objective-C from the wsdl data of a .net web service, and I'm fairly sure it also does Android.
I have a huge catalog of fairly 'old' web services which pre-date WCF and they are currently working perfectly.
I should point out though that the SudzC service only shows you what it can do for you for free - to get the code you have to pay ~£20 for a one year pass.
We had something similar where I worked. We had to put together an Android app for the company. If you are on .net 4.0 or newer, you can take advantage of theWebApi. It can return json or xml. So, that means any platform can utilize it (desktiop, android, etc...). I found it extremely easy to use, with very little overhead.

View need to go Winform to Webform, what is your advices?

Our application is well structured (well we did our best!) and we have split the Model from the View, Now, we need to let some information to our client with a web access. We would like to build something small with IIS and some webform.
Here some information you might think are useful:
Our controller have Thread of database queries
Our database is PostGresql
All is build with C#2.0
We used a lot of databinding between our View and Controller in Winform.
Winform will stay for internal purpose, only a small part will be available on the Internet.
What are your suggestions for this kind of move?
Update
We will host the web in our company server so the database will stay inside the business. No need to duplicate data or any synchronization.
I think the "synchronizing" Michael is talking about is the data in the database and the view presented by the Winform app.
We had a similar problem, and the solution we came up with is to create a Web service that exposes the data via XML and use the service from both the web app and Winform app. Every time you update data send it to the web service, and every time you perform a query get the latest data from the service. Do not consider caching data on the Winform app unless you have profile data showing it is a bottleneck, or you want to run unconnected from the network.
This is perfectly possible in .Net 2, you do not need 3.0 or WCF.
The biggest challenge is going to be synchronizing your database between the local Winforms application and the hosted Webforms application. Once you do that, creating the web app is easy.
If your web application is read only, then you can set up replication. Find a tool that you like. Three that I found through a quick search are:
Slony-I
Mamoth Replicator
Bucardo
If your web application is not read only, then the problem is more difficult. You might want to consider upgrading to .NET 3.0 or 3.5 so you can use WCF. If there is a significant overlap in functionality, you might want to move your data to the web exclusively and expose it through WCF services.

Categories