1 / 111

Android 1: Background

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.5 Creating a New, Example Android Application Project in Eclipse 1.6 Creating a Virtual Device, an Emulator

lavonn
Télécharger la présentation

Android 1: Background

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Android 1: Background Kirk Scott

  2. 1.1 Buzzwords • 1.2 Development Software • 1.3 Getting Started • 1.4 Preliminaries to Trying to Make It Work the First Time

  3. 1.5 Creating a New, Example Android Application Project in Eclipse • 1.6 Creating a Virtual Device, an Emulator • 1.7 Running an App on the Emulator in Eclipse • 1.8 Running the Project on an Attached Device Instead of an Emulator

  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. You may have heard of “Ice Cream Sandwich” (ICS) or Jellybean • As of the writing of these overheads, these are the most recent versions of the Android SDK • It is worthwhile to note that the latest versions essentially merge two strains in Android: • Development for cell phones and development for tablets

  13. You may also 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 • Note that this list is more than just a historical curiosity • As with any growing system, backwards compatibility is an issue, and there are plenty of systems out there using earlier versions

  15. 1.2 Development Software

  16. To start developing for Android you essentially need to download and install two pieces of software: • The Java SDK • 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

  17. 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

  18. 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 • For what it’s worth, these overheads were created after installing Java v. 1.7.0_11 and Android v. 4.2 API level 17

  19. 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

  20. The highest level entry point for Android is www.android.com • On this Web page you’ll find a link for developers or you can go directly to developer.android.com • Find the ADT bundle which is right for your system and install it • For the time being, just accept the defaults, whatever they might be

  21. 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

  22. The problem 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 may follow is to provide the barest guide to getting started

  23. 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

  24. 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

  25. 1.3 Getting Started

  26. 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 really an introduction to Eclipse because I don’t have any pre-existing knowledge of how to use it

  27. However, given that Eclipse will be the development environment, it is possible to point out what is included with it when it is installed 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 perspective

  28. The Android SDK Manager tool is represented in the Eclipse toolbar by a small, green Android icon • It looks something like this

  29. The Android Virtual Device Manager tool is represented in the Eclipse toolbar by an icon with the Android robot half showing on the screen of a handheld device • It’s located next to the Android SDK Manager tool • It looks something like this

  30. Off to the right on the tool bar there are two buttons • One is labeled Java • The other is labeled DDMS • These are Eclipse perspectives • In other words, clicking one of these changes what you are viewing in the Eclipse environment

  31. DDMS is Android related • It stands for Dalvik Debug Monitor Server • At the moment it’s too soon to give much detail about the DDMS perspective except that it should be there after a successful installation • As noted earlier, Dalvik is the name of the virtual machine that Android apps run on

  32. A screenshot of the 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

  33. It’s not too soon to say something about the Android SDK Manager and the Android Virtual Device Manager • A screenshot of the Android SDK Manager tool is shown on the following overhead • The tool allows you to manage and update what is installed on your development machine

  34. A screenshot of the Android Virtual Device Manager tool is shown on the overhead following the next one • At the moment the details are unimportant • We will be using the tool soon enough

  35. It is presented now because it emphasizes the idea that you can develop on an emulator • 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 very helpful part of a development environment that you can try out an application on different devices in this way

  36. 1.4 Preliminaries to Trying to Make It Work the First Time

  37. 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

  38. 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 possible that you will be using different versions from what I’ve used

  39. 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.

  40. I initially worked on the initial 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

  41. 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

  42. 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

  43. On the following overheads a general overview is given of what is involved in getting a sample application to work—without even looking at its code, how it works, what Android features it is making use of or depends on • This is the initial monkey work mentioned at the beginning of the overheads

  44. I will be basing these overheads on the initial example app that is given in the tutorial on the Android developer’s Web site • This is a bit of a cop out, but if you discover that something in the overheads doesn’t seem to work, try working looking at the information in the tutorial

  45. 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

  46. 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

  47. 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 • This is where to go if you start getting bogged down in these overheads and you want an alternative presentation

More Related