Upload
golda
View
34
Download
0
Tags:
Embed Size (px)
DESCRIPTION
Android 1: Background. Kirk Scott. 1.1 Buzzwords 1.2 Development Software 1.3 Getting Started 1.4 Preliminaries to Trying to Make It Work the First Time. 1.1 Buzzwords…. The Android platform originated in a separate company It was acquired by Google - PowerPoint PPT Presentation
Citation preview
1
Android 1: Background
Kirk Scott
2
3
• 1.1 Buzzwords• 1.2 Development Software• 1.3 Getting Started• 1.4 Preliminaries to Trying to Make It Work
the First Time
4
1.1 Buzzwords…
5
• The Android platform originated in a separate company
• It was acquired by Google• It is supported by the Open Handset Alliance
(OHA)• From a business perspective, Android is
distinguished by the fact that many vendors are cooperating to provide a non-proprietary development environment
6
Key components of this successful alliance are:
• Hardware device manufacturers• Mobile service providers• Android/Google, which provides the basic
software operating and development environments
• Independent app developers marketing through the app store or other places
7
The platform is based on:
• A secure operating system, Linux• Virtual machines running on top of Linux
(known as Dalvik virtual machines)• A widely-known object-oriented language,
Java• A tested software development environment,
Eclipse
8
Proprietary vs. non-proprietary
• Android is based on open source licensing• Developers do not have to pay fees to use the
development tool kit• The do not have to pay fees on the apps
developed with it• The app developer API includes everything
that a “native” programmer would have access to
9
• The theory is that there is a large potential market
• By opening up the environment, you increase the size of the pie for everyone
• Android is growing from phones to tablets to other devices
• The growth is being driven by the app market
10
Another useful aspect of the development environment:
• It comes with an emulator for handheld devices
• This means that you can initially develop and test code on a PC with the development environment installed
• You don’t literally have to develop on the handheld device
11
Emulation isn’t the be-all, end-all:
• The emulator is slow• The emulator can be problematic• The emulator may not fully model the
hardware device of interest• The reality is that you eventually have to test
and finish development on a hardware device if you expect to roll out the app on that device
12
Versions
• You may have heard of or Jellybean or KitKat• As of the writing of these overheads, these are
the most recent versions of the Android SDK• It is worthwhile to note that there are several
strains in Android which are slowly merging:• Development for cell phones, tablets, and
larger scale devices like TV’s
13
• You may be curious about how versions were named
• The different versions have been named after sweets in alphabetical order
• Here are the versions and names• 1.5, Cupcake• 1.6, Donut• 2.0/2.1, Eclair
14
• 2.2, Froyo• 2.3, Gingerbread• 3.0, Honecomb• 4.0, Ice Cream Sandwich• 4.1-, Jellybean• 4.4, KitKat
15
• Note that the list of versions is more than just a historical or culinary curiosity
• As with any growing system, backwards compatibility is an issue, and there are plenty of systems out there using earlier versions
16
1.2 Development Software
17
• There are various different ways of going about developing apps for Android
• Development environments range from the graphical to heavy-duty programming
• For example, there are environments specifically designed to help developers implement games without necessarily becoming expert in the details of raw Android development
18
• Some students ask whether they can use these alternative environments
• The answer is “yes” through gritted teeth• It is true that they might allow you to more
easily implement a game, for example, but the cost is that you learn less about Android itself
19
• The default development environment for this course, and what the course materials will cover, will consist of raw Android tools
• To start developing for Android you essentially need to download and install two pieces of software:
20
• 1. The Java SDK• 2. The Android Development Toolkit (ADT)
bundle• The bundle includes Eclipse• It includes Android classes for development• It includes the emulator so that you can start
to learn development without access to an Android hardware device
21
• As with all growing and changing systems, documenting installation and use is hopeless
• As soon as you write something down, it’s out of date
• These overheads are designed for computer literate persons, in other words, computer science students
22
• Entry points and some guidance are given• Persistence and a willingness to fiddle around
are required• Experience has shown that most students are
actually better at this than the teacher
23
• These overheads were initially created after installing Java v. 1.7.0_11 and Android v. 4.2 API level 17
• God knows where I’m at now after multiple meltdowns, reinstallations, etc.
• The actual physical devices available for class are Nexus 7’s running various Android versions, including 4.2.2, 4.3, and 4.4.2
24
• Ondoing Android updates have caused some problems
• I have tried to straighten these problems out and fix the overheads wherever necessary, but some information in the overheads may have been garbled by the march of progress
• Whenever development environment updates occur midstream, you, as students, will have to adapt
25
Downloading Java
• Since Java was acquired by Oracle, the entry point for downloading Java is www.oracle.com
• On that Web page there is a link for downloads
• Under that heading you can find Java for developers
• Find the right SDK for your system and install it before installing the Android tools
26
Downloading Android
• The highest level entry point for Android is www.android.com (there is a link to the developer page from there)
• It’s easiest to go directly to the developers’ page: developer.android.com
• There is a “Get the SDK” link there that will lead to a page where you can download the Eclipse ADT (bundle)
27
• There are two things to keep in mind when downloading and installing the bundle:
• You will need the version of Eclipse that you will get from this process in order to do Android
• You have to be clear on whether you’ve got a 32 bit or 64 bit system and which version of Java you installed
• (Admittedly, any reasonably modern system is now 64 bit; just make sure everything is consistent)
28
The Android Web Site
• Virtually anything you might want to know about Android programming can be found at the developer’s Web site
• The site includes tutorials on app development
• It includes Java-like documentation of the packages and classes in the Android API
• It includes detailed technical information
29
Overhead Contents
• The problem with the Web site is the eternal one:• There is too much information• The average programmer doesn’t know where to
start and can’t distinguish the essential from the interesting or the overwhelming
• The purpose of this set of overheads and those that follow is to provide a guide to getting started and a clear path that is realistic for a one semester introductory course
30
• There are two important principles at work here that kitchen-sink Web site and textbook authors seem to be unfamiliar with:
• 1. There are lots of things that you simply don’t have to be told about at the beginning
• There may come a time in the future when some overlooked items will be introduced, but until then, ignorance may not be bliss, but it’s necessary
31
• 2. There are lots of things where you will have to accept that they exist and learn how to use them at a minimal level without having any idea of how they work
• In other words, at the beginning you will be doing a lot of monkey work just to get the Android machinery to run a painfully simple app
• For the time being you will have to accept the machinery without explanation
32
1.3 Getting Started
33
• The starting point for the following overheads is a successful installation of Java and the ADT bundle on your system
• Once the ADT is installed, your entry point into Android development will be Eclipse
• This isn’t an introduction to Eclipse—some will already have used it—others will have to pick it up as they go along
34
What is included with Eclipse as part of the ADT bundle:
• There is an Android SDK Manager tool• There is an Android Virtual Device Manager
tool• And there is a DDMS (Dalvik Debug Monitor
Server) perspective
35
• The Android SDK Manager tool allows you to keep the SDK installation up to date
• The icon is the top half of the Android with a down arrow in place of the bottom half
36
• The Android Virtual Device Manager tool allows you to set up virtual devices to test your app software on
• It’s located next to the Android SDK Manager tool • The icon is essentially the one shown below, but on
the screen it’s so microscopic that you might not recognize it
37
• Off to the right of the toolbar there is an option that allows you to select a perspective
• If you are in the code development environment, Java will be shown on a button
• One of the other options is DDMS• These are Eclipse perspectives
38
• You can pick the perspective you want depending on what part of development you are working on
• The reality is that I have essentially only used the Java development environment
• The point is that Eclipse has been set up so that this perspective includes those elements needed when doing Java coding for Android
39
DDMS
• DDMS is Android related• It stands for Dalvik Debug Monitor Server• It may be of some interest that this will be
available after a successful installation• I give no detail about the DDMS perspective
because the reality is that in this introductory course I’ve never had a reason to use it
40
• As background, for Java programmers, Dalvik should be of some interest
• This is the name of the virtual machine that Android apps run on
• It is based on the Java virtual machine• It is designed to have good performance on a
device with the limitations of a cell phone, for example
41
The Eclipse Interface
• A screenshot of the ADT bundle Eclipse interface is shown on the following overhead
• Things come up tiny, but you may just be able to identify the tools and buttons
• The point is that Android things are included in the toolbar when you successfully install Eclipse as part of the bundle
• These tools are also available through the menu if the toolbar isn’t showing
42
43
The Android SDK Manager
• A screenshot of the Android SDK Manager tool is shown on the following overhead
• As noted, the tool allows you to manage and update what is installed on your development machine
44
45
The Android Virtual Device Manager
• A screenshot of the Android Virtual Device Manager tool will be shown on the third overhead following this
• At the moment the details are unimportant• We will be using the tool soon enough• It is presented now because it emphasizes the
idea that you can develop on an emulator
46
• The “virtual device” manager is that part of the environment which makes it possible to define and manage emulators for the many different kinds of handheld devices there are
• Even though emulation isn’t perfect, it’s a helpful part of the development environment that you can try out an application on different devices in this way
47
• The biggest value I’ve found in the emulator is that I can take screen shots of how my apps work and include those screen shots in PowerPoint presentations
• You may want to do the same for your presentation at the end of the semester
• The screen shot of the virtual device manager tool is shown on the following overhead
48
49
1.4 Preliminaries to Trying to Make It Work the First Time
50
Preliminary Crying
• Trying to make things work the first time is where a miracle is supposed to occur
• It’s not realistic to expect any set of instructions or screen shots to preview exactly what you will have to do to make things happen or to anticipate all of the problems that might occur along the way
51
• Your hardware is probably different• Your installation of the software may be
different• I initially had mismatches between 32 bit and
64 bit software for Java and the Android SDK, which I had to resolve
• It is likely that you will be using different versions from those I used
52
• I had one completely unexpected problem with no hope of solving it except a random Web search
• The Web search succeeded• I had other problems where there was no
apparent solution, and I finally got things to work by restarting, randomly trying different parameters, etc.
53
• I initially worked on the first example app over the course of 24 hours, probably 8-12 actually messing with Android
• I tried to get the initial example app going about 10 times
• I literally had success 2 of those times• (There is an explanation for this—the right
sequence of steps when doing emulation…)
54
• You should be prepared for failure and frustration
• You will have to be flexible, analytical, and persistent
• Aside from everything else, you will have to be patient
55
• Just turned loose on your own, you would probably do better than I did the first time
• Hopefully the various things that I learned along the way and which I have included in these overheads or may mention along the way will make sure that you will have better luck than I did the first time
56
The Emulator: Boon or Bane?
• I am pretty sure that most of my problems came from the fact that starting the emulator is painfully slow
• It is unbelievable how slow this is on an up-to-date, reasonably powerful machine with a reasonable amount of memory
• The point is that if you try to launch an app on an emulator that hasn’t yet fully started, the app certainly won’t run
57
Workspaces
• These overheads don’t give any specific information about workspaces
• However, the Eclipse environment organizes projects and packages in workspaces
• At some point during installation, set-up, or initial run, you will probably be given the option to either accept a default folder as a workspace or to specify your own
58
• Needless to say, this is important for general reasons:
• It’s handy to know where things are being stored
• At various points along the way, it will be useful to recall that information
• I simply accepted the default workspace, and I recommend that you do the same
59
The Android Demos/Tutorials in Eclipse
• If your installation is like mine, when you start up Eclipse the first screen that will be shown is an entry point into the demos/tutorials
• This is shown on the following overhead• The first step, “Build Your First App” is the
stage we’re at
60
61
• You can go to the tutorials if you start getting bogged down in these overheads and you want an alternative presentation
• However, the overheads take you through the process
• If you’re working on your own and don’t want the tutorials, just close the Welcome! Window and you will enter the Eclipse development environment
62
Summary and Mission
• That’s the end of the introductory blah blah blah• You have two missions, neither of which are graded
homework:• 1. Install Android• 2. Send me a description (<= 1 page) of your
favorite app or the most interesting app you know of
• If enough people do this, I will share the information in class or post it on the course Web page
63
The End