Android 2: A First Project Kirk Scott 1. 2.1 Creating a New, Example Android Application Project in Eclipse 2.2 Creating a Virtual Device, an Emulator.

Slides:



Advertisements
Similar presentations
Introduction to the SPL Interpreter
Advertisements

Lecture 10 Sharing Resources. Basics of File Sharing The core component of any server is its ability to share files. In fact, the Server service in all.
E-books, e-audiobooks, & music. On your computer, use your web browser to go to
HOW TO IMPORT AND EXPORT DATA. Why do I need to use Export/Import? Here are some examples: If you have a laptop that you take home (or have a home version.
Installation of Ubuntu on a Virtual machine. VirtualBox allows you to run an entire operating system inside another operating system. Please be aware.
Microsoft Office 2010 Office 2010 and Windows 7: Essential Concepts and Skills Mark Worden Instructor Use your spacebar or down arrow key to advance slides.
Android 2: A First Project Kirk Scott Creating a New, Example Android Application Project in Eclipse 2.2 Creating a Virtual Device, an Emulator.
© by Pearson Education, Inc. All Rights Reserved.
LAUNCHXL2-RM57L – Project 0
Installation on Windows Vista/Windows 7 NOTE: Installation on Windows Vista can differ depending on the version of Windows installed​ ​ In most computers.
Installation on Windows Vista/Windows 7 NOTE: Installation on Windows Vista can differ depending on the version of Windows installed​ ​ In most computers.
Android 1: Background Kirk Scott Buzzwords 1.2 Development Software 1.3 Getting Started 1.4 Preliminaries to Trying to Make It Work the First Time.
ANDROID PROGRAMMING MODULE 1 – GETTING STARTED
SET UP COMPUTER ** PLEASE BE AWARE SCREENSHOTS MAY NOT MATCH **
Getting Started with Android Programming Note: if you have already installed android development tools, please check that you have the same version as.
Software Development. Chapter 3 – Your first Windows 8 app.
Android 4: Creating Contents Kirk Scott 1. Outline 4.1 Planning Contents 4.2 GIMP and Free Sound Recorder 4.3 Using FlashCardMaker to Create an XML File.
Programming with App Inventor Computing Institute for K-12 Teachers Summer 2012 Workshop.
Microsoft Office 2010 Office 2010 and Windows 7: Essential Concepts and Skills.
How to Upload Your File to Office Live Workspace Ed McCorduck CPN 100/101: Writing Studies I/II on Computer SUNY Cortland
Android 2: A First Project Kirk Scott Creating a New, Example Android Application Project in Eclipse 2.2 Creating a Virtual Device, an Emulator.
Setting up a Nexus tablet for development on Windows 1.
Mobile App Certification Course. In this course we will work you through on how you can start developing mobile apps for yourself or for many industries.
Digital Logic and State Machine Design Installing Xilinx WebPACK 12.4 CS 2204 Digital Hardware.
Android 2: Introduction to the Technology Kirk Scott 1.
Android 6: Testing and Running the App Kirk Scott 1.
Microsoft Windows LEARNING HOW USE AN OPERATING SYSTEM 1.
Copyright ©: SAMSUNG & Samsung Hope for Youth. All rights reserved Tutorials Software: Building apps Suitable for: Advanced.
1 Mobile Computing Set Up Copyright 2015 by Janson Industries.
Hello! Keep watching … I’ll show you how to use a mouse.
Introduction to Android. Android as a system, is a java based operating system that runs on the Linux kernel. The system is very lightweight and full.
Microsoft PowerPoint Getting Started Guide Prepared for Towson University Dr. Jeff M. Kenton Amy Chase Martin 2007.
Download Dropbox Download should start immediately Save download file:
CIS—100 Chapter 15—Windows Vista 1. Parts of a Window 2.
Microsoft Windows 7 Essential Introduction to Windows 7.
Geo CE-XM ch 4 Edited 10/14/05 1 The XM is the newest of the rovers, and unlike other units, it comes with software installed on the unit as well as using.
Targeted Training, LLC. APPLYING STYLES DOWNLOAD FREE TRIAL OF ADOBE CONTRIBUTE ADOBE CONTRIBUTE CONNECTION WIZARD ENTERING EDIT MODE WEB PUBLISHING PROCESS.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved. 1 2 Welcome Application Introducing the Visual Basic 2008 Express Edition IDE.
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.
Introduction to Arrays. definitions and things to consider… This presentation is designed to give a simple demonstration of array and object visualizations.
© 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Android Boot Camp.
Alice 2.0 Introductory Concepts and Techniques Project 1 Exploring Alice and Object-Oriented Programming.
Teacher’s Assessment Assistant Worksheet Builder Starting the Program
The Control Panel is the starting point when you wish to load files into Blackboard. Students cannot see this panel, unless they know your password of.
Downloading and Installing Autodesk Revit 2016
Unit 1: Java and Eclipse The Eclipse Development Environment.
USING WORDPRESS TO CREATE A WEBSITE (RATHER THAN A BLOG) STEP-BY-STEP INSTRUCTIONS.
Android Hello World 1. Click on Start and type eclipse into the textbox 2.
Creating an Example Android App in Android Studio Activity lifecycle & UI Resources.
Downloading and Installing Autodesk Inventor Professional 2015 This is a 4 step process 1.Register with the Autodesk Student Community 2.Downloading the.
As you look at an iMac you will notice that there are no buttons on the front of the machine as shown in figure 1.
Optimizing Your Computer To Run Faster Using Msconfig Technical Demonstration by: Chris Kilkenny.
First Venture into the Android World Chapter 1 Part 2.
Helping Patrons Get the Most from Their E-Readers Gary Pilkington and Lesley Daley Kenton County Public Library.
An Introduction to Designing, Executing and Sharing Workflows with Taverna Katy Wolstencroft myGrid University of Manchester IMPACT/Taverna Hackathon 2011.
The desktop (overview) Working with desktop icons The desktop is the main screen area that you see after you turn on your computer and log on to Windows.
Start with loading the picture Locate your camera’s USB cable –it looks something like this:
ANDROID APPLICATION DEVELOPMENT. ANDROID DEVELOPMENT DEVELOPER.ANDROID.COM/INDEX.HTML THE OFFICIAL SITE FOR ANDROID DEVELOPERS. PROVIDES THE ANDROID SDK.
Intoduction to Andriod studio Environment With a hello world program.
Microsoft Office 2008 for Mac – Illustrated Unit D: Getting Started with Safari.
Troubleshooting Dashhawk Issues. Here's what you have to do to have the DashHawk run properly Go to the ACTUAL PROGRAM file (not the short cut)
Using the AFRESH software Ruaraidh Dobson University of Aberdeen V1.0 27/04/2016.
How to Create and Use a VericrYPT CONTAINER
Android 3: Exploring Apps and the Development Environment
After Construction Name: Per #:.
Weebly Elements, Continued
Adding Assignments and Learning Units to Your TSS Course
Create A Virtual Machine
Office 2010 and Windows 7: Essential Concepts and Skills
How to Run a Java Program
Presentation transcript:

Android 2: A First Project Kirk Scott 1

2.1 Creating a New, Example Android Application Project in Eclipse 2.2 Creating a Virtual Device, an Emulator 2.3 Running an App on the Emulator in Eclipse 2.4 Running the Project on an Attached Device Instead of an Emulator 2

2.1 Creating a New, Example Android Application Project in Eclipse 3

These overheads give a general overview of getting a sample application to work They do not look at its code, how it works, or what Android features it is making use of or depends on The example is based on the first app given in the tutorial on the Android developer’s Web site 4

A New Android Application In the Eclipse menu take the option File, New, Android Application Project The result of this is shown in the screenshot on the following overhead 5

6

In the first box, type in the following: My First App The other boxes will auto-complete as shown in the following screenshot 7

8

If things auto-completed, then you click the Next > button The next screenshots for the wizard will not be shown Just keep on accepting the defaults and taking Next until you reach the Finish option Do not worry about what all of the options/defaults mean 9

At the end of the process, the system will take certain actions There is a progress bar at the bottom which gives some indication of what’s going on You may have to wait a certain amount of time 10

The initial Welcome screen may remain visible If so, it will cover up what has happened Minimize anything in the way What you expect to see is something more or less like the screenshot on the following overhead 11

12

There are several things to notice in this screenshot The simplest is that if you can actually read the fine print, you will see that My First App is a Hello World app Whenever a new app is created in Android using the defaults, this Hello World layout is provided by default 13

You’re not looking at code The name of the layout file that is being shown has an XML extension What you’re seeing is the layout of the output of the app 14

It is important to understand that at this point you are not looking at emulation of a running app What you’re seeing is a representation of the layout as provided in the development environment 15

You might notice that this screenshot of the editor doesn’t look quite like the one given earlier It doesn’t show the tools mentioned in the previous set of overheads, but it’s not exactly the same 16

The toolbar happens to have disappeared It’s not a big cause for concern In the menu under the Window option you can choose to hide or show the toolbar If the toolbar is hidden you can access the tools through the menu 17

2.2 Creating a Virtual Device, an Emulator 18

Running the Project on a Virtual Device, an Emulator If you want to run the project using the emulator, you need to use the Android Virtual Device Manager to create a new virtual device If you take the Android Virtual Device Manager tool (or menu option) you should arrive at something similar to the screenshot shown on the following overhead 19

20

Click the New button to create an Android Virtual Device The window shown in the screenshot on the following overhead comes up 21

22

It’s shown on the following overhead with the drop down list for Device expanded 23

24

For initial test purposes you might choose to use the device at the bottom of the list This is the simplest device with the fewest resources On the following overhead the form is shown filled out with representative values for that simple device 25

26

Using Snapshot Certain reference sources recommend using the Snapshot option If you do select Snapshot and then make other changes, you may have troubles later Without Snapshot things might run more slowly It is best initially not to use Snapshot 27

Warning Here is an example of what can go wrong Suppose you wanted to emulate a Nexus 7 device The memory option may default to a RAM value of

Unfortunately, this can lead to an error where it may not even be clear that the RAM size is what is causing the error A Web search on the error will inform you that if the RAM value to 512, things should be OK Using the simplest device as an example, a memory size of 256 will work 29

Continuing with Virtual Device Creation Once you’ve got the parameters set, click on OK The system can drag on for a noticeable amount of time creating the virtual device Successful completion is indicated by the appearance of the device in the list as shown in the screenshot on the following overhead 30

31

There is no final OK step after virtual device creation You’re done—and you have to close this window If you just minimize it, it sits there but is still the active window To go on from here, close this window 32

2.3 Running an App on the Emulator in Eclipse There are several different ways of running an app in the emulator It is possible to create run and debug configurations which are linked to a project This is not necessary for an initial example 33

Starting the emulator can take a lot of time Trying to run the app and having that process start the emulator does not work well It is better to begin the process of starting the emulator Wait patiently until it is running Then test the app on it 34

Starting the Emulator The Android Virtual Device screen is shown again on the following overhead with the created virtual device in it The screenshot shows the device as being selected and you’ll note a Start… button on the right hand side 35

36

If you click the Start button the following screen should appear From here, click the Launch button 37

38

After clicking launch, you should see the screen with the progress bar shown on the following overhead So far so good 39

40

Even before the previous screen goes away, or at the very least, as soon as it finishes, you should see the emulator on the screen It’s conceivable that you’ll have to close some things to find it It may be hidden In any case, the initial stage of launch shouldn’t take a long time, and this is what you should see 41

42

Now You Have to Wait Patiently The Android message on the emulated device shown in the previous screen shot will flash white for an indeterminate period of time The emulator is still launching As long as that process is going on, there’s nothing else that you should do except wait 43

Eventually, with good luck, the emulator will look as shown on the following overhead In the screenshot that is shown, the emulator screen is grayed out The emulator has started, but it’s taken so long that it is mimicking a device that has fallen asleep 44

45

If your emulator is grayed out, click and drag over the emulator screen with the mouse This should wake it up, as shown on the following overhead 46

47

Click on the circle as directed If the apps are shown, as they are in the following screenshot, you have been successful The emulator has been launched and is running 48

49

Running the Project in the Emulator If you want to run the project, you need a source file for the project open in the Eclipse environment The screenshot on the following overhead shows the explorer on the left tracing the path to the MyFirstApp.java file, with that file open in the editor in the middle 50

51

To prepare for running a project, you need to build or clean it In the menu you could take Project, Build All A more thorough approach would be to take the Project, Clean… option This leads to the screen shot on the following overhead 52

53

After the build or the clean is complete, you can run from the menu or the toolbar In the menu under Run there is a Run option The run tool in the toolbar is a small green circle with a right facing, white arrowhead in it If you use the tool, there’s no need to take the dropdown option and select from the choices there 54

The first time you to try to run it, you may get another dialog box asking what kind of thing you’re trying to run You’re given a list of choices, and the choice you want to make is “Android application” This dialog is shown on the following overhead 55

56

Remember that you started the emulator earlier It is covered up by the development environment After choosing the run type, find the emulator again Find it again You may still have to wait a while for the app to start, but with luck, you’ll see what’s shown in the screen shot on the following overhead 57

58

Click and drag over the emulator screen, and it comes to life, as shown on the following overhead 59

60

The phrase “Hello World!” is what was shown in the layout for the app in the development environment This is the output that the app is designed to produce We have now seen the app successfully demonstrate this output in the emulator This is not just the design; it’s the result of running code 61

2.4 Running the Project on an Attached Device Instead of an Emulator 62

Being able to use the emulator is important— but it can occasionally be problematic Being able to run an app on an actual attached device is no less important—and it can be no less problematic 63

If you haven’t yet run a homemade app on your device, there are essentially 3 steps: 1. Getting the Device Ready You have to get into developer mode so that you it’s possible to transfer the app to the device 64

2. Downloading and Installing the Driver You need a USB driver in order to transfer through a USB port 3. Running the App on the Device Then you can run the app on the device 65

For reference purposes, these overheads were prepared with the following: Windows 7 Eclipse, as already described A Nexus 7 tablet The fact that it was the Nexus 7 tablet is relevant to the specific instructions for getting the device ready 66

Getting the Device Ready On the running device, go to the App screen Tap on Settings Under System, find About tablet Tap Build number 7 times When you return from doing this you should find Developer options under System 67

Take Developer options Under Debugging, enable USB debugging You can now connect the device to your system using a USB cable 68

Downloading and Installing the Driver For information on the Nexus 7 USB driver, if you want any, go to the Android Web site: A search on “USB driver” will take you to a page that has information on the driver The driver is only necessary when developing in a Windows environment 69

You have a choice on getting the driver Either you can download from this page Or you can use the Android SDK Manager from the ADT bundle in Eclipse If you’re following this set of overheads and not using your own development environment, using the SDK Manager is easier 70

Using the manager is so easy, there’s not much to say about it Click on the Android SDK manager tool in the Eclipse environment Find the line for the driver Click and follow any instructions 71

What Can Be Problematic The premise of this section is that you are trying to set this up on your own machine Various versions of Windows will sometimes try to use a generic Windows driver instead of the Google driver This can be a serious problem On some systems, it appears to be impossible to prevent Windows from doing this If that happens, you will be unable to run an app on an attached device 72

It may also be possible to manually replace a Windows driver with the Google driver Here is a brief list of steps for downloading and installing the driver: Note which folder the driver is saved in Right click on the “computer” icon on your machine Take the Manage option Select the Device Manager on the left Find and expand the Other devices 73

Find the Nexus 7 device in the list You may find the Nexus 7 device somewhere else depending on your situation When you find the Nexus 7 device, right click on it Take the Update Driver Software… option Follow the directions and browse to the location where the driver was saved to 74

Running the App on the Device The assumption is that you successfully installed the driver and your device is attached with a USB cable Open your app in Eclipse Take the Run tool or the Run option in the menu This should cause the Android Device Chooser to appear on the screen, with the Nexus 7 device in the list A screen shot is shown on the following overhead 75

76

Select your device and click OK The app should run on your device In addition to running, it will be installed on the device If you go to the apps screen you’ll find the little green Android icon with the name of the app and you can run it from there in the future 77

Summary and Mission This is the end of the description of the first project As noted, it was only about nuts and bolts The presentation had nothing to do with code or the components of the app Those topics will be pursued in the following sets of overheads 78

You have two missions: 1. Get “Hello World” to work on an emulated virtual device in whatever development environment you’re using 2. Get “Hello World” to work on a real attached Android device 79

The End 80