wood burning stoves 2.0*
The moose likes Android and the fly likes Making my first Android app (and got stuck) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Android
Bookmark "Making my first Android app (and got stuck)" Watch "Making my first Android app (and got stuck)" New topic
Author

Making my first Android app (and got stuck)

Silviu Stelian
Greenhorn

Joined: Apr 13, 2011
Posts: 1
Hello everybody

I just started developing apps for Android in Eclipse and I came upon an interesting challenge. I started working on an application that:
When launched, shows an input field to enter a sentence and a 'Process' button
When 'Processed' button is pressed, the application shows the same sentence (pretty easy so far right? ) with the following modifications:

The first and last letter of each word is kept the same while all other letters (if any) are randomly mixed.

And here is where I got stuck as I have no idea where to begin doing it.

Thanks and keep coding
Anantha Sharma
Ranch Hand

Joined: Sep 01, 2010
Posts: 43

this might of some help.

http://www.java-forums.org/new-java/3852-word-scramble.html
Nidhi Sar
Ranch Hand

Joined: Oct 19, 2009
Posts: 252

Silviu Stelian wrote:
And here is where I got stuck as I have no idea where to begin doing it.


Can you show the code you have so far & what is the error/logic problem you are getting? That might be helpful in answering the question


"A problem well stated is a problem half solved.” - Charles F. Kettering
SCJP 6, OCPJWCD
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5812
    
    7

Are you asking about how to write a method that scrambles the letters in a word, all but the first and last letter? If so, that has nothing to do with Android specifically; it is a basic Java algorithm (think shuffle sort)

By the way, I wrote that exact method many years ago. The idea comes from some research someone did that even if you misspell words in that way that the reader can still understand what you wrote. I'll post the link when I find it - it is in the comment of the class that implements this method. (Well, the comment didn't contain the URL, but I did find this: http://www.douglastwitchell.com/scrambled_words.asp. There is also evidence that this was a hoax, that no such research was done.)

No, I will not post my code. But I would be happy to discuss and critique your algorithm for how to do this. It really is a simple algorithm. Though I have to admit that my algorithm was not optimized - I used it as part of a mock performance test so making the JMV work a little harder was part of my goal.


JBoss In Action
Poparlan Stefan
Greenhorn

Joined: Apr 18, 2011
Posts: 1
Silviu Stelian wrote:Hello everybody

I just started developing apps for Android in Eclipse and I came upon an interesting challenge. I started working on an application that:
When launched, shows an input field to enter a sentence and a 'Process' button
When 'Processed' button is pressed, the application shows the same sentence (pretty easy so far right? ) with the following modifications:

The first and last letter of each word is kept the same while all other letters (if any) are randomly mixed.

And here is where I got stuck as I have no idea where to begin doing it.

Thanks and keep coding

have you finished this project?
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5812
    
    7

Hmm, methinks that Poparlan and Silviu are taking the same class and are asking us to do their homework...

Note that we are NotACodeMill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Making my first Android app (and got stuck)
 
Similar Threads
Android sources of information - twitter / RSS / blog feeds etc?
Dead lock in GUI?
learn android
Android market place upgradation problem
Shuffle a string