-1

I have some register into sqlite database, i want to send all that register into mysql using php web server. i can do receiver all register from mysql to sqlite usin JSONparser and HttpResquest.

can help to send all register sqlite to mysql (using php server)

1 Answers1

0

Your question is too vague, but I think you could have a look at this tutorial, it explains well how to establish a communication and exchange information between Android and a Php server : http://www.androidhive.info/2012/05/how-to-connect-android-with-php-mysql/

EDIT :

Basically, here is how you could do that : in your main activity, you will instanciate a class that inhererits AsyncTask :

AsyncTask Android example http://developer.android.com/reference/android/os/AsyncTask.html

You will pass to this class a url to access your php web service. In this class, you will find a method called doInBackground. In this method, you will do all the processing to retrieve your data from your SQLite database :

http://www.androidhive.info/2011/11/android-sqlite-database-tutorial/ http://www.vogella.com/articles/AndroidSQLite/article.html

Then, you will have to build a JSON object that you will send to your web service :

http://www.vogella.com/articles/AndroidJSON/article.html http://androidexample.com/JSON_Parsing_-_Android_Example/index.php?view=article_discription&aid=71&aaid=95

And then on your server side, you can use the first link I provided to get the json data and store it into MySQL

Community
  • 1
  • 1
jbihan
  • 3,053
  • 2
  • 24
  • 34
  • I want to do is pass data from a query to a sqlite db and tranfers to mysql db, in the example it gives me a record single step within an EditText, I spend all my record sqlite to mysql db ... help! – heriberto777 Aug 29 '13 at 21:26
  • Well, the strategy is the same. In an AsyncTask, you will have to retrieve the records from your sqlite database, then construct a JSONObject that you can pass to the Php server. I can't write it all for you, but again, this web site (and others) give you plenty of examples. Please browse the web site I gave you, there are more examples regarding SQLite, JSON and AsyncTask – jbihan Aug 29 '13 at 22:08
  • I have updated my answer with different links so that you can find information how to do that. I hope that will help you ! – jbihan Aug 29 '13 at 22:20