I am considering using a FireBase database to store app data. What I would like to achieve is to have the data available to my app only.
Is this just a matter of creating a single account for my data and hard-coding the credentials into my app (similar to what I am doing now with my MySQL solution)? Or is there a better way to achieve this?
Looking forward to your input.
EDIT:
Let me just explain what I would like to do. I am developing a level based game. A players score is dependent on how fast he/she completes a level, compared to all other players. What I want is the following: I want to store the level data in a SQLite database on the device and to update this from a FireBase database. I do not want users to create an account. So, basically, I want my FireBase database to "act" more or less like my SQLite database: no login needed and only accessible to my app. Hope this makes sense.
Related
Basically what I would like to do is have two phone in close proximity press a transfer button which will notify a server about both the devices latitude, longitude and unique ID. From here I would like the server to compare the latitude and longitude of both devices to check there within a close proximity of each other. If they are within the accepted proximity range the server will swap the ID's of each device so that they can then retrieve information about each other from a database.
I have been stuck for a while and seen a few options but am unsure about there difficulty of implementation and there capability of performing the required task.
I am using using Android and Firebase and have this mostly done except for the server data analysis as mentioned above. The first idea was to try Firebase Functions as it is simple to integrate with the Firebase database but I have had a hard time finding examples in Typecast to perform the functions I want. The other option I see is to use node js which I know next to nothing about and don't want to invest an unnecessary amount of time into just for it to fail.
I have searched a good amount and haven't managed to find any solutions to fit this criteria so if this question has already been asked and answered please link me to the page.
I know this has already been done by Bump but theirs literally no information available about how there back end worked.
If any of you guys can recommend any solutions to resolve this issue it would be greatly appreciated. If I forgot to mention something or you need more information let know.
Firebase cloud functions + Firebase Database is a good fit to your problem statement.
When the two devices initiate a session, you can create a node(session) on Firebase realtime DB and then have a cloud function listen to changes in a node where the sessions would be created. The Firebase cloud function could then compute the logic about the proximity and swap id's.
Where is that you are stuck?
I am making an android music app. I have a few queries about how to make it more efficient-
Should I store the tracks available on the device, in my app? If yes, what should I use JSON, SQLite or CouchbaseLite?
How often should I refresh the stored records?
Any other tips will be highly appreciated.
There is no need to save the music in your own app's database, android saves them for you and provides a content provider (MediaStore) that allows you restricted access to the content of that database. So every time your app wants to load music from the device, it would use the load music from the Media Store, making your own database would only mean having a copy of the data in the device and that would be waste of memory since you would still have to query your database to get the music.
you can learn more about content providers and media store from the following tutorials.
Media Store
Content Provider
I want to create a simple leaderboard for a game I'm working on.
It should connect to a database and get the top 5 or so scores, as well as update the leaderboard when someone gets a new top 5 score. Any suggestions on the best way to implement this? I would use Google Play, but that has a registration fee and this is just for a school project. I'm thinking about using Firebase database to store the data, but I hear that libGDX and Firebase don't mix very well.
Any suggestions?
Thanks
Since it's a school project, you could just go with the Preferences and store it in there. This is local and easy to cheat but it does accomplish a "simple leaderboard" to give that finishing touch. Another way is to just write it to file and encrypt it for some added security.
Otherwise, if you have a website hosted somewhere, it will likely have a MYSQL server too. You can sent web/http requests to a php script and store and retrieve it from there in a mysql DB. I did this once and worded like a charm, without the hassle of hosting some random db somewhere.
Sugestion: Connect to Database, MAKE REST API CALLS using JSON AND USE RecyclerView use data from Database.
Cumps
I'm creating an android application that helps prevent violence against women. I'm done creating the login and registration module. Now, I'm using voice recognition as an alarm and if it recognizes the word "help" the silent alarm will be triggered. I'm wondering how can I update the database once the user says "help". I want to store the word "help" in the database if the user says it. And also, I want to store his/her current location through GPS. Any help would be much appreciated. Thank you!
You want to store it in local db (sqlite) or you want to send the information to your server and store it in the database there?
I'm new to the android development, and programming in general.
I'm developing app to create football statistics for each player, and in the long run I'm using SQLite to store data. However I was wondering if there is a way and if it will make sense, to store data during the run of my application without inserting it to the db, every time user is trying to add new statistics.
Also I'm wondering if there is a point in doing that, my biggest concern is that inserting data to a db all the time will slow down my app, and I would appreciate what more experienced developers do know, and think about this 'issue'
I was trying to research the topic, however all I got was storing data in db, and using SharedPreferences and I don't think that's what I'm looking for, however I can be wrong.
please help.
SQlite is what you're looking for. SharedPreferences are for just that - preferences, not large amounts of stats.
Put your database code in a separate thread and you won't notice any slow down in your app. Ask back here for help on this.
I can't speak to android directly but I have faced similar design issues on iPhone and desktop applications.
It depends on the specifics of the application as to what would be the best way. If your app is mostly about entering plays and saving statistics, I would keep a small set of the latest statistics in memory enough to populate the user interface and then create a "data manager" running on a background thread whose sole purpose was to insert these newly added statistics to the database.
Honestly, I would put it in the DB immediately. With the way android works, if your user navigates to another app (or possibly even receives a phone call) the data they have already entered could be lost.
It is possible to cover that contingency obviously (saving in onPause, etc.), but I've always felt it was safer to get the data into permanent storage as soon as possible. (Note this is a hotly debated topic, I'm merely stating my preference).
Saving to the DB immediately doesn't affect app speed (depending on how much of what type of data you are inserting) so much as battery life. Accessing permanent storage takes more in terms of power as there are several more steps the processor needs to take.
If you do all your DB activities in a thread other than the UI thread the transactions will be almost completely unnoticable in terms of app speed.
If you use implement Loader callbacks it should not slow your application down. Have a look at the Loader classes. They are available through the Android compatibility library.