我应该学习Java学习Android的前Java、Android

2023-09-12 23:55:11 作者:撞了怀

我应该学习Java学习Android或我可以同时做两件事之前?什么是最好的方法呢?

Should I learn Java before learning Android or I can do both things in parallel? What is the best approach?

推荐答案

我绝对会学习Java第一。不要打扰学习的东西如servlet,秋千等 - 但学习:

I would absolutely learn Java first. Don't bother learning things like servlets, Swing etc - but learn:

核心语言 集合 IO 字符串处理

想学这些,而也的学习一个全新的环境将使得很多很难制定出你要去哪里错了。

Trying to learn these while also learning a completely new environment will make it a lot harder to work out where you're going wrong.

请注意,这不是具体到Android - 我总是鼓励开发学外围的技术,如原生用户界面或Web框架之前学习的新平台芯

Note that this isn't specific to Android - I'd always encourage developers to learn the "core" of a new platform before learning "peripheral" technologies such as native UIs or web frameworks.

我见过人们尝试之前做到这一点 - 从字面上询问高级场景复杂的问题,而不是理解语言的基础知识。有时,他们一直有这个问题已经由于复杂的API,他们使用的,有时它是由于基本的误解 - 的但问题长得一模一样的给他们的。他们不能告诉不了解如何方法参数传递,并有困难的跨线程UI操作之间的差异。至于他们而言,出了问题。每一步都是痛苦的,当你没有一个坚实的基础。

I've seen people try to do this before - literally asking complicated questions about advanced scenarios, while not understanding the basics of the language. Sometimes the problem they've been having has been due to the complex API they were using, and sometimes it's been due to the basic misunderstandings - but the problems looks exactly the same to them. They can't tell the difference between not understanding how method arguments are passed, and having difficulty with cross-threading UI operations. As far as they're concerned, "something has gone wrong." Every step is painful when you don't have a solid foundation.

除了任何东西,无聊的控制台应用程序没有交互可能是,他们的真正的伟大的只是测试的东西很快。您通常不必担心线程,权限,图形,资源等来测试你的理解是通过单元测试的另一个好方法。而不是一个正常的测试优先的方法,写一个方法和predict与单元测试输出,直到你用完了有趣的情况下测试。一旦你做了,你有什么样的code没有一个完整的记录 - 保持了以后,如果你需要重新审视你正在测试的概念

Aside from anything, as boring as console applications with no interaction might be, they're really great for just testing something quickly. You typically don't need to worry about threading, permissions, graphics, resources etc. Another good way to test your understand is via unit tests. Rather than a normal test-first approach, write a method and predict its output with unit tests, until you run out of interesting situations to test. Once you're done, you've got a complete record of what the code does - keep it for later on, in case you need to revisit the concept you were testing.