jQuery in Action, 2nd edition*
The moose likes Android and the fly likes Creating one's first android app Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "Creating one Watch "Creating one New topic

Creating one's first android app

Ralph Ostrander

Joined: Dec 09, 2012
Posts: 2
I am new to any programing this is my second program I have the Android SDK bundle.
I want to do this same thing by clicking a button.
How do you make a button execute this.
I just want it to run the top command.

Seemed like a good mission to learn. Then I just might need to learn more before I can do it.
Please be kind.

This is where i was going.
Any help would be nice.
Sorry to hijack thread.

Campbell Ritchie

Joined: Oct 13, 2005
Posts: 36476
Welcome to the Ranch

Please don’t hijack threads, with or without apology. See what happened: you went 72 hours without a response. Please always use the code button; I have edited your code and you can see how much better it looks Unfortunately, you can also see it is incomplete and appears to stop part‑way through a line.
Is this really your second app? If so, ditch the Eclipse and use a text editor and the command line. Reserve IDEs for when you are more experienced.
It looks like code written by somebody much more experienced than second app, in which case, you can use Eclipse after all. I am not familiar with Android, but can’t see anything obviously wrong. What is going wrong? Is it something in the code you didn’t post? Give us more details and we shall see if we can’t help quicker than 72 hours
Ralph Ostrander

Joined: Dec 09, 2012
Posts: 2
Thanks for the reply. It really is my after hello world I watched some tutorials on youtube.
and I got it to work thanks for your help, I wont hijack any more threads.

My AVD was set up wrong for this. What I found in case some one else is having trouble.

You can't simply run 'su' on the emulator, there's no root access by default. You'll need to install the 'su' program as well as the SuperUser.apk, and you'll have to do this each time you start the emulator unless using snapshots.
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 36476
What’s su? For those of us who use *nix, su means change into superuser (=administrator) mode.
Steve Luke

Joined: Jan 28, 2003
Posts: 3943

Campbell Ritchie wrote:What’s su? For those of us who use *nix, su means change into superuser (=administrator) mode.

It means the same thing for Android, which is a version of *nix. The superuser mode is generally disabled by default, and the SU program Ralph describes gives access to it. Note that for actual handsets to get the SU installed you generally have to ROOT your phone, which most carriers and handset makers try to prevent.

Krishna Srinivasan
Ranch Hand

Joined: Jul 28, 2003
Posts: 1844


this article may be useful for you. reply back if you have more questions.

Krishna Srinivasan
Spring Tutorials, OCAJP Mock Questions, 400+ OCPJP Mock Questions
I agree. Here's the link: http://aspose.com/file-tools
subject: Creating one's first android app
Similar Threads
force closes
launch skype after click button in the app
reading XML layout contains a SurfaceView
Fetching contacts from phone book
interface and constructor