在学习Android之前我应该​​学习Java吗

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3496191/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-14 01:18:09  来源:igfitidea点击:

Should I learn Java before learning Android

javaandroid

提问by Eugene

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

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

采纳答案by Jon Skeet

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

我绝对会先学习Java。不要费心学习 servlets、Swing 等东西——而是学习:

  • The core language
  • Collections
  • IO
  • String handling
  • 核心语言
  • 收藏
  • 输入输出
  • 字符串处理

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

试图了解这些,同时学习一个全新的环境,将使很多难以制定出你要去哪里错了。

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.

请注意,这并非特定于 Android - 我总是鼓励开发人员在学习本机 UI 或 Web 框架等“外围”技术之前先学习新平台的“核心”。

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.

我以前见过人们尝试这样做 - 从字面上问关于高级场景的复杂问题,同时不了解语言的基础知识。有时他们遇到的问题是由于他们使用的复杂 API,有时是由于基本的误解 -但问题在他们看来完全相同。他们无法区分不了解方法参数是如何传递的,以及难以跨线程 UI 操作。就他们而言,“出了点问题”。当你没有坚实的基础时,每一步都是痛苦的。

Aside from anything, as boring as console applications with no interaction might be, they're reallygreat 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.

除了东西,无聊,没有任何交互可能是控制台应用程序,他们真的只是快速测试一些伟大的事情。您通常不需要担心线程、权限、图形、资源等。另一个测试您理解的好方法是通过单元测试。与其使用正常的测试优先方法,不如编写一个方法并使用单元测试预测其输出,直到用完有趣的情况进行测试。完成后,您将获得代码功能的完整记录 - 将其保留以备日后使用,以防您需要重新审视您正在测试的概念。

回答by Robert

Learning is always easier when you have a goals to work towards. If your goal is to do primarily Android programming, focus on that and you'll pick up Java on the way.

当你有一个要努力的目标时,学习总是更容易。如果您的目标是主要进行 Android 编程,请专注于此,然后您将学习 Java。

回答by Javi

The tutorial given in the Android Developer Website is hard to understand if you don't know anything about java. I'd recommend starting with Java basics and then go on with Android. It would be the best way to understand everthing in an easier way.

如果您对 java 一无所知,则 Android 开发人员网站中给出的教程很难理解。我建议从 Java 基础开始,然后继续使用 Android。这将是以更简单的方式理解一切的最佳方式。

In Java, you'll also have to focus the way to do things efficiently because mobile battery is a matter to take into account in mobile applications.

在 Java 中,您还必须专注于高效做事的方式,因为移动电池是移动应用程序中需要考虑的问题。

回答by laolaowhn

if you know c# ,you can start android now

如果你知道c#,你现在可以开始android

回答by phalewail

Yes I would learn at least the basics of Java prior to starting on Android.

是的,在开始使用 Android 之前,我至少会学习 Java 的基础知识。

Starting in Android would be like learning to scuba dive before learning to swim, sure you could probably struggle your way along, but you'll be making the process unnecessarily more difficult for yourself.

从 Android 开始就像在学习游泳之前学习水肺潜水一样,当然你可能会在前进的道路上挣扎,但你会不必要地使这个过程变得更加困难。

回答by Thess

Java first if you know C# its close enough where you can do it the way you wanted. otherwise, definatly java.

如果您了解 C#,首先是 Java,那么它足够接近您可以按照自己的方式进行操作。否则,肯定是java。

Learn to open a file, deal with user input especially strings, learn all the basic keywords

学习打开文件,处理用户输入尤其是字符串,学习所有基本关键字

if your new to dev in general, learn looping, branching, embedding decision making. "your a long way from android in this case i would say" a good book will help a lot more then the free crap youll find online. i went the online route for months and stuggled. grabbed a good book and was moved on the android in 2weeks. if you know where to look, good books are also free ;)

如果您一般来说是开发新手,请学习循环、分支、嵌入决策。“在这种情况下,你离安卓还有很长的路要走”,一本好书会比你在网上找到的免费废话更有帮助。我走了几个月的在线路线并陷入困境。抓住了一本好书,并在 2 周内在 android 上移动。如果你知道去哪里看,好书也是免费的;)