0

I'm new to Android and to web services in general.

This is what i gotta do: My company has a back end website(for the client to monitor the sales) that's used to manage/monitor sales on some stores and it connects to a MySQL db to store data about sales and users(usernames and passwords).

What I want to do is to get data from that database and to add (sync operations) new rows, all of this from my android app.

I googled this many times and it came up with some similar projects but using another languages.

I would like to see some code samples if possible and some how-to theory, what theory should I follow when developing this, how and what ways of communicating between android and python web services and from the web services to the MySQL database.

Thank you in advance.

2 Answers 2

1

You will need a working API, that allows you to communicate to the web service from the android application. I would read into how to write an API and how to build a RESTful service using JSON as a way of communicating between server and android app. There are alternatives to JSON, but JSON is better suited for Android than perhaps AJAX and soap is being used less and less. (Can ajax call be done in Android? It can but has limitations)

(I could only post two full hyper links as i don't have enough reputation yet to do so, you may have to remove the spaces)

API: http://sharismlab.com/blog/2012/07/21/how-to-write-an-api-for-your-web-app/

REST: www .restapitutorial. com/lessons/whatisrest.html/

JSON: htt p:// www.r evillweb.co m/article s/why-use-j son/

Sign up to request clarification or add additional context in comments.

2 Comments

All I wanted was someone to point me on the right direction. But shouldnt I be able to communicate with my python files (like i saw some PHP examples) using httpPost(link) or something similar? Yeah, I've read that about not communicating directly to the Database.
Yes and no. Read what i posted above about RestServices. That is what you are looking for. I think you are missing the understanding of how a server would work in this case. You can directly communicate between android app and a python file you have on a server. However it is poor practice to not have something inbetween that handles the relevant post requests and the python scripts.
0

You may want to check out restjee. It allows you to define and implement RESTful data access APIs without having to write any server side code. Works with just about any database.

1 Comment

your link is broken fyi

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.