Results 1 to 1 of 1

Thread: Java android

  1. #1
    amandricel is offline Member
    Join Date
    Apr 2011
    Rep Power

    Default Java android

    I have a problem with a small project.I need to create a a programm that has a field for a user to enter a text and a button that when pressed ,the first and last letter ef each word has to remain the same,and the other ones changer randomly.
    Somethin like this:
    before:The car is very fast for this road.
    after:The car is vrey fast for tihs raod.
    This is what i've done so far(the fisrt and the last letter of the sentence remain the same and the all the other ones change randomly)

    import java.util.ArrayList;
    import java.util.Collections;

    import android.os.Bundle;
    import android.view.View;
    import android.widget.Button;
    import android.widget.EditText;
    import android.widget.TextView;

    public class MixWords extends Activity {
    /** Called when the activity is first created. */
    public void onCreate(Bundle savedInstanceState) {
    final EditText TextEdit = (EditText) findViewById(;
    final TextView mix =(TextView) findViewById(;
    final Button button = (Button) findViewById(;
    button.setOnClickListener(new View.OnClickListener() {
    public void onClick(View v) {

    // Perform action when clicking


    private void MixMe(String word) {
    // TODO Auto-generated method stub
    ArrayList<Character> all = new ArrayList<Character>();

    for (int i = 1; i < TextEdit.length()-1; i++) {//starts from the second character

    char a = word.charAt(0);//The first char

    char b = word.charAt(TextEdit.length()-1);//The last char

    String result = "";

    for (Character character : all) {
    result += character;

    mix.setText(result);//shows the the mix string

    Last edited by amandricel; 04-21-2011 at 09:14 PM.

Similar Threads

  1. Android USB
    By Blackberrylerner in forum Android
    Replies: 0
    Last Post: 01-15-2011, 06:05 AM
  2. Android Java Programming: Need Help from Skilled Programmer
    By AndroidAppNewbie in forum New To Java
    Replies: 3
    Last Post: 09-18-2010, 03:41 PM
  3. Android
    By sspkiet in forum Android
    Replies: 1
    Last Post: 09-03-2010, 02:14 AM
  4. Replies: 0
    Last Post: 02-16-2010, 11:07 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts