How to implement autocompletetextview in Android Studio with an API call?
<p>I am trying to use the autocompletetextview in Android Studio to provide suggestions for every letter keyed-in by the user.</p>

<p>Every time a letter is keyed-in, an API call is made like this,</p>

<pre><code>http://dev.markitondemand.com/MODApis/Api/v2/Lookup/json?input=app
http://dev.markitondemand.com/MODApis/Api/v2/Lookup/json?input=appl
http://dev.markitondemand.com/MODApis/Api/v2/Lookup/json?input=apple
</code></pre>

<p>The JSON array that's returned from the API call is populated in the suggestions list-box.</p>

<p>So far I got the <strong>activity_main.xml</strong> file like this,</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context="com.example.raam.stockmarketviewer.MainActivity"&gt;

    &lt;AutoCompleteTextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/stocks"
        android:hint="@string/hint" /&gt;
&lt;/RelativeLayout&gt;
</code></pre>

<p>After this how should I structure the <strong>MainActivity.java</strong> file to accomplish the auto-suggestions feature?</p>