0

I am going to create coupons and offers application. And I update local coupons and shopping offers in my web server and android app can download coupons and offer banners from my web server. Since there is no web interface(to access by desktop browser.), I thought of two different methods to pass data to my app.

  1. First one is I upload sqlite3 database with coupons and banners and android apps download it. Like here https://stackoverflow.com/a/1055566/982677

  2. I upload XML file and android app will download XML file and read it via XML parser.

If there is another method please tell me.

Thank you!

Community
  • 1
  • 1
Isuru
  • 3,818
  • 13
  • 49
  • 64

4 Answers4

0

the way i use, and find the easiest to use is to store data on the server in a MySql database and use php scripts to retrieve data from the database.

on the android side you can use DefaultHttpClient and retrieve data from the php scripts in json format. since android has a json parser, its easy to get the data from the json sent by the server.

Also the method you suggested with sqlite is good, but then for ever new data to be added, you'll need to put it in sqlite database and update the database file on the server. which is tedious as compared to updating records in MySql.

Anurag Ramdasan
  • 4,189
  • 4
  • 31
  • 53
0

You will send request on some URL (API) from your android device and your API will return data either in Json or XML format.Then using Parser you can consume data in your app.

Sam
  • 322
  • 1
  • 6
0

i prefer Json for this. Android has a json parser and its easy to get the information out of the code.

Fabian Knapp
  • 1,342
  • 13
  • 27
0
DataBase Server  << Web Service >> Android Device
Yaqub Ahmad
  • 27,569
  • 23
  • 102
  • 149