I have an online store (like PC WORLD) and I want to create a Android app of this store, too.
The back-end of this online store is written by PHP & MySQL Database. So all of the data is stored in MySQL Database.
So what is the best way to retrieve information from remote MySQL server to my Android app?
Best regards,
Julius
Create a web service or some sort of API for your site.
Have you thought about using your current web site and just creating a web view app? In other words just creating a web browser window minus the address bar, and other controls? You could create one custom webpage then all you would be doing in the native app language is the browser window.
To retrive data from mysql the best way is create your web as android app or simply convert this web application to an android app by using www.web2apk.com.
This site will create an apk file of your web application. So you dont need to make any new database for android it will automatically retrive from same database.
You dont need to include any service for that.
Related
I have built a Java Spring Application. This application in the end after doing its work pushes data to a sqlite database.
Now the functionality that i want to add is: Once data is pushed into db, i want to send a custom notification on an app running on android wear. This custom notification should have a message and some options for user to respond to. Finally on seeing the notification on android wear the user should select one of the options and that should be stored in a database.
As i am new to android development, I cannot understand three things:
1. What kind of android application should i develop?
2. How can this android application receive some message or data from some other service (in my case java application)?
3. How to save user response to database?
Some guidance would be really appreciated.
Thanks
I will try to answer all your questions. If your current Java application is a web app, then you will end up building a mobile/wearable app that will communicate to this web app. If your current Java application is not a web app, you will either have to integrate its logic into the mobile/wearable app directly or turn it into a web app so it can communicate with the mobile/wearable app.
You will end up developing two Android apps, essentially. A mobile app for the mobile device and a wearable app that will communicate with the mobile app. This can all be done in Android Studio and in one project though, so it will basically be one application at the end of the day.
Like I mentioned above, you will have to either integrate that existing application's logic directly into your new Android mobile app, or turn your Spring app into a web app and host it on a server that your Android mobile app can call out to to get data.
Android has the concept of local databases and can actually use SQLite on the device. This is most likely how you would store the response from your service.
I am just a beginner in android app development and that's why I have many doubts. I am building one application where the user enters some data in editText. Now I want to save that data in my database. My database is running on my laptop. How would my app connect to the database? Do I need a web server in between? If yes then which web server is used for Android apps? Basically, i want to know the flow of data from app to the database.
Study more from Udacity.com, its free.
You may use a jdbc Connector to connect to database.
Connect your jdbc connector over local network ip\servername and database connection string
You can use REST Service when it comes to web Service on Android like this. You can either pass the values as parameters or an Object depending on your requirement. All the best
Wamp server is best option to play with server related utilities.You can use it even if you are offline. and it provides various option for data storage. It Mainly uses MySql and PHP scripts for fast performance.
For More details Click Here
I have made App using Ionic Framework and Android Home Screen widget using Java(as we cannot create widget using ionic,i guess).
so now I want to use some data from my app to Widget.Is their any way to get this..?
i have used PouchDB in my App. is it possible to access same database in both.
is it a way to access same encrypted file from both.
is angular-storage same as shared preference in android.as i have stored some data using angular-storage.
I don't know if the correct term is "integrate" or "connect" a finished web service in a android application. I mean,
Is there any possibility to "integrate" a finished RESTful Web Service in a Android application, which I have not developed, yet.?
Otherwise,
Are there some steps to develop a RESTful web service which I need to use from a Android application?
The last question is asked because I don't know if the first step is to finish my RESTful Web Service and then integrate it in my android application or or developing the RESTful web service and the android application at the same time.
In any case, how I can do it well? I need help to organise my mind
You will need three things:
Client(your app)
Server
Database
Lets say you have to create a login service for your app. Then your steps should be like given below:
Create a login form with android UI.
Get username and password from Edit Texts in strings.
Send these credentials to server(via http reqest).
At client side read response from url via input stream.
At the server side, use a server side technology in which you are familiar with.(If you are not familiar with any server side tech. I strongly recommend you php.)
Select/update/compare (Whatever you want) in data base and return response as a json string.
You can use server on your system. I suggest to use XAMPP(cross platform apache mysql php perl). As its name says, it includes server+database+php (its local). It will create a local apache server on your machine.
Follow this : XAMPP Tutorial , Working with XAMPP
Here are some nice tutorials of web services with android:
How to connect Android with PHP, MySQL
Using Database from an Android Application
How can I connect my local database in my application? I have a database which contains a book. I have to display it in my application in J2ME
Basically, in JME, an app can create a database which is a file stored in the RMS. Actually, there are several APIs that can help you in creating a Java ME database: Is there any option for local database like Sqlite for j2me - CLDC devices?
Anyway, I think the data in a sqlite database is not easily accessible to a JME app. It is not impossible but it, maybe, is complicated. Honestly, I don't know anyway to do it.
You have to create a server application where you access to database. Also your J2ME has to communicate with your server application for getting Data you want to display (Use HttpConnection Class).
In Mobile Application, you can not directly make connection with local or remote database. To Make Connection with Database , you need a middle tier called a web service. You can create web service in any platform like Java-Servlet, .net or in PHP. See this is a very simple example to work with MySql Database.