So i've recently discovered Flutter as a great way to develop apps for IOS/Android at the same time and i've come up with a project i'd like to realize. It's nothing new, i just want to build an app that helps you keep track of all the money you have / don't have (in my case). I know that this is not something new and there are some really good apps for this but i want some special features none of these apps has (+ it's a project not that difficult and i can get a ton of coding experience).
I am looking for the best / a very good way to store user data. Each user should be able to store all past transactions and how much money they still have left. From what i've read SharedPreferences aren't the way to go as they aren't good at "storing a lot of data" so it's reccomended to go with an actual database.
As i am someone that very frequently resets his phone (rooting and stuff is really fun) i'd love to have the option to backup the database in the cloud as well. If my research is correct i can do this two ways:
I can either have a local database stored on the device and create an option in the app to export the db to e.g Google Drive / Dropbox and import the db from there or i could go with a firebase from google. I'd prefer the second option as then i could implement it in a way that the user doesn't ever need to press "backup data" but the data will always get synced with the firebase and be available offline.
I've found tons of ways and tutorials on how to do this on android, yet i could not find anything for flutter. And i don't really know how to secure a firebase (and i don't really want to know either, i'm not that much into databases).
What are your suggestions? Should i
Go with a local database or
Try setting up a firebase
Thank you guys!
Firebase seems like a great option. Note you only have 1GB of free real time database storage.
In terms of integrating Firebase with Flutter you should start reading here and here
SharedPreferences are mostly used for storing only important information like userId tokens, session timeouts etc etc.
In my opinion go with firebase, so that you can keep record of probably every single transaction.
You can even go with local storage but as the data grows it would be good to keep it syncronized across cloud.
Related
What is the best practice for saving Android app data (like users' data - every user has SQL database with data of all the other users) on the phone in SQL database?
This is a public app (has been published on the Play Store) and I need to decide how to encrypt the data and where to save it on the phone in that way no one will be able to reach it (not the users, nor other apps)
first of all, you should not store the data of every user of your app on every users phone. It will be difficult to maintain data consistency and more.
Secondly, take a look at the security section of the android development guide. The "best way" depends on your exact use case.
Cryptography is a difficult and important topic. DO NOT just look for answers like "Do it with XY" and implement it without understanding the theory.
Maybe not the short, easy answer you were looking for, sorry.^^
I am implementing an Android application but I can't make a final decision about which database will be the most suitable. You can think of my app as Instagram but there will not be photos or videos, there will be texts instead. There will only be images for profile pictures.
Users may insert data to database and make advanced search inside the app. So the database must be somewhere where anyone using the app can communicate. What is the best choice?
Not everything you read on the internet is always true. There are MANY services out there for you to use. Parse-Server, Firebase, AWS, MySQL, PHP...etc etc etc.
I, for one, am using Parse-Server. Why? It's simple. I make my own calls for statistics that will get stored in mongo. If I was to do it over again, I would use Firebase for it instead. Why? Google is king.
Now, Parse-Server and Firebase for example claim they are secure, and I haven't done much testing to see if I was able to crack into it. Perhaps someone can comment on this. Parse-Server is stored locally on my Mac, and as long as your keys stay secured, the app is secured. The db (which is stored on mongo) is secured. You can store images, text, users, and just about ANYTHING on mongo which again, is similar to Firebase.
If you want to best for production, I don't think you need to worry about Firebase, Parse-Server, AWS, etc, you need to worry about security. If it's hard to crack then that service might be the way to go.
Sure, maybe storing images separate from the text would be good, but again, if Parse-Server is secured, then I'm happy to use it for my needs.
edit: typo(s)
The Goal: I'm working on a simple project with Android Studio and Google App Engine. The App is just a Proof of Concept, so nothing spectacular. In a sentence, it is an app that counts the number of times a button was clicked in a six hour interval. Specifically, when a button is hit, the app needs to send a request to the backend. The backend then needs to load a number from cloud storage, increment it, and write it back. Every six hours, I need to reset the counter to zero.
The Current Progress: I have the app UI written, I have an App Engine Project set up, and I have the two connected via endpoints. For now, I have a method to send two numbers to be added in the backend and return it. I'll scrap that and go with the incrementor code when the time comes, but I can say I understand how App Engine and Android are connected.
The Problem: How do I access Google Cloud Storage programatically from here? Do I write backend code? Do I write code in the App itself? Do I do some more endpoints wizardry?
I keep seeing code excerpts, however, I don't know how everything fits together. I can access cloud storage from the online manager, however, that doesn't do much good I don't think. I understand how buckets and entities are broken down as well, if that helps.
Thanks in advance, I've been wandering through the desert of Documentation for weeks.
It's a little unclear exactly what you're trying to accomplish, but I'll take a crack at hopefully nudging you a bit more in the right direction.
First off, if you're just needing to load and increment a number, in my opinion, you may be far better served using a database, such as Google's Cloud Datastore, rather than Cloud Storage.
There are numerous options for connecting, whether you end up on Cloud Datastore or Cloud Storage. You may find it easiest to implement your Storage/Datastore operations on App Engine, but that really depends on what else you're doing.
If you app just needs to do basic database or storage operations, I wonder if you might not be far better served by a more managed solution like Firebase. With Firebase, you get many of Google's cloud services, nicely wrapped in an API that is very easy to implement, thereby negating the need to manage a separate App Engine instance and your endpoints. Firebase also gives you offline and caching functionality.
Is there any downsides to using Google Account? Is there any limit?
Why ask this? It's because I played some android games for research and found out many of them don't save the user data just warning the users removing the games will remove whole data as well.
Ironically, all of them provided world rankings using Google Accounts.
So, I became curious and wanted to get some opinions of experienced people if there is no problem for beginners like me to use Google Account for backing up data.
The data is going to be created with SQLite so I cannot let users save in their own SDCards. If Google Account is not good for saving data, I need to get an FTP server instead. (I'm not sure if I can deal with it well, though.)
But I really wanted to use Google Account, so was just about to start to study it.
Can I just use Google Account for user data? or better to get my own FTP server?
There is something that Google offers which is known as the Android Backup Service. It's precise use case is when you want to save user's data online. There are several advantages to this:-
Easy API to call Backup Service
No need to maintain a separate FTP server, hence reduced cost saving both domain and hosting charges.
Unlimited Backup space for your user's individual app installation.
In case the user deletes the app, your app's data can be retrieved from the Android Backup service.
The developer page gives a fair amount of idea to anyone wanting to implement that kind of data backup support cost-effectively.
Is it possible that I store my SQLite table over a dropbox account and have all my users sync their tables with the stored table? Also be able to make changes to that table?
Your approach could work in theory, but there are so many issues involved, that you're better off not doing it. If you wish to store and make data available across all devices belonging to a user, I strongly recommend looking into Datastore API by Dropbox. The API will take care of storing data locally as well as synchronize it over connected Dropbox accounts.
If you want a bit modular approach, you can use Windows Azure Mobile Services. These give you REST APIs to store your data in cloud. However, synchronization has to be handled by the developer - you. I have written a small library to do that here: http://bit.ly/ProjectMirror It's for Windows Phone, but Android version is already in a sister repo there. You could extend it. Let us know how that goes.
In addition to these services, Parse SDK is a good option. It requires you to pay after a while, though. In addition to what you want to do, it also provides other things like user management and so on. But, be aware that some of those operations may require you a live Internet connection.
So, in essence, if you want seamless data storage and sync, use Datastore. Be aware that you'll have no control over the server side. Also, your data will be restricted to the Dropbox ecosystem forever. If you plan on further expanding your app to other platforms, go with Azure and handle the sync. If you want lots of features, go with the Parse.
I would suggest looking into Google Play Game Services using the Cloud Save feature. Even if you are not building a game this feature lets you sync sqlite data in the cloud and Google will handle most of the work for you.
OR you could use a cloud based database which supports both push and pull. That means:
Scenario 1:
Your users change something on their phones. Changes are uploaded to the database. The database then pushes these changes to all other users.
Scenario 2:
Your users change something and upload this to the database. But instead of the cloud based server pushing the changes to all users, the users phones can ask the database for new data at intervals.
All this is very easy to set up. It took me about five, ten minutes. Just follow this easy tutorial:
https://parse.com/docs/android_guide
and for push:
https://parse.com/tutorials/android-push-notifications
We now use this for our company app, storing statistics for example.
Bear in mind that syncing can become complex. Try to keep it very simple, especially if you are new at programming.