0

Possible Duplicate:
Detect CPU Speed/Memory/Internet Speed using Java?

I am a beginner and I want to learn how to write Java programs for Android apps. Thinking that it would not be too difficult I thought of writing a benchmark utility.

I have spent two days solid looking through a host of tutorials and I'm no nearer my goal, in fact I think that I'm more confused. The more I read the more I struggle to understand. Maybe I should take up knitting?

How do I ask the processor what speed it's running at? If I write code (currentTimeMillis or nanoTime) how do I know that the processor is only doing what I've asked it to do?

How do I use bogoMIPS? To have access to it's information or implement it into my code. I've read /proc/cpuinfo but how do I get it's source code to implement into my own code? Or, how do I implement it into my code (but I don't know how it works, so I don't really know what the results mean.

I guess that's the bottom line question: how do I write the basic code to get the processors speed (in GB's), so that what it gives me is exactly what I am asking it. How do I control the processor so that it does what I want (in terms of calculating the speed)?

Do I simply say "processor do this calculation and nothing else, so that I know how fast you're running"?

I've followed various tutorials on Java over the past few weeks, but I'm still blank on this.

Community
  • 1
  • 1
  • I think strictly speaking yes it's a duplicate, but I think there's a wider context to the OP's question re learning the platform which merits perhaps a bit of support – Brian Nov 14 '12 at 10:11
  • 1
    I thought of giving OP an starting point as he couldn't find by himself. let him come-up with more straight forward questions. – Azodious Nov 14 '12 at 10:13
  • 1
    This question is so full of questions !!! – Unni Kris Nov 14 '12 at 10:20

1 Answers1

2

An interesting question, but without wanting to be discouraging this could be one of the most difficult things you could start with! The closer you get to the hardware, the more challenging the code is going to be. Try a simpler app which is all about UI design, and with which you can learn the basics of UI "widgets" like buttons, radion buttons, checkboxes, lists, etc, and of data storage/retrieval.

The old cliche of a "to-do list" app is a good idea to start with, if it's really learning the platform you're interested in. Just don't expect to sell millions of the finished app!

Brian
  • 6,391
  • 3
  • 33
  • 49