Better reference the original webpage :

Slides:



Advertisements
Similar presentations
ANDROID DEVELOPMENT KELLY MCBEAN. DEVELOPMENT ENVIRONMENT OVERVIEW Eclipse Standard IDE for Developing Android Applications Install: 1.Java (JDK) – Since.
Advertisements

All About Android Introduction to Android 1. Creating a New App “These aren’t the droids we’re looking for.” Obi-wan Kenobi 1. Bring up Eclipse. 2. Click.
Hello world Follow steps under the sections “Create an AVD” and “Create a New Android Project” at
Application Fundamentals. See: developer.android.com/guide/developing/building/index.html.
The Android Development Environment.  Getting started on the Android Platform  Installing required libraries  Programming Android using the Eclipse.
Filip Debelić What is it? Android is a mobile operating system (OS) based on the Linux kernel and currently developed by Google Android,
Android: Hello World Frank Xu Gannon University. Steps Configuration ▫Android SDK ▫Android Development Tools (ADT)  Eclipse plug-in ▫Android SDK and.
Android Programming Beomjoo Seo Sep., 12 CS5248 Fall 2012.
ANDROID PROGRAMMING MODULE 1 – GETTING STARTED
Setting up the Development Environment Copyright © SUPINFO. All rights reserved Preparation.
How to make it work? Doncho Minkov Telerik Academy academy.telerik.com Technical Trainer
SET UP COMPUTER ** PLEASE BE AWARE SCREENSHOTS MAY NOT MATCH **
Android Development (Basics)
Getting Started with Android Programming Note: if you have already installed android development tools, please check that you have the same version as.
© Frank Mueller & Seokyong Hong (TA) North Carolina State University Center for Efficient, Secure and Reliable Computing Android Installation Guide (2)
INTERNATIONAL SUMMER ACADEMIC COURSE UNIVESITY OF NIS ISAC – Android programming.
Android Application Development CSE 5520/4520 Wireless Networks.
SEEM4570: XAMPP, Eclipse, Summary of Html Kangfei Zhao Room 711,ERB
Android Programming. Outline Preparation Create new project Build and Run a project Debug a project Deploy on devices.
Android Application Development 2013 PClassic Chris Murphy 1.
Mobile Programming Lecture 1 Getting Started. Today's Agenda About the Eclipse IDE Hello, World! Project Android Project Structure Intro to Activities,
Introduction to Android Programming Content Basic environmental structure Building a simple app Debugging.
Android development the first app. Andoid vs iOS which is better? Short answer: neither Proponents on both sides For an iOS side, see this article on.
CS5103 Software Engineering Lecture 08 Android Development II.
1 Mobile Computing Set Up Copyright 2015 by Janson Industries.
Favorite Twitter® Searches App Android How to Program © by Pearson Education, Inc. All Rights Reserved.
Hello world Follow steps under the sections “Create an AVD” and “Create a New Android Project” at
Chapter 2: Simplify! The Android User Interface
Android. The Eclipse IDE Installation Requirements: Eclipse Java Windows All must match (32-bit OR 64-bit) If you have a 64-bit OS & 32-bit browser,
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.
Tip Calculator App Building an Android App with Java © by Pearson Education, Inc. All Rights Reserved.
DUE Hello World on the Android Platform.
Social Media Apps Programming Min-Yuh Day, Ph.D. Assistant Professor Department of Information Management Tamkang University
Eclipse Tutorial Barrett Summer Scholars 2011 Sustainable Engineering: Learning to Engineer Truly Green Products.
© 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.
Presented By: Muhammad Tariq Software Engineer Android Training course.
Chapter 2 The Android User Interface. Objectives  In this chapter, you learn to:  Develop a user interface using the TextView, ImageView, and Button.
INTRODUCTION TO ANDROID. Slide 2 Application Components An Android application is made of up one or more of the following components Activities We will.
Android Boot Camp for Developers Using Java, 3E
Android Boot Camp for Developers Using Java, Comprehensive: A Guide to Creating Your First Android Apps Chapter 2: Simplify! The Android User Interface.
Android Development Environment Environment/tools Windows Eclipse IDE for Java Developers (v3.5 Galileo) Java Platform (JDK 6 Update 18) Android.
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.
First Venture into the Android World Chapter 1 Part 2.
Android Boot Camp Demo Application – Part 1. Development Environment Set Up Download and install Java Development Kit (JDK) Download and unzip Android.
 Installation of Android Development Environment  Creating the App with OpenGL ES API  Running the App on Emulator Android App Development.
