M.A.D Assignment # 1

Similar documents
Mobile Application Development Lab [] Simple Android Application for Native Calculator. To develop a Simple Android Application for Native Calculator.

M.A.D ASSIGNMENT # 2 REHAN ASGHAR BSSE 15126

CSE 660 Lab 7. Submitted by: Arumugam Thendramil Pavai. 1)Simple Remote Calculator. Server is created using ServerSocket class of java. Server.

MAD ASSIGNMENT NO 3. Submitted by: Rehan Asghar BSSE AUGUST 25, SUBMITTED TO: SIR WAQAS ASGHAR Superior CS&IT Dept.

MAD ASSIGNMENT NO 2. Submitted by: Rehan Asghar BSSE AUGUST 25, SUBMITTED TO: SIR WAQAS ASGHAR Superior CS&IT Dept.

Intents. Your first app assignment

EMBEDDED SYSTEMS PROGRAMMING Application Tip: Managing Screen Orientation

CSE 660 Lab 3 Khoi Pham Thanh Ho April 19 th, 2015

Basic GUI elements - exercises

ANDROID PROGRAMS DAY 3

Tip Calculator. xmlns:tools=" android:layout_width="match_parent"

LAMPIRAN PROGRAM. public class Listdata_adiktif extends ArrayAdapter<ModelData_adiktif> {

StoppUhr. <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="start1"

ITU- FAO- DOA- TRCSL. Training on. Innovation & Application Development for E- Agriculture. Shared Preferences

EMBEDDED SYSTEMS PROGRAMMING Application Tip: Saving State

Android Programs Day 5

Arrays of Buttons. Inside Android

Dynamically Create Admob Banner and Interstitial Ads


Android Apps Development for Mobile and Tablet Device (Level I) Lesson 2

EMBEDDED SYSTEMS PROGRAMMING Application Tip: Switching UIs

Create Parent Activity and pass its information to Child Activity using Intents.

EMBEDDED SYSTEMS PROGRAMMING UI Specification: Approaches

Fragment Example Create the following files and test the application on emulator or device.

<uses-permission android:name="android.permission.internet"/>

Vienos veiklos būsena. Theory

Android/Java Lightning Tutorial JULY 30, 2018


android-espresso #androidespresso

Tabel mysql. Kode di PHP. Config.php. Service.php

Data Persistence. Chapter 10

Text Properties Data Validation Styles/Themes Material Design


Android CardView Tutorial

TextView Control. EditText Control. TextView Attributes. android:id - This is the ID which uniquely identifies the control.

Create a local SQL database hosting a CUSTOMER table. Each customer includes [id, name, phone]. Do the work inside Threads and Asynctasks.

else if(rb2.ischecked()) {

SMART VEHICLE TRACKING APPLICATION

Manifest.xml. Activity.java

Thread. A Thread is a concurrent unit of execution. The thread has its own call stack for methods being invoked, their arguments and local variables.

TUTOR FINDER APP REPORT OF MAJOR PROJECT SUBMITTED FOR PARTIAL FULFILLMENT OF THE REQUIREMENT FOR THE DEGREE OF MASTERS OF COMPUTER APPLICATION

Mobile Software Development for Android - I397

COMP61242: Task /04/18

UNDERSTANDING ACTIVITIES

Our First Android Application

Android Tutorial: Part 3

App Development for Smart Devices. Lec #7: Audio, Video & Telephony Try It Out

MVC Apps Basic Widget Lifecycle Logging Debugging Dialogs

PROGRAMMING APPLICATIONS DECLARATIVE GUIS

PENGEMBANGAN APLIKASI PERANGKAT BERGERAK (MOBILE)

APPENDIX CODE TO STORE THE BUTTON MENU AND MOVE THE PAGE

Applied Cognitive Computing Fall 2016 Android Application + IBM Bluemix (Cloudant NoSQL DB)

// MainActivity.java ; Noah Spenser; Senior Design; Diabetic Breathalyzer

Simple Currency Converter

05. RecyclerView and Styles

UI (User Interface) overview Supporting Multiple Screens Touch events and listeners

EMBEDDED SYSTEMS PROGRAMMING Application Basics

Accelerating Information Technology Innovation

Android Apps Development for Mobile and Tablet Device (Level I) Lesson 4. Workshop

Computer Science E-76 Building Mobile Applications

<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android=" package="com.example.root.

Software Practice 3 Before we start Today s lecture Today s Task Team organization

Android App Development. Mr. Michaud ICE Programs Georgia Institute of Technology

A Crash Course to Android Mobile Platform

BSCS 514- Computer Graphics. Course Supervisor : Dr. Humera Tariq Hands on Lab Sessions: Mr. Faraz Naqvi

shared objects monitors run() Runnable start()

Adaptation of materials: dr Tomasz Xięski. Based on presentations made available by Victor Matos, Cleveland State University.

1. Location Services. 1.1 GPS Location. 1. Create the Android application with the following attributes. Application Name: MyLocation

Embedded Systems Programming - PA8001

APPENDIX. Application User. MainActivity.java. RegistrationActivity.java

API Guide for Gesture Recognition Engine. Version 2.0

Android Beginners Workshop

使用 TensorFlow 設計矩陣乘法計算並轉移執行在 Android 上 建國科技大學資管系 饒瑞佶 2017/8

Database Development In Android Applications

Produced by. Mobile Application Development. Higher Diploma in Science in Computer Science. Eamonn de Leastar

Screen Slides. The Android Studio wizard adds a TextView to the fragment1.xml layout file and the necessary code to Fragment1.java.

Kotlin for Android developers

COMP4521 EMBEDDED SYSTEMS SOFTWARE

Real-Time Embedded Systems

Getting Started. Dr. Miguel A. Labrador Department of Computer Science & Engineering

Fragments. Lecture 11

Practical 1.ListView example

POCKET STUDY. Divyam Kumar Mishra, Mrinmoy Kumar Das Saurav Singh, Prince Kumar

10.1 Introduction. Higher Level Processing. Word Recogniton Model. Text Output. Voice Signals. Spoken Words. Syntax, Semantics, Pragmatics

Android - JSON Parser Tutorial

Android Programming วรเศรษฐ ส วรรณ ก.

Tablets have larger displays than phones do They can support multiple UI panes / user behaviors at the same time

The Definitive Guide to Firebase

Interaction with Android

@Bind(R.id.input_ ) EditText EditText Button _loginbutton;

Android Workshop: Model View Controller ( MVC):

THE CATHOLIC UNIVERSITY OF EASTERN AFRICA A. M. E. C. E. A

Android UI Development

Serious Gaming. Technical manual. This document is a collection of the code and installation process

Starting Another Activity Preferences

Learn about Android Content Providers and SQLite

Produced by. Mobile Application Development. Higher Diploma in Science in Computer Science. Eamonn de Leastar

ELET4133: Embedded Systems. Topic 15 Sensors

Topics of Discussion

API Guide for Gesture Recognition Engine. Version 1.1

Transcription:

Submitted by: Rehan Asghar Roll no: BSSE (7) 15126 M.A.D Assignment # 1 Submitted to: Sir Waqas Asghar Submitted by: M. Rehan Asghar 4/25/17 Roll no: BSSE 7 15126

XML Code: Calculator Android App <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk /res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/activity_main" android:layout_height="match_parent" android:orientation="vertical" android:paddingbottom="@dimen/activity_vertical_ android:paddingleft="@dimen/activity_horizontal_ android:paddingright="@dimen/activity_horizontal_ android:paddingtop="@dimen/activity_vertical_ tools:context="com.example.buxomrehan.calculator. MainActivity" android:weightsum="1"> <EditText android:inputtype="number" android:hint="number1" android:textsize="24sp" android:ems="10" android:id="@+id/number1" /> <EditText android:inputtype="number" android:hint="number2" android:textsize="24sp" android:ems="10"

android:id="@+id/number2" /> <TextView android:text="your Result is:" android:textsize="18sp" android:textcolor="#000000" android:layout_margintop="30sp" android:layout_marginbottom="20sp" android:textalignment="center" android:id="@+id/resulthead" /> <TextView android:text="result" android:textsize="40sp" android:layout_marginbottom="15sp" android:textalignment="center" android:id="@+id/result" /> android:text="add" android:background="#c0392b" android:id="@+id/add" /> android:text="subtract" android:background="#16a085" android:id="@+id/subtract" />

android:text="multiply" android:background="#8e44ad" android:id="@+id/multiply" /> android:text="divide" android:background="#2980b9" android:id="@+id/divide" /> <TextView android:text="by: REHAN ASGHAR" android:textalignment="center" android:textcolor="#2c3e50" android:layout_margintop="70sp" android:textsize="18sp" android:id="@+id/textview" android:layout_weight="0.08" /> </LinearLayout> Java Code: package com.example.buxomrehan.calculator; import android.net.uri; import android.support.v7.app.appcompatactivity; import android.os.bundle; import android.view.view; import android.widget.button; import android.widget.edittext; import android.widget.textview;

import com.google.android.gms.appindexing.action; import com.google.android.gms.appindexing.appindex; import com.google.android.gms.appindexing.thing; import com.google.android.gms.common.api.googleapiclient; public class MainActivity extends AppCompatActivity { TextView result; EditText number1, number2; Button add, subtract, multiply, divide; float result_num; int num1, num2; private GoogleApiClient client; protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); result = (TextView) findviewbyid(r.id.result); number1 = (EditText) findviewbyid(r.id.number1); number2 = (EditText) findviewbyid(r.id.number2); add = (Button) findviewbyid(r.id.add); subtract = (Button) findviewbyid(r.id.subtract); multiply = (Button) findviewbyid(r.id.multiply); divide = (Button) findviewbyid(r.id.divide); add.setonclicklistener(new View.OnClickListener() { result_num = num1 + num2; );

subtract.setonclicklistener(new View.OnClickListener() { result_num = num1 - num2; ); multiply.setonclicklistener(new View.OnClickListener() { result_num = num1 * num2; ); divide.setonclicklistener(new View.OnClickListener() { result_num = num1 / num2; ); client = new GoogleApiClient.Builder(this).addApi(AppIndex.API).build(); public Action getindexapiaction() { Thing object = new Thing.Builder().setName("Main Page")

.seturl(uri.parse("http://[enter-your-url-here]")).build(); return new Action.Builder(Action.TYPE_VIEW).setObject(object).setActionStatus(Action.STATUS_TYPE_COMPLETED).build(); public void onstart() { super.onstart(); client.connect(); AppIndex.AppIndexApi.start(client, getindexapiaction()); public void onstop() { super.onstop(); AppIndex.AppIndexApi.end(client, getindexapiaction()); client.disconnect();