Showing posts with label android programming. Show all posts
Showing posts with label android programming. Show all posts

Tuesday, June 28, 2016

Android Studio Virtual Device Error Solved karena tdk punya virtalization



http://stackoverflow.com/questions/28911176/haxm-installation-fails-claiming-vt-x-not-present

https://www.google.co.id/webhp?sourceid=chrome-instant&ion=1&espv=2&es_th=1&ie=UTF-8#q=AVD+android+studio+failed+virtualization+in+linux

Saturday, June 11, 2016

Radio Streaming Android

https://www.sitepoint.com/develop-music-streaming-android-app/
https://github.com/sitepoint-editors/SPPlayer

https://github.com/GrinnellAppDev/KDIC-Radio-Android
http://stackoverflow.com/questions/6283568/online-radio-streaming-app-for-android

http://code.tutsplus.com/tutorials/streaming-video-in-android-apps--cms-19888
http://codecanyon.net/item/stream-radio-single-station/11093098?s_rank=1
http://codecanyon.net/item/stream-radio-multiple-station/8676912?s_rank=2
http://codecanyon.net/category/mobile/android
https://www.google.co.id/#q=create+android+app+online+radio+using+android+studio&start=10


tidak bisa
https://groups.google.com/forum/#!msg/mitappinventortest/nu_mcDy9AOQ/GvZZmhocbisJ
http://www.w3schools.com/html/html5_audio.asp


bisa
http://erlangerdigital.com/?page_id=240

Sunday, May 15, 2016

app inventor android

http://appinventor.mit.edu/explore/
http://appinventor.mit.edu/explore/ai2/setup-emulator
http://appinventor.mit.edu/explore/ai2/linux.html

Friday, October 16, 2015

Android AutoCompleteTextView Example JSON

http://manishkpr.webheavens.com/android-autocompletetextview-example-json/

Hi guys today I am going to show how to develop auto complete suggestion in android using AutoCompleteTextView.
In this example i used the JSON parsing that parse the suggested word and display on AutoCompleteTextView.
This example use JSON format like this
First Create Android Project


}
Final Output:




http://manishkpr.webheavens.com/android-autocompletetextview-example-json/

Thursday, October 15, 2015

JSON array to auto complete text view in android

http://stackoverflow.com/questions/23073627/json-array-to-auto-complete-text-view-in-android

i am working on an android app where i have to parse a Json array and adapt it to an auto complete text view. I am getting correct response from my server, since i am a fresher to android and Json parsing i am not getting how to parse that json array to array adapter and add it to auto complete text view.
Can any body suggest me how to do it..?
Response as follows.
[
{
city: "bng",
area: "anagar",
id: 510000032
},
{
city: "bng",
area: "bnagar",
id: 510000021
},
{
city: "bng",
area: "cnagar",
id: 510000037
}
] 
i want area to be matched in my auto complete text view.
I created auto complete text view in my layout file.
This is how i am trying
    public class MainActivity extends Activity {

     List<String> responseList;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        AutoCompleteTextView auto1 = (AutoCompleteTextView) findViewById(R.id.autoCompleteTextView1);

        new HttpGetTask().execute();

        ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
                android.R.layout.simple_expandable_list_item_2, responseList);
        auto1.setAdapter(adapter);
    }

    private class HttpGetTask extends AsyncTask<Void, Void, String> {

        String URL = "http://xyz/cities.json?app_id=test";
        AndroidHttpClient mClient = AndroidHttpClient.newInstance("");

        @Override
        protected String doInBackground(Void... params) {
            HttpGet request = new HttpGet(URL);
            ResponseHandler<String> responseHandler = new BasicResponseHandler();
            try {
                return mClient.execute(request, responseHandler);
            } catch (ClientProtocolException exception) {
                exception.printStackTrace();
            } catch (IOException exception) {
                exception.printStackTrace();
            }
            return null;
        }

        @Override
        protected void onPostExecute(String result) {
            try {
                JSONArray json = new JSONArray(result);
                Log.v("ResponseCity", result);

                responseList = new ArrayList<String>();

                for (int i = 0; i < json.length(); i++) {
                    final JSONObject e = json.getJSONObject(i);
                    String name = e.getString("area");
                    responseList.add(name);

                }
            } catch (JSONException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
            if (null != mClient)
                mClient.close();
        }
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }
}
Any suggestions are appreciated...
shareimprove this question

2 Answers

Add the response string into a List<String> like this
 List<String> responseList = new ArrayList<String>();

 for (int i = 0; i < json.length(); i++) {
    final JSONObject e = json.getJSONObject(i);
     String name = e.getString("area");
     responseList.add(name);
  }
Now, you can set the response list to AutoCompleteTextView like this
 ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
            android.R.layout.simple_dropdown_item_1line, responseList);
 AutoCompleteTextView textView = (AutoCompleteTextView)
            findViewById(R.id.autoCompleteTextView1);
 textView.setAdapter(adapter);
shareimprove this answer
   
since responseList is created in onPost() method. i'm not able accessing it in my onCreate() method. – rubinApr 15 '14 at 3:00
   
check my updated code. i am not getting auto complete texts in my auto complete text view. – rubin Apr 15 '14 at 3:10
   
Hello, you need to set the adapter in onPostExecute after response list is added – Libin Apr 15 '14 at 3:13
   
i tried in onPostExecute but " The constructor ArrayAdapter<String>(MainActivity.HttpGetTask, int, List<String>) is undefined " error i am getting – rubin Apr 15 '14 at 4:42

http://stackoverflow.com/questions/23073627/json-array-to-auto-complete-text-view-in-android