首页 > 代码库 > 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, an Activity 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 an Activity.
    Note: When Android Studio creates your MainActivity, what it’s doing is making a subclass of Activity. Those familiar with object-oriented programming will know what this is, but for newcomers, this basically means that your MainActivity is going to be a customized version of Activity 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