Database for android mobile application [duplicate] - java

This question already has answers here:
webservices on android eclipse
(2 answers)
How to connect Android App connecting to a web service
(4 answers)
Closed 8 years ago.
This is a rookie question at best but here goes anyway,
I developed an android mobile application with eclipse, and my task now is to create a database (quite large) to complete my project,
I spoke to my boss about it because i found a lot of links on the web talking about sqlite databases, but this isnt what's required for this app, the data is not to be stored on the device.
My question is, in the of a android mobile app, what database should i use, which tool, how to access it? I really need help understanding, so if any of you guys has experience in this matter i could use some.
Thanks

As you say Sqlite is about storing in the device. .
It does depend on the complexity/scale of your database.. and also the expertise and learning curve that you or moreover your company are prepared to invest in.
Also where is it to be located? I have just been and am going through this myself and chose Microsoft Azure to host it. There you can choose what you want to do whether you choose a NodeJS approach and then go with something like Mongo DB or set up a 'website' with sql and all those good things.
If I were implementing a simple mobile only app with simple ie not complex storage I would take the former approach. The project I am doing also needs a website and my expertise happens to be sql so I chose the latter. That doesn't mean I couldn't have done the former if I had the time to invest in learning Mongo and node.. which is why it depends:-) Hope that helps.
Ps. Azure is worth a look though as you can get going really easy and it looks like it scales well. Of course there are others to consider.

Related

Developing Java Swing Application that will use a database to store data and display it on the JFrame [duplicate]

This question already has answers here:
Java Embedded Databases Comparison [closed]
(18 answers)
Closed 6 years ago.
Good day, I have a potentially easy question. I am in the process of developing an application for my mother. She teaches a Sunday-school class, has been teaching it for many years now, and as you can guess, has a ton of information kept hard copy. She also has complex grading styles, a store where kids can buy stuff with their good grade points (called talents).
Anyway, I come from a background where I used a database to store massive amounts of information, but the database was always static. Meaning I would open MySQL, add an instance of our local DB, and then just connect to it whenever I need to. But the problem arises, how do I distribute an application that exists statically (ie you have to put all connection details into the program) be flexible enough to where I can install my App onto any computer and it would work without a specific database connection. In other words, is there a lightweight database that can be attached to a program that will be distributed?
I don't want to store information like Students in an array list, I am bent on using a database, unless someone can convince me. (also because with a database, it is easier to make the data persistent, it seems to me)
SO the question again, how do I develop an application that will use a database, but will also exist when you distribute the application to other computers without having a network database that has to be connected to every time the app is run?
I'm sorry if it is a basic question, I come from an HMI/SCADA background, things work a little differently...
You can use H2. It is a Java database.
http://www.h2database.com/html/main.html

Best and cheapest way to store users data [closed]

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)

How to deploy an application consisting of a front-end and back-end on one storage device [closed]

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 8 years ago.
Improve this question
I need to submit some software to the university I attend and this software must be runnable from a storage device. The software was designed with an MVC architectural structure and was implemented using Java for the frontend and MySQL CE for the backend.
The bulk of my experience has been with front-end java development in Eclipse so I am quite uncertain about how to go about deployment when there is a database involved. This is actually the first 'real' application ive written which involves a database and my first attempt at implementing the the MVC pattern.
Im only a student at this point so please bear with me. This is what I know:
I can compress my java files into a jar and deploy it no problem (this I have done before)
To get this program to work I had to include a MySQL connector so this must be provided but it seems like this will all be part of the compressed jar (I obviously have some uncertainties surrounding deployment, sorry)
I wrote two scripts, one to create my database and one to populate it with test data and these must be provided somehow.
Whoever is running my software must obviously have a MySQL CE version running on their system so this must be somehow provided
I have searched around for a solution but I study by distance, so I don't really have any source of guidance aside from the awesome people on stackoverflow and the less helpful google search.
Possible solutions in my head:
somehow write an installer/configuration file similar to what is provided with commercial software (this is not my optimal choice due to the fact that I have 2 more weeks till submission and I am prepping for exams but if it is the only way please point me in the right direction .. its something I will need to know soon anyway)
On my searches through Stack Overflow I saw something which suggested that another version of MySQL - MySQL lite or something similar, could be used in these situations (again not optimal due to the amount of rework involved, but if its got to be...)
Thanks in advance
How can I embed SQL to your application
Till the time I know you can not embed MySQL to your application. Rather it will be a necessary component.
So make a user interface that will guide the user to provide the database name. Then you will use this database name to create a database (and also tables which are used by your appliction).
If your connection encounters error then tell the user to install MYSQL (Also it will be on your documentation). Then save this database name, username and password as configurations for your application (may be XML file) but for security reasons do not forget to encrypt password.
Use saved credentials for your work.
I was having the same problem earlier in my college project and I fixed it in the same way.
One strong reason not to provide MYSQL or any other software as embedded with your application is the Copyright. So respect the others and let the user to take the headache.
Edit:
When you are showing splash screen, of course your will run the test connection, in this phase you will validate the database and tables and all resources to run your application, if some error(means some thing wrong with DB) the show error to user that please configure database and show configuration help (repeat step 1, 2, 3). When it is configured correctly go on.
As seemed you are confusing some thing that you are unable to tell?

