0

I am about to make an app that connect to database and update listview every X seconds (connection via WiFi).

My questions:

  1. Is it a good solution to keep connected app to wifi and update the list eg. every 10 seconds?
  2. What is the easiest way to communicate with database via php scripts? I was looking for this and found example with HttpClient but in Android Studio it says that this is deprecated. Then I found HttpURLConnection but I have got no clue how to use it.

Thanks in advance for your help.

1
  • you do NOT want to expose your db to the world at large. use a webservice. Commented Sep 1, 2015 at 20:45

2 Answers 2

1

Try this tutorial:

How to connect Android with PHP, MySQL

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

Comments

0
  1. I think that's not quite good way. That will consume much battery and server's traffic will increase. Try push or increase interval. 10 seconds is too short.

  2. Try this. I use this when I need a connection between server.

1 Comment

I forgot to add that the device on which the app is going to run will be connected to AC all the time. What do you mean by "push"?

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.