Combining noSQL (Firebase) and SQL for an Android application - android

so I've finished making a full fledged Android application with which I store data and retrieve on Firebase Database.
However, since there are many joining statements (By using orderByChild and equalTo), the main home screen is very laggy.
The main reason why I'm using Firebase, is because it is a real-time database, however, there is only one screen where that is useful.
Do you think that it's a good idea to keep most of the data on an SQL database and only the data that requires real-time data transfers on Firebase, and will using SQL databases reduce the time it takes to load my home screen?

If you have a SQL background and you want to rewrite your application to use only Firebase, to have a better understanding, please take a look at this tutorial, The Firebase Database For SQL Developers. I asure you, Firebase will handle all your needs.
If don't have time to do this, than use Firebase just for the single activity that you need. If you think that in the future you'll need to make more than one section of your app to use Firebase, than think to change the whole app to use only Firebase.
Hope it helps.

Related

Dashboard from Firestore data?

I have made a simple Android app with Flutter, that sends data to Firestore. Now, I need to build a dashboard that will be able to view the data. Excel doesn't work, I tried Zapier but it seems too limited, and I gave a look at Retool , but it seems to only work with RealTime database, not Firestore yet.
Would you guys be able to recommend something ?
Zapier does the job. I just had to name every row accordingly to the fields from firestore
Chartbrew.com supports connections to Firestore. You can run queries using Firestore operations and generate charts and tables to explore the data.

What is the best way to store app data and load it in app?

This is just a information question. I'm new to Android app development and currently I'm working on my first app and and it is ready for the release. Now I'm concerned about how to handle heap of users and where to save all their details my app is a service booking app so it needs to save all the order details products details and lots other stuff.
Currently I'm using cloud firestore to load and save all the data of app. But I'm having some issues like without authentication it won't allow users to access some of my data and other. I wonder how large apps save their data and load them perfectly.
I wish someone will help me how can I save all my app data and load them perfectly in app. And suggest me for a best way to manage large user base. And other stuff.
First of all, firestore is good option if you don't have complex backend logic on the database. For simple CRUD operations on data firestore is a good choice but as you said you have a bulk of data then you must go for the Backend database and then connect your database with Rest API. So that all your complex queries will be done on the backend and you can simply consume your API in the app.
If you have lots of data from different users, maybe you should use a central server(DB), something like Postgres or MySQL should work fine.
At the same time, you can also do some sort of caching to accelerate the fetching process, like create a small database locally(you can use Room) to store some user specific data.

sort and manage user data input based on time in android

I am a beginner.
I want to create a personal financial accounting app.
In this app, all user monetary transactions are stored based on time.
The user can with telling time Understand the transactions of that time.But I do not know how to do this.
Should I use sharePreferences? If yes, how?
Query the db based on order by time descending
I am going to assume you want to build a local database to store this information, if so you would be better off using Room to build, store and query your database. The link outlines the implementation has a few examples to get you started

Design applications with dynamic data

if the application receives its data from remote server then we should save our data in the local database and have our UI load data from the local database for better UX right? Our UI should not load data from servers directly it will result in bad UX. Now my question is I am developing an e-commerce application and it’s data is very dynamic it can change anytime. The product can go out of stock, it’s price and the discount amount can change etc. So how to keep up with it. If I refresh local database every time user opens application then what will be the benefit of the local database. If any of you had faced the similar situation or worked on any e-commerce applications then please me suggest me better ways. Any help would be appreciated. I do not know if this is a right platform to ask this questions.
There are some solutions. You can use push notifications using Parse, for instance, when your MySQL changes. Or you can use JobManager to enqueue custom synchronization tasks. I recommend you to see this video and check out the video project: https://github.com/yigit/dev-summit-architecture-demo
This reflects your problem very good and it is a very nice solution and, the most important, it is developed by a Google employee.
I hope it helps you!

Firebase online to Android offline datastore

I am building a mobile app to allow for real time messaging, befriending users, creating groups to both chat and share images with, as well as creating events where users can invite one another.
I have chosen to use Firebase as the online back-end. But, given Firebase uses a NoSQL data model, while Android SQLite uses SQL, when saving data offline in Android what is the conventional way to handle this? Is there a simple way to convert or simply save from NoSQL to SQL, or do I need to build a converter?
(This is especially important for the events, as once created, they must be scheduled in the AlamManager, giving users alerts upon event time)
While you could implement your own solution, truth is, you do not need to build anything from scratch.
There are free Android libraries which could help you. I would recommend you:
SimpleNoSQL
The transition from Firebase to SimpleNoSQL is pretty straight forward, and is mostly the same as if you were using any form of SQL:
1) You get the data from your remote db: you can get this trough a request to your remote server, it doesn't matter what language you are using as long as it can return a response you can catch.
2) You save said data to your local NoSQL db: once you have the information requested, it is up to you what to do with it. You could save it to a TXT file, a SQLite db, NoSQL db, save it to the SharedPreferences, etc.
Hope that helps.

Categories

Resources