首页 > 代码库 > Make Your First Android App
Make Your First Android App
http://www.raywenderlich.com/56107/make-first-android-app-part-1
- Activity Name. This is the first mention you’ve seen of the word
Activity
, but it certainly won’t be the last. In Android, anActivity
is usually thought of as a “screen” in your app. It could be fullscreen or it could be a partial-screen pop-up. It is very flexible. If you want your user interacting with something in your app, that’s at some level happening via anActivity
.Note: When Android Studio creates yourMainActivity
, what it’s doing is making a subclass ofActivity
. Those familiar with object-oriented programming will know what this is, but for newcomers, this basically means that yourMainActivity
is going to be a customized version ofActivity
that acts just like the default one, handling things like its lifecycle and the user interface display. - Layout Name. You’re going to define your
MainActivity
in Java, but the layout of everything it will show to the user is defined in a special sort of Android XML. You will learn how to read and edit those files soon. - Fragment Layout Name. A fragment is a little like a sub-activity, and can be a useful part of your app design. I won’t go into fragments much in this tutorial—in fact, one of the things you’ll do is remove the one that the New Project wizard makes for you—but I encourage you to further investigate how to effectively use fragments after you finish this tutorial.
- Navigation Type. For now, just choose None. You won’t need any navigation for a little while, and when you do, it’ll be smarter to build it yourself, from scratch.
- Gradle is a new build tool that is easy to use, but it also contains a lot of advanced options if you investigate it further. Basically, it takes your Java code and XML layouts, and uses the latest Android build tools to create the app package file, known as an APK file. You can customize your configurations to have development or production versions of the app that behave differently, or add dependencies for third-party libraries.
- Maven is another project build tool, and it can also refer to the Maven Central repository of java libraries. It is absurdly easy to use Gradle and Maven Central in concert with Android Studio to incorporate all sorts of functionality from the Android development community. Those with an iOS background will know how cool this sort of thing can be from using the CocoaPods tool. You’ll learn more about Maven in Part Three of the tutorial.
Make Your First Android App
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。