Lab7 – Advanced.

Slides:



Advertisements
Similar presentations
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.
Advertisements

Android Application Development with Java UPenn CS4HS 2011 Chris Murphy
Android Development (Basics)
Android Application Development Tutorial. Topics Lecture 5 Overview Overview of Networking Programming Tutorial 2: Downloading from the Internet.
CS378 - Mobile Computing Anatomy of an Android App and the App Lifecycle.
Better reference the original webpage :
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.
Chapter 2: Simplify! The Android User Interface
Package org.androidtown.database.query; import android.app.Activity; import android.content.Context; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase;
Social Media Apps Programming Min-Yuh Day, Ph.D. Assistant Professor Department of Information Management Tamkang University
Chapter 2 The Android User Interface. Objectives  In this chapter, you learn to:  Develop a user interface using the TextView, ImageView, and Button.
Android Programming-Activity Lecture 4. Activity Inside java folder Public class MainActivity extends ActionBarActivity(Ctrl + Click will give you the.
Android - Broadcast Receivers
Android 3: Exploring Apps and the Development Environment Kirk Scott 1.
Android Hello World 1. Click on Start and type eclipse into the textbox 2.
데이터 저장 & Fragment UNIT 28 로봇 SW 콘텐츠 교육원 조용수. 데이터 저장 & Fragment SharedPreference 로 데이터 저장 Fragment 의 이해 2.
Android Boot Camp Demo Application – Part 1. Development Environment Set Up Download and install Java Development Kit (JDK) Download and unzip Android.
Introduction to Android
Applications with Multiple Activities. Most applications will have more than one activity. The main activity is started when the application is started.
MOBILE COMPUTING D10K-7D02 MC03: Introduction to Android Programming Dr. Setiawan Hadi, M.Sc.CS. Program Studi S-1 Teknik Informatika FMIPA Universitas.
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.
ANDROID – A FIRST PROGRAM L. Grewe Using AndroidStudio –basic Android  Lets do a “Hello World Project”  Start up AndroidStudio (assume you have installed.
MOBILE COMPUTING D10K-7D02 MC05: Android UI Design Dr. Setiawan Hadi, M.Sc.CS. Program Studi S-1 Teknik Informatika FMIPA Universitas Padjadjaran.
TCS Internal Maps. 2 TCS Internal Objective Objective :  MAPS o Integration of Maps.
創造工学設計 I 電子情報工学科4年(前期) 9 回目 ( 18/6/2015) 担当 古山彰一
Android Alert Dialog. Alert Dialog Place Button to open the dialog. public class MainActivity extends ActionBarActivity { private static Button button_sbm;
Contents Searches related to Android RatingBar Basics Android ratingbar example Android custom ratingbar.
Mobile Software Development for Android - I397 IT COLLEGE, ANDRES KÄVER, WEB:
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
CHAPTER 1 Part 2 Android Programming. Chapter objectives: Understand how to create a simple Android project Understand how to create a manifest file Understand.
Chapter 2: Simplify! The Android User Interface
Lab7 – Appendix.
Android 3: Exploring Apps and the Development Environment
Java Examples Embedded System Software
Android – Event Handling
S.RENUKADEVI/AP/SCD/ANDROID - Notifications
Android Widgets 1 7 August 2018
Android – Read/Write to External Storage
Picasso Revisted.
CIS 470 Mobile App Development
Software Engineering for Internet Applications
CIS 470 Mobile App Development
CIS 470 Mobile App Development
Android Studio Hello World
CIS 470 Mobile App Development
CIS 470 Mobile App Development
CIS 470 Mobile App Development
CIS 470 Mobile App Development
CMPE419 Mobile Application Development
CMPE419 Mobile Application Development
UNIT 08 그림책 만들기 2/2 로봇 SW 콘텐츠 교육원 조용수.
BMI Android Application will take weight and height from the users to calculate Body Mass Index (BMI) with the information, whether user is underweight,
CIS 470 Mobile App Development
CIS 470 Mobile App Development
CIS 470 Mobile App Development
CIS 470 Mobile App Development
CIS 470 Mobile App Development
Android Project Structure, App Resources and Event Handling
Cosc 4730 An Introduction.
CMPE419 Mobile Application Development
CMPE419 Mobile Application Development
Activities, Fragments, and Intents
Android Sensor Programming
Android Sensor Programming
CIS 694/EEC 693 Android Sensor Programming
CIS 694/EEC 693 Android Sensor Programming
CIS 470 Mobile App Development
CIS 694/EEC 693 Android Sensor Programming
Presentation transcript:

Lab7 – Advanced

Create a New Project  Name it Lab7

SDK for Lab7  Select SDK  Click Next

Complete Creating Project Lab7  Click Finish

Open Activity_Main.xml  Add a Button to the screen  Select the button

Activity_Main.xml  Add a Button  Drag the button to the screen

Activity_Main.xml  Add a Button  Double Click on the Button and Name It  Submit

Add a Listener to Button  Create a Java Class  OurOnClickListener Add a Listener to Button  Create a Java Class  OurOnClickListener.java  This class will listen to button event Add

Add onClick Method in OurOnClickListener Add onClick Method in OurOnClickListener.java  To Listen Submit Action in Mobile UI  Screenshot

Add onClick Method in OurOnClickListener Add onClick Method in OurOnClickListener.java  To Listen Submit Action in Mobile UI Note: There will be an Error, but will be fixed in the next step package ecodcnc.com.lab7; import android.view.View; import android.view.View.OnClickListener; public class OurOnClickListener implements OnClickListener { MainActivity caller; private int count; public OurOnClickListener(MainActivity activity) { this.caller = activity; this.count = 0; } @Override public void onClick(View v) { count++; String countstr = Integer.toString(count); caller.textView.setText("Clicked " + countstr + " times"); } }

Add onCreate Method in MainActivity Add onCreate Method in MainActivity.java  For Main Screen Submit Action Invocation (OurOnClickListener.java)  Screenshot

Add onCreate Method in MainActivity Add onCreate Method in MainActivity.java  For Main Screen Submit Action Invocation (OurOnClickListener.java) package  ecodcnc.com.helloandroid; import android.app.Activity; import android.os.Bundle; import android.os.StrictMode; import android.util.Log; import android.view.Menu; import android.view.MenuItem; import android.widget.Button; import android.widget.TextView; import android.widget.Toast; public class MainActivity extends AppCompatActivity {     TextView textView;     Button ourButton;     // OVER WRITE OnCreate Method in LAB 7     @Override     protected void onCreate(Bundle bundle) {         super.onCreate(bundle);         setContentView(R.layout.activity_main);         textView = (TextView) findViewById(R.id.textView);         ourButton = (Button) findViewById(R.id.button);         ourButton.setOnClickListener(new OurOnClickListener(this));     }

Run the Application

Hurray!!! My Submit Count App is Cool  Click on the Submit button and see the count increase

Important Files src/MainActivity.java Activity which is started when app executes gen/R.java (DO NOT MODIFY!) Auto-generated, auto-updated file with identifiers from main.xml, strings.xml, and elsewhere res/layout/activity_main.xml Defines & lays out widgets for the activity res/values/strings.xml String constants used by app AndroidManifest.xml Declares all the app’s components Names libraries app needs to be linked against Identifies permissions the app expects to be granted