@2010 Mihail L. Sichitiu1 Android Introduction Hello Views Part 2.

Slides:



Advertisements
Similar presentations
Programming with Android: Widgets and Events Luca Bedogni Marco Di Felice Dipartimento di Scienze dell’Informazione Università di Bologna.
Advertisements

@2011 Mihail L. Sichitiu1 Android Introduction Hello Socket Programming TCP and UDP.
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.
Basic Functionality in Android. Functionality in Android Events in Java – mouse related mouse clicked button down or up mouse entered – many others key.
@2011 Mihail L. Sichitiu1 Android Introduction Communication between Activities.
@2011 Mihail L. Sichitiu1 Android Introduction Hello Views Part 1.
Android Development (Basics)
@2010 Mihail L. Sichitiu1 Android Introduction Hello Localization.
@2011 Mihail L. Sichitiu1 Android Introduction Hello World.
1 Mobile Software Development Framework: Android Activity, View/ViewGroup, External Resources, Listener 10/9/2012 Y. Richard Yang.
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.
Getting Started with Android APIs Ivan Wong. Motivation - “Datasheet” - Recently exposed to what’s available in Android - So let’s see what API’s are.
Database-Driven Web Sites, Second Edition1 Chapter 8 Processing ASP.NET Web Forms and Working With Server Controls.
Mobile Programming Lecture 2 Layouts, Widgets, Toasts, and Event Handling.
Wireless Mobility with Android 1 Presented by: Ung Yean MS. Computer Science American University, Washington DC, USA.
Hello world Follow steps under the sections “Create an AVD” and “Create a New Android Project” at
Chapter 2: Simplify! The Android User Interface
@2011 Mihail L. Sichitiu1 Android Introduction GUI Menu Many thanks to Jun Bum Lim for his help with this tutorial.
Chapter 2 The Android User Interface. Objectives  In this chapter, you learn to:  Develop a user interface using the TextView, ImageView, and Button.
Threads and Services. Background Processes One of the key differences between Android and iPhone is the ability to run things in the background on Android.
Programming Mobile Applications with Android September, Albacete, Spain Jesus Martínez-Gómez.
Presented By: Muhammad Tariq Software Engineer Android Training course.
Android Boot Camp for Developers Using Java, Comprehensive: A Guide to Creating Your First Android Apps Chapter 2: Simplify! The Android User Interface.
Networking: Part 1 (Web Content). Networking with Android Android provides A full-featured web browser based on Chromium, the open source browser engine.
Copyright© Jeffrey Jongko, Ateneo de Manila University Basic Views and Layouts.
User Interface Android Club Agenda Button OnClickListener OnLongClickListener ToggleButton Checkbox RatingBar AutoCompleteTextView.
Android Boot Camp Demo Application – Part 1. Development Environment Set Up Download and install Java Development Kit (JDK) Download and unzip Android.
Handling View Events. Open the *MainActivity.java* which is the Activity that hosts the layout in "activity_main.xml". The setContentView method inside.
Android Using Menus Notes are based on: The Busy Coder's Guide to Android Development by Mark L. Murphy Copyright © CommonsWare, LLC. ISBN:
Video Games list lab 6  At the end of this lab you will be expected to know:  What Views, View Groups, Layouts, and Widgets are and how they relate to.
Mobile Programming Lecture 7 Dialogs, Menus, and SharedPreferences.
Copyright© Jeffrey Jongko, Ateneo de Manila University Deconstructing HelloWorld.
Android Application Lifecycle and Menus
Android - SQLite Database 12/10/2015. Introduction SQLite is a opensource SQL database that stores data to a text file on a device. Android comes in with.
Designing user interfaces using: Simple views 1. Views Basic views – TextView – EditText – Button – ImageButton – CheckBox – ToggleButton – RadioButton.
Chapter 5 Introduction To Form Builder. Lesson C Objectives  Use sequences to automatically generate primary key values in a form  Create lists of values.
TCS Internal Maps. 2 TCS Internal Objective Objective :  MAPS o Integration of Maps.
User Interface Layout Interaction. EventsEvent Handlers/Listeners Interacting with a user.
Android Alert Dialog. Alert Dialog Place Button to open the dialog. public class MainActivity extends ActionBarActivity { private static Button button_sbm;
CHAP 6. 이벤트 처리. © 2012 생능출판사 All rights reserved 폴링과 이벤트 구동 방식.
Events. Slide 2©SoftMoore Consulting Events Events are generated when a user interacts with the view objects of an application. Examples –button clicked–
Cosc 5/4730 Embedding the browser in your app. Embedding the browser For many applications, you may not nothing more then the web browser – But you want.
Contents Searches related to Android RatingBar Basics Android ratingbar example Android custom ratingbar.
Android 基本 I/O. 基本 I/O 介面元件 在此節中主要介紹常見的 I/O 使用者介 面元件 – Button, TextView, 以及 EditText , 學習者可以學會: – Android 的視窗表單設計 res/layout/main.xml – Android SDK –
CMPE419 Mobile Application Development Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department Asst.Prof.Dr.Ahmet Ünveren
Cosc 5/4730 Support design library. Support Design library Adds (API 9+) back support to a number of 5.0 lollipop widgets and material design pieces –
Chapter 2: Simplify! The Android User Interface
Android Programming - Features
Android N Amanquah.
several communicating screens
GUI Programming Fundamentals
Android – Event Handling
Communication between Activities
Android Widgets 1 7 August 2018
ITEC535 – Mobile Programming
Android – Read/Write to External Storage
HUJI Post PC Workshop 1 Introduction to Android Development Ari Sprung
Mobile Computing With Android ACST 4550 XML and the Android GUI
Android Introduction Hello Views Part 2.
CIS 470 Mobile App Development
Many thanks to Jun Bum Lim for his help with this tutorial.
BMI Android Application will take weight and height from the users to calculate Body Mass Index (BMI) with the information, whether user is underweight,
Android Developer Fundamentals V2
滑動 建國科技大學 資管系 饒瑞佶.
CIS 470 Mobile App Development
ארועים ומאזינים android.
Mobile Programmming Dr. Mohsin Ali Memon.
CMPE419 Mobile Application Development
Presentation transcript:

@2010 Mihail L. Sichitiu1 Android Introduction Hello Views Part 2

@2010 Mihail L. Sichitiu2 Hello Form Stuff  Custom Buttons  Edit Text  Check Boxes  Radio Boxes  Toggle Button  Rating Bar

@2010 Mihail L. Sichitiu3 Custom Button   final Button button = (Button) findViewById(R.id.button); button.setOnClickListener(new OnClickListener() { public void onClick(View v) { // Perform action on clicks Toast.makeText(HelloFormStuff.this, "Beep Bop", Toast.LENGTH_SHORT).show(); } });

@2010 Mihail L. Sichitiu4 Edit Text   final EditText edittext = (EditText) findViewById(R.id.edittext); edittext.setOnKeyListener(new OnKeyListener() { public boolean onKey(View v, int keyCode, KeyEvent event) { // If the event is a key-down event on the "enter" button if ((event.getAction() == KeyEvent.ACTION_DOWN) && (KeyEvent.KEYCODE_ENTER)) { // Perform action keyCode == on key press Toast.makeText(HelloFormStuff.this, edittext.getText(), Toast.LENGTH_SHORT).show(); return true; } return false; } });

@2010 Mihail L. Sichitiu5 Check Box   final CheckBox checkbox = (CheckBox) findViewById(R.id.checkbox); checkbox.setOnClickListener(new OnClickListener() { public void onClick(View v) { // Perform action on clicks, depending on whether it's now checked if (((CheckBox) v).isChecked()) { Toast.makeText(HelloFormStuff.this, "Selected", Toast.LENGTH_SHORT).show(); } else { Toast.makeText(HelloFormStuff.this, "Not selected", Toast.LENGTH_SHORT).show(); } } });

@2010 Mihail L. Sichitiu6 Radio Button   private OnClickListener radio_listener = new OnClickListener() { public void onClick(View v) { // Perform action on clicks RadioButton rb = (RadioButton) v; Toast.makeText(HelloFormStuff.this, rb.getText(), Toast.LENGTH_SHORT).show(); } };  final RadioButton radio_red = (RadioButton) findViewById(R.id.radio_red); final RadioButton radio_blue = (RadioButton) findViewById(R.id.radio_blue); radio_red.setOnClickListener(radio_listener); radio_blue.setOnClickListener(radio_listener);

@2010 Mihail L. Sichitiu7 Toggle Button   final ToggleButton togglebutton = (ToggleButton) findViewById(R.id.togglebutton); togglebutton.setOnClickListener(new OnClickListener() { public void onClick(View v) { // Perform action on clicks if (togglebutton.isChecked()) { Toast.makeText(HelloFormStuff.this, "Checked", Toast.LENGTH_SHORT).show(); } else { Toast.makeText(HelloFormStuff.this, "Not checked", Toast.LENGTH_SHORT).show(); } } });

@2010 Mihail L. Sichitiu8 Rating Bar   final RatingBar ratingbar = (RatingBar) findViewById(R.id.ratingbar); ratingbar.setOnRatingBarChangeListener(new OnRatingBarChangeListener() { public void onRatingChanged(RatingBar ratingBar, float rating, boolean fromUser) { Toast.makeText(HelloFormStuff.this, "New Rating: " + rating, Toast.LENGTH_SHORT).show(); } });

@2010 Mihail L. Sichitiu9 Hello WebView  Making a window for viewing web pages

@2010 Mihail L. Sichitiu10 /res/layout/main.xml 

@2010 Mihail L. Sichitiu11 OnCreate( )  WebView mWebView;  public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); mWebView = (WebView) findViewById(R.id.webview); mWebView.getSettings().setJavaScriptEnabled(true); mWebView.loadUrl(" }

@2010 Mihail L. Sichitiu12 AndroidManifest 

@2010 Mihail L. Sichitiu13 Run it!

@2010 Mihail L. Sichitiu14 For the MapView Generate an API Key Thank you for signing up for an Android Maps API key! Your key is: 0sfwSFw1BU4WGRreaBYtss4jGuPccZhhq7WDOCg This key is good for all apps signed with your certificate whose fingerprint is: D6:0A:9A:E8:24:D1:D7:8C:F5:68:20:7D:67:40:3A:01 Here is an example xml layout to get you started: