Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I need a large database to be stored, I have thought of using SQL to do so.I am aware of some cons of it, I do not want my data to be cleared by a user. I do not want to complete my project and regret using SQL later, if there are any suggestions in that case I would really appreciate it.
To store "large" amounts of data on the Android device, see the Training for Android: Saving Data guide:
Most Android apps need to save data, even if only to save information about the app state during onPause() so the user's progress is not lost. Most non-trivial apps also need to save user settings, and some apps must manage large amounts of information in files and databases. This class introduces you to the principal data storage options in Android, including:
Saving key-value pairs of simple data types in a shared preferences file
Saving arbitrary files in Android's file system
Using databases managed by SQLite
I think you are confusing some database terminology
SQL stands for Structured Query Language, It is a language only used to interact with a database. Just like in a conversation a language is used as a medium to convey information, but it does not matter how much information is transferred, you could speak in German or French and it would be the same. Similarly choosing whether to use SQL is completely independent of how much data you store in your database.
What I think you are trying to find the the most optimal database management system. The most popular of which are MySQL, Oracle Database, Microsoft SQL and IBM DB2. (a list of which can be found here).
I'd recommend you use MySQL as it is relatively easy and can handle good amounts of data (more than enough for an android app). Have a look at their website and see whether you like it
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed last month.
Improve this question
Account is new but I've been reading on this website for years and I now need some advice.
Still pretty new at Java and I am developing a desktop application that deals with personal information relating to the user but also their social circles.
What would be the best option to keep these info safe? I am not considering external DB (like MySql which I am using so far for my beta) as it means potential users would have to install and configure some other softwares, also not considering serialization as I don't really like the idea of an external txt file (please correct me if I am wrong about any of these two points).
Is there a way to directly store info in the application? Could someone please give me some perspective on the matter and recommend leads?
(And sorry if a previous thread covers my concerns, I did not find it!)
Thanks a lot in advance!
Good night, evening, day or morning!
Modern OS design and security principles strongly dictate that an app should not have write access to itself. There are real hacky ways (complex, hard to write, most libraries don't work well with it, and fragile, in that it'll easily break on some systems) to write into your own jar, but it's a bad design in any case, let alone when you take into account that complex and fragile.
You can't reasonably encrypt anything (because the password will have to be inside the app) unless the user has to enter the decryption password as they start your app / open your 'storage file' if it's a multi-document kind of deal, in which case, by all means, do that.
h2 is an all-java database engine, no need for the user to install separate anything, it produces a single file with the data. It's that or handroll your own serialization to a separate file in the user's home or ~/Documents or whatnot. You'll have to hardcode for each major OS the right location if you don't just want to 'write to .myapp.bin in the home dir of the user' which you can easily do via System.getProperty("user.home").
So, yes, you are wrong on both points:
DB/SQL is fine - there is no need to force the user to install a separate library. sqlite can do it (but this does involve DLLs and the like; sqlite JDBC driver takes care of this), but I'd recommend h2database.com for this purpose.
It will be a file. It won't be a txt file. This is good.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I have a report generated from a database containing about 100,000 entries, each entry contains about 10 columns, the data is stored on Amazon S3 and is generated monthly. I'm looking for some pointers on a way you recommend a way to present this many multiple pages of data on, and I want it to be sortable and because however I sort it it wont suit all users, ideally it should be searchable as well.
Is it possible to do purely client-side or is that unfeasible, do I need go back to the server. I don't have the database available but if needs be, the website is backed by a java servlet application running on Tomcat. A self contained library for doing this would be very useful.
To paraphrase the discussion above.
Providing search/paging in Javascript is not sensible because this would still require the user to download all the data in one go, and representing that amount of data in html is not going to work well.
So either have to provide a server backend and provide a mechanism for searching and paging. Or provide the data in a spreadsheet format then the user can use the capabilities of their spreadsheet tool, which is well suited to dealing with large volumes of data.
Im going to try the spreadsheet idea.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I have an app out in the market and planning to maintain basic user data somewhere on backend.
My app is free so I am NOT getting any money from users.
My question is what is the best way to store this data(data has name, email, phonenumber etc.)
One option is to use Google Mobile Backend starter kit but that seems too complex for such a small requirement.
Appreciate your help.
Thanks.
Ok, there are many options you can achieve your goal and these options depends on your proficiency in other areas apart from java and your preferences. Below is just a small list,
Server side language: php, jsp, etc
Database: MySQL, NoSQL, SQLite, etc
Webhost: any free provider (just google "Free webhosting service")
Client side: as you mentioned you already have an app on play store so you will have to update you application accordingly and release new version.
I prefer to use combination of php and MySQL for all my back end work as I feel it is very easy to create and maintain. I also use 000webhost.com as free webhosting service, this service is completely free and also supports php and MySql without any restriction.
First Step I would suggest you is to choose your web-hosting provider, sign up on it and setup your database through PHPMyAdmin (Very easy to do so if you know basic database fundamentals).
Second step would be to create an API according to your choice of server side language (I am assuming you would use php but you are free to use any other language). If you don't know any server side language then you might want to follow some online tutorial and get your self familiar with php (which is again very easy of you know some other programming language). You can simply start from coding basic functions such as retrieving all data and echo them on browser or insert some fields in database, etc. I would advice you to completely code and test all your functionality on normal web browser before you go on about updating you android application and the reason is that once you know what response you are expecting and you have tested it on computer screen it becomes easy to code it for android.
And the final step would be to update your android application, for this well know process is using json strings for sending and/or retrieving data to/from database. If you are only looking to insert few fields in database then you can also use GET or POST methods to send and receive data. And the good news is there are many great tutorials available online for HttpRequest from android you can google it yourself.
Disclaimer: I am not promoting any free/paid service provider in my answer, the only reason I mentioned name is because OP has asked twice for it. If you are thinking of downvoting or flagging the answer for that reason please leave comment and I would delete it ASAP.
I would use a simple php page that captures user data via json from Android and saves them in a MySQL db (technology simple and very cheap, there are many hosting php + mysql free or very low cost);
but if you prefer a java-oriented approach, although slightly more complex
I advise you to Google App Engine that is free (with well-defined limits):
http://www.vogella.com/tutorials/GoogleAppEngineJava/article.html
using the latter you will need to use servlets (do not recommend endpoints) and use JPA to access the database which provides GAE (NoSQL database)
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I'm developing a REST client for medical web-service for both Android and iOS platforms. After reading of different articles and blog posts I understood that I should always persist data in order to increase app speed, user experience, save network resourses and to allow user to work offline with some data. I decided to use local storage based on Couchbase Lite. But this question is data storage independend. I'm interesting in the best ways of implementing it. Currently I ended up with the next wokflow:
When the user first logs in I fetch some portion of recent data (in my case it is patients' health records and some reports.)
Then in background I populate my storage with the rest of data
Syncronize my data on push notifications to always store the last server data copy.
But I have a few questions : What is the normal size of local storage? May be some time client data can increase a lot - in such case I will delete the oldest data from the device then in order not to exceed some predefined limit? Let's say it is 50 - 100 Mb. Or I should allow user to control this and give him some interface to delete reports, records? Does the workflow I describe correct? Or may be do wrong something from the technical and UX points of view?
You should look at downloading an index (names and locations of resources, not the actual resource data) which lists all of the available resources. Display the list, and indicate for each item whether it's available locally or not. When selected, display (downloading if required). Allow editing to delete the local copy of the resource (with a select-all button).
As for storage size, this is device dependent. Apps store what data they need. The question is how much data users will be happy for you to save locally. Give them the option. You could also have a settings screen which offers to delete old resources (not accessed recently) when the size gets above XX Mb.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I am getting started working on a Java project I inherited from my predecessor. I am new to SQL, but SQLite is used to store various different types of data in this system. Previously, I always would store this type of information in internal Java data structures (i.e. Hashmap of usernames, etc.)
My question is why is SQL considered a better alternative?
SQL solves a number of problems that are not addressed by native programming languages. These may not be important for a particular application. But, here are some examples.
SQL can process data both from disk and in memory, transparently. It has the notion of a table, which is persistent and stored on disk, but the processing can all be in memory (if the table is already loaded into the page cache).
SQL seemlessly handles data as it gets larger, managing both memory and disk.
SQL handles security and authorization. New methods do not have to be invented.
SQL ensures atomicity of transactions, so you don't have to worry about partial updates to the system in the event of a failure.
SQL seemlessly enables multiple clients to access the same data, with the database taking care of concurrency issues.
SQL can readily handle multiple different types of entities and the processing needed to combine them.
Although not applicable to SQLite, SQL often takes advantage of multiple processors and multiple disks -- transparently to the application.
However, I must emphasize, this doesn't mean that all data in all applications should be stored in a database (although I do lean in that direction). You may have an application where an external data store simply isn't necessary.
An external database such as SQLite provides persistence and allows you to share data among multiple instances of your application.