How to store the content for android application - android

I'm a complete newbie in android development with some basic programming knowledge. Right now, I want to develop an E-Commerce app which allows the user to upload pictures for the public to browse through. However, I have no idea how should I store all the data, including the details(username and password) of the user, in the server. As far as I know, the database most often used in android is SQLite, but I'm not sure whether it's suitable to be used in my case.
Please shed some light. Any form of help would be much appreciated. Thanks in advance.

You could set-up a backend using some database (eg. MySQL) and some programming language (eg. PHP) as well as some kind of web-server (eg. Apache).
You would store the products,user data in tables of the database. Pictures would be stored on some directory on your server and you could store references to their path in the respective fields.
Your client (android) would load the products list as well as submit new products via issuing requests to your server back end, and perhaps store them in some SQLite database if you need the old items viewed to remain viewable without an internet connection.
A few tutorials to get you started:
http://www.androidhive.info/2012/05/how-to-connect-android-with-php-mysql/
http://www.tutorialspoint.com/android/android_php_mysql.htm

If you'll create an e-commerce mobile app, it cannot exists as a mobile app alone because it needs to connect to other users. You need to integrate it to a web service or a cloud service to tasks such as getting the item data, images, and other tasks involved. There are Baas (cloud) that you can use such as Parse and Kinvey.

Related

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.

Sqlite for Android

I m developing an app similar to uber with android as front-end with rest api to serve data which is stored in mysql.
I would like to know if sqlite is used instead of mysql to achieve the above process because of the reasons sqlite exist in phone and data 'll be deleted after uninstalling the app.
sqlite database in android is used to store data which will not be stored in the backend but inside your phone only which you would not like to fetch from network everytime! for instance- user's ride history or user specific data. Although they'll need to be updated in regular interval.
In mysql you would need to store the backend data. so these two are two different things.
i hope you understand the diff among these and if you don't you should read a lot about these.

Android application to store and access data on/from a local server

There is already a portal system which is based on the web, and allows the teachers to enter the attendance data. But it takes extra efforts from teachers to write it once on paper and then to update the data on the server.
I am developing an Android application. This app facilitates the teachers to take attendance of students on mobile itself, then upload it to the server, hence reducing the use of pen and paper. Firstly it asks the user to sign in, then it displays the options of various semesters + sections + subjects which are fetched from the central server.
Now, I know how to make the application, I know MySQL.
I want to know what kind of structure is required to make such an
app
How do I connect my app to the local server ?
Is it necessary to use some web based data storage ?
Because I have not enough repotation to comment. I would advice you to use the retrofit libary. It makes rest communication easier. You can include it with gradle and it has many tutorials available.
you will have to use sqLite for local data base in android. you can refer official tutorial for examples
It is not required to use web based data storage as long as you are fine with data being in device itself.

Geting started: Android development online database

Im developing an android app, and would like to have a database stored somewhere online. My app is a native app. I checked the android development page and it just shows how to store to the SQLite database.
Are there any resources out there that would help with this? Are there any framework such as the ADO.net entity framework that can with with doing databasing?
The safest and easiest way I know of, is using a webservice which would interact with the online DB (PHP and MySQL works great together, and also many free web host provides them.
Then you can perform POST or GET requests from your app to the webservice, which will query the DB (update it, read from it, etc)
https://www.google.com/search?q=php+mysql+webservice
http://www.androidsnippets.com/executing-a-http-post-request-with-httpclient
Links to get you started...

What would I need to do in order to connect to a central database with Android?

I'm about to build a GPS Spot Finder application with Android and I am trying to decide what requirements are feasible and what aren't. The app would enable users to essentially add different spots on a Google Map. One of the problems would be fetching the data, adding new spots, etc, etc. This, of course would mean the database would have to be online and it would have to be central. My question is, what kind technologies would I need to make this happen? I am mostly familiar with XAMPP, PHPMyAdmin and the like. Can I just use that and connect Android to the database? I assume I would not need to create a website...just the database?
What different approaches can I take with this? Be great if people can point me in the right direction.
Sorry if I don't make any sense and if this type of question is inappropriate for Stackoverflow :S
Create a website to access the database locally, and have Android send requests to the website.
If users are adding spots to a map that only they see, then it makes sense to keep the data local to Android using a built-in database (SQLite). That looks like
ANDROID -> DATABASE
You can read up about SQLite options here.
If users need to see all the spots added by all other users, or even a subset of spots added by users, then you need a web service to handle queries to the database: Connect to a remote database...online database
ANDROID -> HTTP -> APPLICATION SERVER -> DATABASE
Not only is trying to interface directly to a database less stable, but it may pose risks in terms of security and accessibility.
Never never use a database driver across an Internet connection, for any database, for any platform, for any client, anywhere. That goes double for mobile. Database drivers are designed for LAN operations and are not designed for flaky/intermittent connections or high latency.
Additionally, Android does not come with built in clients to access databases such as MySQL. So while it may seem like more work to run a web service somewhere, you will actually be way better off than trying to do things directly with a database. Here is a tutorial showing how to interface these two.
There is a hidden benefit to using html routes. You will need a programming mindset to think through what type of data is being sent in the POST and what is being retrieved in the GET. This alone will improve your application architecture and results.
Why not try using something that is already built into android like SQLite? Save the coordinates of these "spots" into a database through there. This way, everything is local, and should be speedy. Unless, one of your features is to share spots with other users? You can still send these "spots" through different methods other than having a central database.
And yes, you just need an open database, not a website, exactly. You could technically host a database from your home computer, but I do not suggest it.
If you are looking at storing the data in your users mobile nothing better than built in SQLLite.
If you are looking at centralized database to store information, Parse.com is a easy and better way to store your user application data in centralized repository.
Parse.com is not exactly a SQL based database, However you can create table , insert / update and retrieve rows from android.
Best part is it is free upto 1GB. They claim 400,000 apps are built on Parse.com. I have used few of my application typically for user management worked great for me.

Categories

Resources