quick referenc e

imaginaryfleetΚινητά – Ασύρματες Τεχνολογίες

19 Ιουλ 2012 (πριν από 5 χρόνια και 1 μήνα)

373 εμφανίσεις

KEY ANDROID CONCEPTS
Android App
Several activities/fragments, resources, manifest, and any
other required data or assets, all compiled into a .apk file.
Activity
Basic unit of an Android app: typically, one screen. UI layout
is typically done in an XML file. Has methods with special
names that are invoked at appropriate time in the activity
lifecycle.
Service
A “background task” that executes without a UI. For exam
-
ple, an MP3 player or download manager.
View
An individual UI component, button, or menu item.
Context
Contains global information about an application environ
-
ment, and provides access to application-specific resources
and classes.
Fragment
New for tablets, but back-ported to older API levels, this is a
chunk of UI that can be in one activity, or moved to a sepa
-
rate screen if there is no room. Fragments always live within
an activity.
Intent
An asynchronous inter-component communications mecha
-
nism. Use intents to switch between activities.
Content Provider
Component that shares its data, typically abstracting access
to an application database.
Broadcast Receiver
Code executed for system-wide “broadcast” messages
such as “picture taken”.
Manifest
XML-format file that describes what hardware the app
needs and the app’s components.
Dalvik VM
Like a JVM, but optimized to efficiently run multiple in
-
stances in parallel Linux processes.


For more in-depth information, go to

developer.android.com
.
android developer

quick referenc
e

This document provides a quick reference for developers who are new to Android
terminology and basic concepts, and includes excerpts from the Android Developer’s
Guide at
developer.android.com/guide
.
COMMON APPLICATION TYPES
Java application
: Most full-featured Android applications are
written primarily using Java.
Native application
: A full-featured Android application writ
-
ten in C/C++ using the Native Development Kit (NDK).
Widget
: an interactive display of an app’s most important or
timely information presented on a user’s home screen.


Android apps can also be a combination of the above. For in
-
stance, you can create a Java application that has some na
-
tive components. Or, your Android app can have an
associated widget that lets the user see the app’s most im
-
portant data on their home screen.
ANDROID ARCHITECTURE OVERVIEW
INSIDE A TYPICAL ANDROID APP
• Java source files
• “Glue” code to make XML names appear in Java
• Resources

- Icons, images, things that can be drawn

- Screen layouts, things that can be specified in XML
• An Android manifest file describing the hardware the app

requires and listing the app’s components
• Any other assets the app needs
• All compiled into a .apk file, in zip format
ACTIVITY LIFECYCLE
ANDROID OS VERSIONS
Android OS versions are named after desserts:

2.2, “Froyo”
, is designed for handsets

2.3, “Gingerbread”
, is designed for handsets

3.x, “Honeycomb”
, is designed for tablets

4.x, “Ice Cream Sandwich”
, unifies the tablet and

handset experience
Over 90% of devices run 2.2 or later.
DEVELOPMENT TOOLS
Android SDK, ADT, NDK
From the Android Open Source Project:

Android SDK
: everything you need to create Java-based
Android applications and widgets: libraries, compiler, de-
bugging tools, emulator, reference documents, and more.

Android Developer Tools (ADT)
: a plugin for Eclipse that

adds GUI access to SDK tools, Android project manage-
ment, a UI design tool, and additional editors.

Native Development Kit (NDK)
: toolset that enables you
to implement parts of your app using native C/C++.
MOTODEV STUDIO
From Motorola Mobility, MOTODEV Studio is a complete
Eclipse-based development environment that includes ADT
and adds features such as:
Simpler setup using a single installer. Or you can add
MOTODEV Studio plug-ins to your existing Eclipse
installation
Application creation wizards to help you create

essential Android classes
Integrated device emulators to test your apps on an
Android emulator view within MOTODEV Studio without
switching between IDE and target
Database Management perspective lets you view and edit
SQLite databases on emulated devices
Localization Files Editor helps you manage all strings in
one place to create localized versions of your apps
Code snippets enable you to add often-used

code from templates for more stable and better perform
-
ing applications
MOTODEV APP VALIDATOR
From Motorola Mobility, MOTODEV App Validator uses
static
analysis to detect improper conditions, such as missing or
too many permissions, missing resources, incorrect manifest
settings, and coding errors like unclosed database cursors.
Available within MOTODEV Studio or as a separate

command-line tool.
Copyright © 2012, Motorola Mobility, Inc. All rights reserved except as otherwise explicitly indicated. Google and other marks are trademarks of Googel Inc.
Portions of this document are reproduced from or are modifications based on work created and shared by the Android Open Source Project

and used according to
terms described in the Creative Commons 2.5 Attribution License. Other content displayed in this document may be licensed under Apache License, Version 2.
Copyright © 2012, Android Open Source Project. All rights reserved unless otherwise explicitly indicated. Licensed under the Apache License, Version 2.0 (the
“License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
MOTODEV for Enterprise provides a technical library with extensive documentation on Android
development, mobile best practices, and Motorola product specifications. Training materials and
technical support are also available. For more information, visit

developer.motorola.com/enterprise
.
Source:
developer.android.com






QUICK REFERENCE SHEET
FOR ANDROID™ DEVELOPERS