Tag Archives: text

8,546 views

Horizontal marquee text in Button android example

If a button have focus, marquee will run. Important: android:singleLine=”true” android:ellipsize=”marquee” Optional: android:marqueeRepeatLimit=”1″ // main.xml <Button android:layout_width="150dip" android:layout_height="wrap_content" android:text="My button with a long text for marquee as a example source code" android:singleLine="true" android:ellipsize="marquee" android:marqueeRepeatLimit="1"/>

Posted in Android Examples Code | Tagged , , | Comments Off on Horizontal marquee text in Button android example
11,363 views

Append text and ad text to TextView Android example

String s = "Some text for appending\n"; TextView mTitle = (TextView) findViewById(R.id.title_text); mTitle.setText(R.string.app_name); // insert text from strings.xml mTitle.append(s); // append string like a variable value mTitle.append("My string will appended\n"); // append string You can insert this source code into … Continue reading

Posted in Android Examples Code | Tagged , , , | Comments Off on Append text and ad text to TextView Android example
2,711 views

Titlebar title bar change text setTile Android example

Change the title associated with this activity. If this is a top-level activity, the title for its window will change. If it is an embedded activity, the parent can do whatever it wants with it.   String sTitle = "My … Continue reading

Posted in Android Examples Code | Tagged , , , , | Comments Off on Titlebar title bar change text setTile Android example
7,989 views

ListView add item click item basic Android example code

Definition of ListView in layout main.xml file Android example   <ListView android:id="@+id/idListView" android:background="#7700CC00" android:layout_height="wrap_content" android:layout_width="fill_parent" /> Code in Main.java ListView example source code Java Android public class Main extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main);   … Continue reading

Posted in Android Examples Code | Tagged , , , | Comments Off on ListView add item click item basic Android example code
7,164 views

How set gray text to EditText Android example

Example source code for Android development. How set gray text to EditText when EditText is blank. Hint text to display when the text is empty. In layout/main.xml insert to EditText row Attribute Name android:hint=”Some text”   <EditText android:id="@+id/myEdit" android:layout_height="wrap_content" android:layout_width="fill_parent" … Continue reading

Posted in Android Examples Code | Tagged , , | Comments Off on How set gray text to EditText Android example
8,028 views

TTS text to speech Android example

Android development example source code // import import android.speech.tts.TextToSpeech; import android.speech.tts.TextToSpeech.OnInitListener; // you have to add implementation public class Main extends Activity implements TextToSpeech.OnInitListener { private int _langTTSavailable = -1; // set up in onInit method // declaration private TextToSpeech … Continue reading

Posted in Android Examples Code | Tagged , , , , | Comments Off on TTS text to speech Android example
7,117 views

EditText text changed java Android

Google Android example source code – is text changed in EditText ? EditText hEditText; // TextChanged in onCreate hEditText = (EditText)findViewById(R.id.idEditText); hEditText.addTextChangedListener(new TextWatcher() { public void afterTextChanged(Editable str) { }   public void beforeTextChanged(CharSequence s, int start, int count, int … Continue reading

Posted in Android Examples Code | Tagged , , , | Comments Off on EditText text changed java Android