Eclipse Mobile Mousw Manuel d'utilisateur

Naviguer en ligne ou télécharger Manuel d'utilisateur pour Souris Eclipse Mobile Mousw. Develop Android applications with Eclipse Manuel d'utilisatio

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 35
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 0
Develop Android applications with Eclipse
Get started with Google's Android Development Tools Eclipse
plug-in
Skill Level: Intermediate
Frank Ableson ([email protected])
Software designer
26 Feb 2008
Android is Google's oft-discussed mobile, wireless, computer, and communications
platform. You can take advantage of the powerful Eclipse environment to build
Android applications using the Android Eclipse plug-in. This tutorial introduces
Android application development with the Eclipse plug-in, otherwise known as
Android Development Tools. The tutorial provides an introduction to Android
development with a quick introduction to the platform, a tour of Android Development
Tools, and includes the construction of two example applications.
Section 1. Before you start
This tutorial introduces Android application development within the Eclipse
environment, including the construction of two example applications. The first is a
basic starter application, complete with all phases of building and debugging. The
second application examines more complex features of Android, including contacts
searching and Google Maps address lookup. To get the most from this tutorial,
mobile-development experience is helpful, but not required. Java™ programming
skills are required for Android applications, but are not an explicit requirement for
this tutorial.
About this tutorial
Develop Android applications with Eclipse
© Copyright IBM Corporation 1994, 2008. All rights reserved. Page 1 of 35
Vue de la page 0
1 2 3 4 5 6 ... 34 35

Résumé du contenu

Page 1 - Section 1. Before you start

Develop Android applications with EclipseGet started with Google's Android Development Tools Eclipseplug-inSkill Level: IntermediateFrank Ableson

Page 2 - System requirements

The Android SDK is a compressed folder. Download and extract the contents of thisfile to a convenient place on your computer. For purposes of this tut

Page 3 - Android terminology

that the license agreement includes a special requirement for use of theGoogle Maps API.6. Review and accept the installation location, then click Fin

Page 4 - Why is Android important?

New project wizardThe first step is to create a new project. Select the wizard for Android project, asshown below.Figure 2. New project wizardThe requ

Page 5 - The IntentFilter

• Package name• Activity name — Think of this as the main "form" or screen of theapplication• Application nameTake a look at the new project

Page 6 - Services and receivers

The Package ExplorerThe Package Explorer (found in the Java perspective in Eclipse) displays all thecomponents of the sample Android application (see

Page 7

src folderIncludes the package for the sample application, namelycom.msi.ibmtutorialR.javaThe Android Developer Tools create this file automatically a

Page 8

super.onCreate(icicle);setContentView(R.layout.main);}}Things to note about this source snippet:• SaySomething is a normal Java class, with a package

Page 9

The sample application contains a single activity and a single view. The applicationcontains a file named main.xml that represents the visual aspects

Page 10

Listing 6. R.java file/* AUTO-GENERATED FILE. DO NOT MODIFY.** This class was automatically generated by the* aapt tool from the resource data it foun

Page 11

We introduced an error into the source code where we added an extra spacebetween setContent and View. When the file is saved, it is compiled and anyer

Page 12 - New project wizard

Why do we care about Android? Android is an important platform for two reasons.First, the fact that Google is introducing it and the mind-share Androi

Page 13

</manifest>Things to note:• The package name from the source file is represented here. This followsa similar pattern to a Java source file and i

Page 14 - The Package Explorer

Give the configuration a name. The tutorial sample uses the name TutorialConfiguration. Select the ibmtutorial project from the list of available proj

Page 15

There are a few screen sizes and orientations to choose from, as well as networkchoices. The network choices are important when building applications

Page 16 - Resources for the application

Now that the application is running on the Emulator, it's time to see what'shappening behind the scenes. The Dalvik Debug Monitor Service (D

Page 17

The LogCat is a running log file of activity taking place in the VM. Applications canmake their own entries to this list with a simple line of code as

Page 18 - Building applications

User applications are deployed in /data/app while Android built-in applications arefound in the /system/app directory.A running process list is also a

Page 19 - AndroidManifest.xml

Full-scale debugging of an Android application is beyond the scope of this tutorial.For more information, see Resources.Section 6. Building the conten

Page 20 - Running the application

contacts recorded and be sure to populate the home address field. Figure 12 showsthe Emulator with a few entries in the contact application.Figure 12.

Page 21

developerWorks® ibm.com/developerWorksDevelop Android applications with EclipsePage 28 of 35 © Copyright IBM Corporation 1994, 2008. All rights reserv

Page 22

Here is the first of two code snippets for the second application. Note that thisapplication's main Activity class extends the ListActivity. This

Page 23 - Debugging the application

• Main.xml — This contains the visual elements, or resources, for use byAndroid activities.• R.java — This file is automatically generated by Android

Page 24

Any one of the contacts may be selected by a tap (click of the mouse), the centerbutton on the emulator, or by pressing the Enter key on your keyboard

Page 25

Listing 7. The onListItemClick() overridden method@Overrideprotected void onListItemClick(ListView list,View view,int position,longdbidentifier){super

Page 26 - Maps example

There is a single activity launched from the main application screen. There is, ofcourse, the AndroidManifest.xml file identifying our new application

Page 27

DownloadsDescription Name Size Download methodExample source code os-eclipse-android.examples.zip67KB HTTPInformation about download methodsibm.com/de

Page 28

ResourcesLearn• The author's Android book is available in part online at Manning Publications.• The authoritative Android information source is G

Page 29

Tivoli®, and WebSphere®.• Innovate your next open source development project with IBM trial software,available for download or on DVD.Discuss• The Ecl

Page 30

platforms, including servers, desktop computers, networking appliances, andmobile-computing devices. Android runs on top of a Linux kernel.Dalvik Virt

Page 31

clicking and tapping to operate. Sure, there are menus and buttons to be tapped, butAndroid has an innovative design element to its architecture known

Page 32 - Section 7. Summary

Let's take a moment to examine the four main types of Android applications: activity,services, receivers, and ContentProvider. We will also take

Page 33 - Downloads

public class myreceiver extends IntentReceiver{public void onReceiveIntent(Context arg0, Intent arg1){// do something when this method is invoked.}}Da

Page 34 - Resources

View elements consist of familiar UI elements, including:• Button• ImageButton• EditText• TextView (similar to a label)• CheckBox• Radio Button• Galle

Page 35 - About the author

Note that each element has one or more attributes in the Android name space.The next section walks through obtaining the Android SDK and configuring i

Commentaires sur ces manuels

Pas de commentaire