Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Java Android
Hello freinds,
 
I am building an android app, in which i am aiming to give user suggestions of my application
 
text whenever he uses editText to enter something in any application.
 
Is this possible? If my app runs as a service, or is there some other way.
 
Thanks for your help in advance!!
Posted 16-Mar-13 11:50am
Edited 16-Mar-13 11:55am
v3

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Sure. What you need is called AutoComplete text. This is text suggested to the user based on the first few letters typed, which takes into consideration possible suggestions you include, or previous text typed.
 
public class CountriesActivity extends Activity {
     protected void onCreate(Bundle icicle) {
         super.onCreate(icicle);
         setContentView(R.layout.countries);
 
         ArrayAdapter<string> adapter = new ArrayAdapter<string>(this,
                 android.R.layout.simple_dropdown_item_1line, COUNTRIES);
         AutoCompleteTextView textView = (AutoCompleteTextView)
                 findViewById(R.id.countries_list);
         textView.setAdapter(adapter);
     }
 
     private static final String[] COUNTRIES = new String[] {
         "option1", "option2", "bla bla bla", "etc.", "chose me"
     };
 }</string></string>
  Permalink  
Comments
Michael Haephrati at 16-Mar-13 17:02pm
   
If you liked my answer please "accept"it and vote for it :) Now as for your questions, if you want to merge user inputs for all users, you can do it (and it is a great idea!) but it will not take place automatically. You need to do it programatically. So your application doesn't necessary have to run online this time. Just write a routine that periodically update the server, and the server will update all users.
Monster Maker at 16-Mar-13 17:08pm
   
Yep i do like your answer? :)))
Thanks for appraisal, if app went gr8,, ur name will be mentioned their too... :)!!
 
LL b back soon!
Michael Haephrati at 16-Mar-13 17:10pm
   
Let's keep in touch. My email is : haephrati@gmail.com. Send me a private email and we can continue from here.
Monster Maker at 16-Mar-13 17:12pm
   
code project worked for me.. :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web01 | 2.8.1411023.1 | Last Updated 16 Mar 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100