10

I want to implement an Autocomplete mechanism for an EditText field, but the list of autocomplete comes from the server. I looked into AutoCompleteTextView but it only supports fixed strings by default.

I'm just talking about the UI. I'll be issuing a http request to my webserver and getting the JSON result back. When do I fire the request and how do I plug it into the UI?

Saurav Shah
  • 661
  • 3
  • 8
  • 16

2 Answers2

10

I think that you could use the AutoCompleteTextView, like in this example: http://developer.android.com/reference/android/widget/AutoCompleteTextView.html

...but in order to use your server, you'll have to tweak your Adapter. That's what it's for :)

**EDIT: ** Here's a nice example: How do I Use AutoCompleteTextView and populate it with data from a web API?

Community
  • 1
  • 1
Igor Deruga
  • 1,504
  • 1
  • 10
  • 18
0

It depends on what kind of service offers your server. For example if it is a web server, you should execute a http request.

Sebastian Breit
  • 6,137
  • 1
  • 35
  • 53
  • 1
    Sorry my question was not clear enough. I'm just talking about the UI. I'll be issuing a http request to my webserver and getting the JSON result back. When do I fire the request and how do I plug it into the UI? – Saurav Shah May 01 '12 at 14:42
  • I am also facing similar issue..please post the code if someone found a solution – O__O Jun 20 '12 at 14:54