Applications with Multiple Activities. Most applications will have more than one activity. The main activity is started when the application is started.
HW#9 Clues CSCI 571 Fall, HW#9 Prototype
MOBILE COMPUTING D10K-7D02 MC05: Android UI Design Dr. Setiawan Hadi, M.Sc.CS. Program Studi S-1 Teknik Informatika FMIPA Universitas Padjadjaran.
ANDROID APPLICATION DEVELOPMENT. ANDROID DEVELOPMENT DEVELOPER.ANDROID.COM/INDEX.HTML THE OFFICIAL SITE FOR ANDROID DEVELOPERS. PROVIDES THE ANDROID SDK.
TODAY Android Studio Installation Getting started Creating your 1 st App Beginning to understanding Intents.
Intoduction to Andriod studio Environment With a hello world program.
BUILDING A SIMPLE USER INTERFACE. In this lesson, you create a layout in XML that includes a text field and a button. In the next lesson, your app responds.
ANDROID LAYOUTS AND WIDGETS. Slide 2 Introduction Parts of the Android screen Sizing widgets and fonts Layouts and their characteristics Buttons, checkboxes.
INTRODUCTION TO ANDROID. Slide 2 Introduction I take a top-down approach to describing an application’s anatomy.
Android apps development - Eclipse, Android SDK, and ADT plugin Introduction of.
IBM Worklight environment setup 1. Eclipse IDE Multi-purpose integrated development environment (IDE) Open source Supported for Windows, Mac OS X, Linux.
Chapter 2: Simplify! The Android User Interface
Introduction to android
Android 01: Fundamentals
Android 4: Second Project, Echoing
Mobile Application Development Chapter 3 [Using Eclipse Android Studio for Android Development] IT448-Fall 2017 IT448- Fall2017.
Android 4: Second Project, Echoing
Android 4: A Second Project
Android 基礎.
CS5103 Software Engineering
Android Application Development
Building a Simple User Interface
Activities, Fragments, and Intents
Presentation transcript:

Better reference the original webpage :

Download the Android SDK. Install the ADT plugin for Eclipse (if you’ll use the Eclipse IDE). Eclipse download :

ADT plugin downlaod: Start Eclipse, then select Help > Install New Software. Click Add, in the top-right corner. In the Add Repository dialog that appears, enter "ADT Plugin" for the Name and the following URL for the Location: ssl.google.com/android/eclipse/ Click OK.If you have trouble acquiring the plugin, try using "http" in the Location URL, instead of "https" (https is preferred for security reasons). In the Available Software dialog, select the checkbox next to Developer Tools and click Next. In the next window, you'll see a list of the tools to be downloaded. Click Next. Read and accept the license agreements, then click Finish.If you get a security warning saying that the authenticity or validity of the software can't be established, click OK. When the installation completes, restart Eclipse.

Download the latest SDK tools and platforms using the SDK Manager.

Click New in the toolbar. In the window that appears, open the Android folder, select Android Application Project, and click Next. Fill in the form that appears: Application Name 、 Project Name 、 Package Name 、 Minimum Required SDK 、 Target SDK 、 Compile With 、 Theme then click Next select BlankActivity and click Next. click Finish

AndroidManifest.xml have element src/ have includes an Activity classActivity res/ have app resources with is something like:app resources drawable-hdpi/ 、 layout/ 、 values/

