您是否需要“完全”了解 Java 才能编写 Android 应用程序?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6429242/
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
Do you need a "complete" understanding of Java to program Android Applications?
提问by Xavier
I am looking to start developing applications for Android and i was wondering if you could fill me in on the know how's and the requirements on a technical viewpoint.
我希望开始为 Android 开发应用程序,我想知道您是否可以向我介绍技术观点和要求。
I have the SDK, Eclipse and Java installed and even a handset to "real" test on.
我已经安装了 SDK、Eclipse 和 Java,甚至还有一个可以“真实”测试的手机。
My question is being a complete amateur to Java and having never used the language how much java would i have to learn to develop Android Applications ?
我的问题是完全是 Java 的业余爱好者并且从未使用过该语言,我需要学习多少 Java 才能开发 Android 应用程序?
采纳答案by nhaarman
I would say you can just start with some tutorials the same way you would when starting with just Java. You'll learn along the way, just use a lot tutorials.
我想说的是,您可以像从 Java 开始一样,从一些教程开始。您将一路学习,只需使用大量教程即可。
There is not much difference for the language, but there is a great difference in the framework, ie. the way you set up applications.
语言没有太大区别,但是框架有很大区别,即。您设置应用程序的方式。
So just Java you would learn:
所以你只需要学习 Java:
public static void main(String[] args){
System.out.println("Hello World");
}
In Android it would be:
在 Android 中,它将是:
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
System.out.println("Hello World");
// Or:
Log.v("MyActivity", "Hello World");
}
to print "Hello World" to the console respectively the log.
将“Hello World”分别打印到控制台日志。
回答by Haphazard
You would benefit immensely by learning Java first. All of the "Android" code is Java-based so you will handicap yourself by not going through a few tutorials (at the least) to get caught up on Java.
首先学习 Java 会让你受益匪浅。所有的“Android”代码都是基于 Java 的,所以你会因为不通过一些教程(至少)来了解 Java 来妨碍自己。
回答by ZeroDivide
You should have a good understanding of both Java and object-oriented programming.
您应该很好地理解 Java 和面向对象编程。
回答by CodeFusionMobile
You should have a firm grip of how Polymorphismand Inheritancework in java. These are pretty central to Android development. Also, having an understanding of java memory optimizationand Threadingare useful skills for writing more advanced applications.
您应该牢牢掌握Java 中多态性和继承的工作方式。这些是 Android 开发的核心。此外,了解 java内存优化和线程是编写更高级应用程序的有用技能。
回答by Andreas Dolk
For basic applications - no, a "complete" understanding ist not essential. What you'll have to learn is to use the android framework, and I think, if you grab some android related tutorials and books, then it should be OK even if you start with basic Java knowledge.
对于基本应用程序 - 不,“完整”的理解不是必不可少的。你必须学习的是使用android框架,我认为,如果你抓住一些android相关的教程和书籍,那么即使你从基本的Java知识开始也应该可以。
(I assume, that you already know some other language and have a decent experience with object oriented programming)
(我假设您已经了解一些其他语言并且在面向对象编程方面有不错的经验)
回答by Barry Fruitman
The short answer is no since nobody has a "complete" understanding of Java anyway.
简短的回答是否定的,因为无论如何没有人对 Java 有“完整”的理解。
The longer answer is the complexity of your Android apps will be limited by your knowledge of Java. You can probably learn to write a "Hello, world!" app on day one, but it will take several months before you can write simple but useful apps. It also depends on how whether you are new to Java or new to programming in general.
更长的答案是您的 Android 应用程序的复杂性将受到您的 Java 知识的限制。你或许可以学会写一个“Hello, world!” 应用程序的第一天,但需要几个月的时间才能编写简单但有用的应用程序。这还取决于您是 Java 新手还是编程新手。
My suggestion is to get a good introductory book on Java and maybe another on Android apps and start there.
我的建议是找一本关于 Java 的很好的介绍书,也许还有一本关于 Android 应用程序的书,然后从那里开始。
Barry
巴里
回答by yep
Learn java up to understanding within reason the following concepts/implementations:
学习 java 直到在合理范围内理解以下概念/实现:
- Object Orientation (this is a biggie)
- Interfaces
- Superclassing / Extending
- Some ultra-common java APIs and syntax
- Our good friend, mr. garbage collector.
- 面向对象(这是一个大问题)
- 接口
- 超类/扩展
- 一些超常用的java API 和语法
- 我们的好朋友,先生。垃圾收集器。
Then you'll be ready to go in Android dev. I wish I had read the book "Head First" java development before starting with Android, it would have helped me immensely.
然后你就可以开始使用 Android 开发了。我希望我在开始使用 Android 之前阅读过“Head First”Java 开发一书,它会对我有很大帮助。
回答by Chris
I would suggest NOT starting with Java first, as others have said the framework is so different you will be learning syntax that you will not use writing Android Apps. Get a good book on Android development for beginners and start from there. I've found Android Application Development for Dummies to actually be a very good book, as well as O'Rielly's Learning Android. As you come across the need for Java knowledge, then hit the Java Tutorials over at oracle.com, pick up what you need and then back to Android specific documentation.
我建议不要先从 Java 开始,因为其他人说这个框架是如此不同,你将学习语法,你不会使用编写 Android 应用程序。为初学者准备一本关于 Android 开发的好书,然后从那里开始。我发现 Android Application Development for Dummies 实际上是一本非常好的书,还有 O'Rielly 的 Learning Android。当您遇到对 Java 知识的需求时,请访问 oracle.com 上的 Java 教程,选择您需要的内容,然后返回 Android 特定文档。
You aren't going to be using System.out.println in a real Android App, you will be setting a textView either programmaticly or in XML, so learning the Java way won't be all that helpful.
您不会在真正的 Android 应用程序中使用 System.out.println,您将通过编程或 XML 设置 textView,因此学习 Java 方式不会有太大帮助。
Start here: http://developer.android.com/resources/browser.html?tag=tutorialand do all the tutorials.
从这里开始:http: //developer.android.com/resources/browser.html?tag=tutorial 并完成所有教程。
回答by mahery rafara
You need to be familiar with the basic Java tasks
您需要熟悉基本的 Java 任务
- knowing what is a package, a class, some inheritance
- understand the building of your app (compile, link and packaging)
- debugging
- 知道什么是包、类、继承
- 了解应用程序的构建(编译、链接和打包)
- 调试
You can start with building the tutorial sample, then going down in Java code progressively.
您可以从构建教程示例开始,然后逐步编写 Java 代码。
回答by oybek.t
It depends on the complexity of your app. If you will be building complex and high quality apps like Google Maps or Angry Birds you do need to know Java very well. I would suggest you to learn Java because you can make lots of things with it not only make apps for Android. Good luck!
这取决于您的应用程序的复杂性。如果您要构建复杂且高质量的应用程序,例如 Google Maps 或 Angry Birds,您确实需要非常了解 Java。我建议你学习 Java,因为你可以用它做很多事情,而不仅仅是为 Android 开发应用程序。祝你好运!