Libgdx Quiz- Using SQLite Database?

I have been learning Android development and using the Libgdx framework for over a month now and want to create a test app. The app i want to create is a quiz and im stuck on the situation on how i am going to store all the questions, answers.
Being a web developer for many years i of course thought of a database but libgdx doesn't have much support for sqlite which leaves me stuck on how to achieve the storing without using a database.
Does anyway know any way to use sqlite with libgdx or how i can achieve this another way, i would appreciate the help, thank you.
I would not go with SQLite in this case. Since it is just a test app and you probably won't have millions of questions and won't need to do any kind of querying, I'd suggest you to use JSON to store your questions.
The JSON support of LibGDX is pretty good and it works on all platforms as well. Have a look at the wiki to see some examples of how to use it.
Furthermore it means that you can easily edit your questions, since it is a human readable file format.

Simplest way to make java crud app [closed]

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 trying study web development using Java but its seems very intimidating. all the tutorials are showing very complex methods, even the sample applications that came with NetBeans. I have some experience working with PHP but none with java.
Is there any simple way to use java on the server to just accept post requests and save to database and then display data from database without using things like javaServer faces?
Is it necessary to use frameworks like spring?
Pls forgive if i am asking stupid questions. i cant seem to find where to start learning from and tutorials seem too confusing.
Links to any good article will be very helpful
Thanks
For this purpose you should be familiar with the Servlet API, and preferably also with MVC frameworks and so on.
For the whole world to be a bit more straightforward for you and to steer away from the average-PHP-community-drawbacks (e.g. nobody tells you how to code well), I'd recommend to read THIS book.
But first of all, start HERE and then move on to THIS SITE.
The other way around (talking about DB access, not the web service here) is using raw SQL via JDBC which I won't recommend unless you have a good reason for it and you're already familiar with using a DB the right way (mysql and mysqli libs of PHP won't necessarily drive you the right path; PDO most probably will however).
Of course you don't necessarily need to use frameworks, but you're (actually in any language) way better off using them. Yes, probably the closest thing to the "nobrainers-php-methodology" (mindless coding; wiring UI, DB access and business logic together in a single file; etc.) is using the Servlet API, and then through a java.sql.Connection send your GET/POST data directly to the DB via JDBC. But doing so is slightly worse than cruelly murdering cute little squirrels/bunnies/kitties/insert_your_favourite_cute_creature_here
You'll also need a servlet container, most common of which is Apache Tomcat.
To learn Web Developing with Java Play Framework 1 is very nice:
Step by Step guide for a cool blog: http://www.playframework.com/documentation/1.2.7/guide1
Documentation: http://www.playframework.com/documentation/1.2.7/home
CRUD module documentation: http://www.playframework.com/documentation/1.2.7/crud
You get compile feedback directly in the browser.
Run your tests in the browser.
No redeployment to containers necessary/hot deployment.
No servlets.
Play 2 is already around, but going through Play 1 is much simpler if you are new a the Java world.

Categories

Resources