Plug in your device to your development machine with a USB cable.(install the appropriate USB driver for your device if needed) Enable USB debugging on your device.(On Android 4.0 and newer, it's in Settings > Developer options.) Run in Eclipse: 1.click Run from the toolbar. 2. In the Run as window that appears, select Android Application and click OK.

Launch the Android Virtual Device Manager:In Eclipse, click Android Virtual Device Manager from the toolbar. In the Android Virtual Device Manager panel, click New. Fill in the details for the AVD. Click Create AVD. Select the new AVD from the Android Virtual Device Manager and click Start. After the emulator boots up, unlock the emulator screen.

Run in Eclipse: 1.click Run from the toolbar. 2. In the Run as window that appears, select Android Application and click OK.

The graphical user interface for an Android app is built using a hierarchy of View and ViewGroup objects.ViewViewGroup View objects are usually UI widgets such as buttons or text fields Viewbuttonstext fields ViewGroup objects are invisible view containers that define how the child views are laid out, such as in a grid or a vertical list. ViewGroup

Open the activity_main.xml file from the res/layout/ directory. First, delete the element and change the element to. Then add the android:orientation attribute and set it to "horizontal". android:orientation Add a Text Field-To create a user-editable text field, add an element inside the The result looks like this:

To create a user-editable text field, add an element inside the

By default, your Android project includes a string resource file at res/values/strings.xml. Add a new string named "edit_message" and set the value to "Enter a message.“ While you’re in this file, also add a "Send" string for the button you’ll soon add, called "button_send". The result for strings.xml looks like this: My First App Enter a message Send Settings MainActivity

Now add a to the layout, immediately following the element: The height and width are set to "wrap_content" so the button is only as big as necessary to fit the button's text. This button doesn't need the android:id attribute, because it won't be referenced from the activity code.android:id

Respond to the Send Button To respond to the button's on-click event, open theactivity_main.xml layout file and add theandroid:onClick attribute to the element:android:onClick The android:onClick attribute’s value, "sendMessage", is the name of a method in your activity that the system calls when the user clicks the button.android:onClick

Intent represents an app’s "intent to do something." You can use intents for a wide variety of tasks, but most often they’re used to start another activity.Intent Inside the sendMessage() method, create an Intent to start an activity called DisplayMessageActivity:Intent Intent intent = new Intent(this, DisplayMessageActivity.class);

The constructor used here takes two parameters: A Context as its first parameter (this is used because the Activity class is a subclass of Context)ContextActivityContext The Class of the app component to which the system should deliver the Intent (in this case, the activity that should be started)ClassIntent

An intent not only allows you to start another activity, but it can carry a bundle of data to the activity as well. Inside thesendMessage() method, use findViewById() to get theEditText element and add its text value to the intent:findViewById()EditText Intent intent = new Intent(this, DisplayMessageActivity.class); EditText editText = (EditText) findViewById(R.id.edit_message); String message = editText.getText().toString(); intent.putExtra(EXTRA_MESSAGE, message);

To start an activity, call startActivity() and pass it your Intent. The system receives this call and starts an instance of the Activity specified by the Intent.startActivity()IntentActivityIntent With this new code, the complete sendMessage() method that's invoked by the Send button now looks like this: /** Called when the user clicks the Send button */ public void sendMessage(View view) { Intent intent = new Intent(this, DisplayMessageActivity.class); EditText editText = (EditText) findViewById(R.id.edit_message); String message = editText.getText().toString(); intent.putExtra(EXTRA_MESSAGE, message); startActivity(intent); } Now you need to create the DisplayMessageActivity class in order for this to work.

Click New in the toolbar. In the window that appears, open theAndroid folder and select Android Activity Click Next.Select BlankActivity and click Next. Fill in the activity details:Project: MyFirstApp Activity Name: DisplayMessageActivity Layout Name: activity_display_message Title: My Message Hierarchial Parent: com.example.myfirstapp.MainActivity Navigation Type: None Click Finish.

Every Activity is invoked by an Intent, regardless of how the user navigated there. You can get the Intentthat started your activity by calling getIntent() and retrieve the data contained within it.ActivityIntent getIntent() In the DisplayMessageActivity class’s onCreate() method, get the intent and extract the message delivered by MainActivity:onCreate() Intent intent = getIntent(); String message = intent.getStringExtra(MainActivity.EXTRA_MESSAGE);

To show the message on the screen, create a TextView widget and set the text using setText(). Then add theTextView as the root view of the activity’s layout by passing it to setContentView().TextViewsetText()TextViewsetContentView() The complete onCreate() method for DisplayMessageActivity now looks like public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Get the message from the intent Intent intent = getIntent(); String message = intent.getStringExtra(MainActivity.EXTRA_MESSAGE); // Create the text view TextView textView = new TextView(this); textView.setTextSize(40); textView.setText(message); // Set the text view as the activity layout setContentView(textView); }

Better reference the original webpage if any question.