I have created an android app on android studio with firebase database.
Now I want to develop an administrative website through which the admin will control all the operations of the app.
I want to know how to connect the app to the website. Also, should the database be connected to the app or the website?
Your website doesn't need to be directly connected to the app or vice versa. That is what firebase is for. When using the website or app, you connect directly to firebase. When data changes in the database, you can reflect these changes on both the website and app.
So there is no direct link between the app and website. They are just interfaces to manipulate and view data in firebase.
Basically your quesion is "How can you connect your Android application to a web server".
You need to look at the URLConnection class. An example is here http://www.devx.com/wireless/Art.... If you are writing the server side web service, I suggest making it a RESTful service returning JSON data (as that is easier to deal with on the handset)
Related
Im currently working with Mobile app with firebase back end. I wonder how to build another admin Web app which should be hosted on the Web and pass data to the Mobile app. Should i open another project to build the Web app?Or build the both app within one project which should share with one firebase back end. Someone please guide me as Im clueless. Would appreciated for the sharing.
Since the application admin app is managing the same set of data, it will typically be part of the same Firebase project too. This is actually a quite common scenario, and I regularly add an admin web app to my Firebase project precisely for that purpose.
I am having an app with firebase as database. And i am creating a website with the same data as in app. can i use same database for both app and website. when data update take place in app should also be resembled in website and vice versa
Yes, that is definitely possible. For example, the FriendlyPix sample app is available for iOS, Android, and Web, and all these talks to the same back-end services. So photos posted in one platform show up in all other platforms too.
I am using GoolgeFirebase for my android application. I want to make an admin portal at GoogleFirebase connected to that application's database to view some admin related tasks, like showing waiters with rating where i have all the wiaters and rating data stored in Google Firebase Realtime Database.
Do i have to create a web app, connected and hosted at the Google Firebase or the GoogleFirebase facilitate itslef for creating some admin portal for the android app.
You have to build something. A web app using firebase hosting is really easy but you can host it anywhere you want including on your own PC. Of course you can also build any kind of app using one of the SDKs or anything that can do HTTPS requests. An special admin android app is an option. Java desktop GUI app may be to your liking.
Sometimes I find building a commandline tool in node.js is perfect for my needs. The command line lets me pipe the output to other tools that are helpful.
Firebase provides a number of Admin SDKs to help build server-side or desktop applications. As of now there are Admin SDKs available for Node.js, Java and Python (although the Python SDK is new and doesn't have realtime DB support yet). You can use one of these SDKs to build your admin portal webapp.
My aim is to develop a web app and a mobile app that share data from the same database.
What is the best way to achieve this (using azure)?
I think I should:
Create a Web App from Azure Portal with a SQL Database
Create a Mobile App from Azure Portal with an existing Database (the one I created before)
Then I'll develop my ASP.net MVC project, using Entity Framework to create the db Schema and I'll publish it in Azure.
Finally I'll develope my mobile app (in this case I would like to use Xamarin) and I'll access to the database (created before) using the code for Easy Tables.
Is it right? Or I'm thinking wrong and this isn't the best architecture to share the same database between a web app and a mobile app using Azure?
This should be fine. Keep in mind that the Azure Mobile Apps server will automatically add some system columns to your database tables (createdAt, updatedAt, deleted and version). Also, a limitation of Mobile Apps is that the primary key name must be called id.
If you want to develop the web site and mobile app share the same database, it is a good choice.
Azure Mobile Apps is a plain old ASP.NET application or Node.js application. Easy Tables is simply a projection of data from the Node.js version. If you are using ASP.NET, then you don't get Easy Tables.
That being said, it is relatively easy to add Azure Mobile Apps SDK to an EXISTING web app.
1) Copy the code from App_Start\Startup.MobileApp.cs and Startup.cs from a sample app to your ASP.NET app
2) Ensure all your models inherit from EntityData so that they are "mobile ready". If your models already have an auto-incrementing Id column, then see https://shellmonger.com/2016/05/11/30-days-of-zumo-v2-azure-mobile-apps-day-19-asp-net-table-controllers/ for a workaround
3) Scaffold Azure Mobile Apps Table Controllers for your mobile database table projections.
You can use the same models across both MVC controllers and Mobile controllers. If your app uses AJAX calls for getting data, you can replace those AJAX calls with the JavaScript SDK for Azure Mobile Apps so you don't have to duplicate things.
The main place you are going to have to work on is integration of auth. Most MVC applications use an Identity database because they have grown it from one of the existing MVC templates. You are going to need to implement a custom mobile auth mechanism to re-use the database. You can find information about this on the azure.com HOWTO documentation.
I've been studying Xamarin.Forms with goal of building cross-platform mobile app in VisualStudio2015. I've got a perfectly acceptable public facing web site but native app(s) are what the boss thinks we need.
The current web app hosted on IIS 7.5 uses a separate project(DLL) for database access to an on-premises SQL Server 2008 instance. This VStudio project exposes domain objects to the calling ASP.NET webforms by executing various stored procedures using System.Data.SqlClient.
I know building the mobile native app itself with Xamarin.Forms is one part of the challenge but I am asking here for clarification about how to approach the database requirements:
Do I need to create some sort of web service that provides the same CRUD functions required by my current web site?
Xamarin documentation lists several options for consuming web services and the more I search and read about data access I conclude that a callable web service of some type is going to be required for my eventual native mobile app.
Is this assumption correct?
Yes. You generally want a webservice layer brokering requests between your mobile app (or any remote client) and your DB server. If you already have all your crud operations in a separate library that is utilized by your website, then a webservice would just be another set of endpoints that rely on the same CRUD library.