ドキュメント > Androidアプリケーション構築のチュートリアル

「ドキュメント/Androidアプリケーション構築のチュートリアル」の編集履歴(バックアップ)一覧に戻る
ドキュメント/Androidアプリケーション構築のチュートリアル」を以下のとおり復元します。
* Tutorial: A Notepad Application

The tutorial in this section gives you a "hands-on" introduction to the Android framework and the tools you use to build applications on it. Starting from a preconfigured project file, it guides you through the process of developing a simple notepad application and provides concrete examples of how to set up the project, develop the application logic and user interface, and then compile and run the application.

The tutorial presents the notepad application development as a set of exercises (see below), each consisting of several steps. You can follow along with the steps in each exercise and gradually build up and refine your application. The exercises explain each step in detail and provide all the sample code you need to complete the application.

When you are finished with the tutorial, you will have created a functioning Android application and learned in depth about many of the most important concepts in Android development. If you want to add more complex features to your application, you can look at and use the code in the notepad application that is supplied in the sample code area of the Android SDK.

** Contents

Who Should Use this Tutorial
Preparing for the Exercises
Exercises
Other Resources and Further Learning

** Who Should Use this Tutorial

This tutorial is designed for experienced developers, especially those with knowledge of the Java programming language. If you haven't written Java applications before, you can still use the tutorial, but you might need to work at a slower pace.

Also, the tutorial builds on the information provided in the Installing the SDK and Hello Android documents, which explain in detail how to set up your development environment for building Android applications. Before you start the tutorial, make sure that you have already downloaded the SDK and installed it according to the instructions.

Finally, this tutorial describes how to develop the notepad application in the Eclipse development environment, with the Android plugin installed. If you are not using Eclipse, you can follow the exercises and build the application, but you will need to determine how to accomplish the Eclipse-specific steps in your environment. If you want to add more complex features to your application, you can look at and use the code in the notepad application that is supplied in the sample code area of the Android SDK.

The tutorial assumes that you have some familiarity with the basic Android application concepts and terminology. If you aren't yet familiar with those, you should read Overview of an Android Application and Application Lifecycle before continuing.

** Preparing for the Exercises

Before you begin, it's important that you install the SDK and set up your Eclipse development. Once your environment is set up, locate and unpack the exercises archive, which is included in the SDK package. The archive includes a series of Eclipse project files that are used in the exercises. You can use these project files instead of creating and configuring your own project files.

To get the tutorial project files:

+ Download the project exercises archive (.zip)
+ Unpack the archive file to a suitable location on your machine
+ Open the NotepadCodeLab folder

Inside the NotepadCodeLab folder, you should see six project files: Notepadv1, Notepadv2, Notepadv3, Notepadv1Solution, Notepadv2Solution and Notepadv3Solution. The Notepadv* projects are the starting points for each of the exercises, while the Notepadv*Solution projects are the exercise solutions. If you are having trouble with a particular exercise, you can compare your current work against the exercise solution to try and track down the problem.

** Exercises

The table below lists the tutorial exercises and describes the development areas that each covers. Each exercise assumes that you have completed the previous example (if any).

| Exercise 1 | Construct a simple notes list that lets the user add new notes but not edit them. Demonstrates the basics of ListActivities and creating and handling menu options. Uses a SQLite database to store the notes. |
|Exercise 2 |	Add a second activity to the application. Demonstrates constructing a new Activity, adding it to the Android manifest, passing data between the activities, and using more advanced screen layout. Also shows how to invoke another activity asynchronously using startSubActivity().|
|Exercise 3 |	Add handling of life-cycle events to the application, to let it maintain application state across the life cycle.|
|Extra Credit |	Demonstrates how to use the Eclipse debugger and how you can use it to view lifecycle events as they are generated. This section is optional but highly recommended.|

** Other Resources and Further Learning

- For a lighter but broader introduction to concepts not covered in the tutorial, take a look at Common Android Tasks.
- The Android SDK includes a variety of fully functioning sample applications that make excellent opportunities for further learning. You can find the sample applications in the samples/ directory.
- This tutorial draws from the full Notepad application included in the samples/ directory of the SDK. When you are done with the tutorial, it is highly recommended that you take a closer look at the full Notepad application, as it demonstrates a variety of interesting additions for your application, such as:
          o Setting up a custom striped list for the list of notes.
          o Creating a custom text edit view that overrides the draw() method to make it look like a lined notepad.
          o Implementing a full ContentProvider for notes.
          o Reverting and discarding edits instead of just automatically saving them.

復元してよろしいですか?

ツールボックス

下から選んでください:

新しいページを作成する
ヘルプ / FAQ もご覧ください。