CMPE419 Mobile Application Development

Slides:



Advertisements
Similar presentations
Application Fundamentals. See: developer.android.com/guide/developing/building/index.html.
Advertisements

Presenting Lists of Data. Lists of Data Issues involved – unknown number of elements – allowing the user to scroll Data sources – most common ArrayList.
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.
Social Media Apps Programming Min-Yuh Day, Ph.D. Assistant Professor Department of Information Management Tamkang University
1 Announcements Homework #2 due Feb 7 at 1:30pm Submit the entire Eclipse project in Blackboard Please fill out the when2meets when your Project Manager.
1/29/ Android Programming: FrameLayout By Dr. Ramji M. Makwana Professor and Head, Computer Engineering Department A.D. Patel.
Chapter 2 The Android User Interface. Objectives  In this chapter, you learn to:  Develop a user interface using the TextView, ImageView, and Button.
Android - Broadcast Receivers
Networking: Part 1 (Web Content). Networking with Android Android provides A full-featured web browser based on Chromium, the open source browser engine.
로봇 모니터링 1/2 UNIT 20 로봇 SW 콘텐츠 교육원 조용수. 학습 목표 Message Queue Handler 2.
ANDROID – DRAWING IMAGES – SIMPLE EXAMPLE IN INTERFACE AND EVENT HANDLING L. Grewe.
Android Boot Camp Demo Application – Part 1. Development Environment Set Up Download and install Java Development Kit (JDK) Download and unzip Android.
Android ImageView and Splash Screen 1. After copying an image file (Ctrl-c or right click copy), right click and paste it into one of the res/drawable.
로봇을 조종하자 4/4 UNIT 18 로봇 SW 콘텐츠 교육원 조용수. 학습 목표 Intent Activity 호출 2.
Android and s Ken Nguyen Clayton state University 2012.
Android Alert Dialog. Alert Dialog Place Button to open the dialog. public class MainActivity extends ActionBarActivity { private static Button button_sbm;
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
CMPE419 Mobile Application Development Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department Asst.Prof.Dr.Ahmet Ünveren
CMPE419 Mobile Application Development Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department Asst.Prof.Dr.Ahmet Ünveren
Chapter 2: Simplify! The Android User Interface
Lab7 – Appendix.
Introduction to android
several communicating screens
CS240: Advanced Programming Concepts
GUI Programming Fundamentals
Android -By Yogita Nirmal.
Android – Event Handling
Android 5: Assignment 1, First Half, Arithmetic Operations and Exceptions.
Android Widgets 1 7 August 2018
Android – Read/Write to External Storage
Picasso Revisted.
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
CIS 470 Mobile App Development
CIS 470 Mobile App Development
CIS 470 Mobile App Development
Android Sensor Programming
CMPE419 Mobile Application Development
CA16R405 - Mobile Application Development (Theory)
CMPE419 Mobile Application Development
CMPE419 Mobile Application Development
CMPE419 Mobile Application Development
BMI Android Application will take weight and height from the users to calculate Body Mass Index (BMI) with the information, whether user is underweight,
CMPE419 Mobile Application Development
Activities and Intents
CIS 470 Mobile App Development
CIS 493/EEC 492 Android Sensor Programming
CIS 470 Mobile App Development
CIS 470 Mobile App Development
CIS 470 Mobile App Development
CIS 470 Mobile App Development
ארועים ומאזינים android.
CMPE419 Mobile Application Development
Android Project Structure, App Resources and Event Handling
Adding Components to Activity
Korea Software HRD Center
CMPE419 Mobile Application Development
BLP 4216 MOBİL UYGULAMA GELİŞTİRME-2
CMPE419 Mobile Application Development
CMPE419 Mobile Application Development
CIS 470 Mobile App Development
Android Sensor Programming
Android Sensor Programming
CIS 694/EEC 693 Android Sensor Programming
CIS 694/EEC 693 Android Sensor Programming
CIS 694/EEC 693 Android Sensor Programming
Presentation transcript:

CMPE419 Mobile Application Development Asst.Prof.Dr.Ahmet Ünveren 2018-2019 SPRING Computer Engineering Department CMPE419 AU

Example:(Table Layout)

<TableLayout xmlns:android="http://schemas. android xmlns:tools="http://schemas.android.com/tools" android:id="@+id/TableLayout1" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context="com.CMPE419.gpa.MainActivity" > <TableRow android:id="@+id/tableRow1" android:layout_width="wrap_content" android:layout_height="wrap_content" > <TextView android:id="@+id/textView1" android:layout_height="wrap_content" android:text="Name " /> <EditText android:id="@+id/editText1" android:layout_width="131dp" android:ems="10" /> </TableRow> android:id="@+id/tableRow2" android:id="@+id/textView2" android:text="Surname " /> android:id="@+id/editText2" android:layout_width="163dp" android:ems="10" > <requestFocus /> </EditText> ... </TableLayout>

<TableRow android:id="@+id/tableRow7" android:layout_width="wrap_content" android:layout_height="wrap_content" > android:text="Column 0" /> <Button android:id="@+id/button1" android:layout_height="wrap_content" android:text="Button" /> </TableRow>

Get Values From EditText: final EditText m1=(EditText)findViewById(R.id.editText3); final EditText m2=(EditText)findViewById(R.id.editText4); final EditText fin=(EditText)findViewById(R.id.editText5); String m11=m1.getText().toString(); mt1=Double.parseDouble(m11); String m22= m2.getText().toString(); mt2=Double.parseDouble(m22); //mt2=Double.valueof(m22); String fin2=fin.getText().toString(); fina=Double.parseDouble(fin2); double tot=mt1*0.25+mt2*0.25+fina*0.5;

Button b1=(Button)findViewById(R.id.button1); b1.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub String m11=m1.getText().toString(); mt1=Double.parseDouble(m11); String m22= m2.getText().toString(); mt2=Double.parseDouble(m22); //mt2=Double.valueof(m22); String fin2=fin.getText().toString(); fina=Double.parseDouble(fin2); double tot=mt1*0.25+mt2*0.25+fina*0.5; Tv.setText(""+tot); } });

Add Picture to your Project Add a Picture: Step 1: Create a Project with main activity Step 2: Goto your Workspace directory and find your project name. Step 3: Open drawable-hdpi directory and copy your picture into this directory. Step 4: From Eclips menu select Project and than clean for recognizing picture. Step 5: Goto xml file and use properties and Background options to select your picture (Under Drawable)(If error occures restart Eclips).

Password Field:

Android radio buttons example: In Android, you can use “android.widget.RadioButton” class to render radio button, and those radio buttons are usually grouped by android.widget.RadioGroup. If RadioButtons are in group, when oneRadioButton within a group is selected, all others are automatically deselected.

Intent and Moving Data between Activities Step 1: Create MainActivity Step2: Create NewActivity Step3: Create new Intent in MainActivity Step4: Send your data from MainActivity using putExtra method Step5: Get data in NewActivity using getIntent().getExtras()

package com.example.cmpe; public class MainActivity extends Activity { EditText Et1_name; EditText Et2_surname; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Et1_name=(EditText)findViewById(R.id.editText1); Et2_surname=(EditText)findViewById(R.id.editText2); Button Bt=(Button)findViewById(R.id.button1); Bt.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub //startActivity(new Intent("android.intent.action.MYNEW")); String name=Et1_name.getText().toString(); String surname=Et2_surname.getText().toString(); //Creating a new intent Intent intent=new Intent(MainActivity.this, MyNew.class); //Sending data to next activity using putExtra method intent.putExtra("NAME", name); intent.putExtra("SURNAME", surname); //starting new activity startActivity(intent); } }); }

package com.example.cmpe; public class MyNew extends Activity{ @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.mynew); final TextView T1=(TextView)findViewById(R.id.textView2); final TextView T2=(TextView)findViewById(R.id.textView4); Bundle bunble=getIntent().getExtras(); if(bunble!=null){ //Getting the value stored in the name "NAME" String user_name=bunble.getString("NAME"); String user_surname=bunble.getString("SURNAME"); //appending the value to the contents of textView1. T1.append(" "+user_name); T2.append(" "+user_surname); } final Button b=(Button)findViewById(R.id.button1); b.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { // TODO Auto-generated method stub finish(); }}); }}