Updating a SQL database on an Android app with data from an SQL database on a server -
i need help, app created database on creation @ minute.
what want information in database on server or pc , load app. needs server app, not again.
i have no idea how this, have ideas?
first, should question wide. contains alot of technologies. so, i'll give breif walk through here. should figure out rest on own. , then, can come , ask more specific questions.
that said, here path should take:
on server, implement rest api respond caller data in server database.
example: http://your.server.com/api/somedata
calling url
get
method should return data want in json format.from android application, call url , save response in
string
.- parse json string ( can use gson ).
- save parsed data local database.
if 1 developing server api, book recommended reading:
update
say have table in server database called (table) columns col_1, col_2, col_3.
you implement php page called 'table.php' return following:
{ "items": [ {"col_1": "value_1", "col_2": "value_2", "col_3": "value_3"}, {"col_1": "value_2", "col_2": "value_3", "col_3": "value_4"}, {"col_1": "value_4", "col_2": "value_5", "col_3": "value_6"}, ... ] }
in android application call http://your.server.com/api/table.php
page method, parse json returned (above) , save local database.
you can each database table on server, until have data saved locally in android application.
this wont best design decision, considering knowledge topics, fair starting point.
Comments
Post a Comment