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

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

EMBEDDED SYSTEMS PROGRAMMING Application Tip: Switching UIs

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

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

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

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

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

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

ANDROID PROGRAMS DAY 3

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

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

M.A.D Assignment # 1

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

Mobile Software Development for Android - I397

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

Android Programs Day 5

Android Application Development. By : Shibaji Debnath

Basic GUI elements - exercises

Intents. Your first app assignment

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

EMBEDDED SYSTEMS PROGRAMMING Application Tip: Managing Screen Orientation

Android - JSON Parser Tutorial

EMBEDDED SYSTEMS PROGRAMMING Application Tip: Saving State

PENGEMBANGAN APLIKASI PERANGKAT BERGERAK (MOBILE)

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

EMBEDDED SYSTEMS PROGRAMMING Android Services

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

EMBEDDED SYSTEMS PROGRAMMING UI Specification: Approaches

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

Manifest.xml. Activity.java

Android - Widgets Tutorial

PROGRAMMING APPLICATIONS DECLARATIVE GUIS

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

Dynamically Create Admob Banner and Interstitial Ads

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

IPN-ESCOM Application Development for Mobile Devices. Extraordinary. A Web service, invoking the SOAP protocol, in an Android application.


Tutorial: Setup for Android Development

Created By: Keith Acosta Instructor: Wei Zhong Courses: Senior Seminar Cryptography

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

Fragments. Lecture 11


Android Workshop: Model View Controller ( MVC):

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

Simple Currency Converter

Tutorial: Setup for Android Development

COMP61242: Task /04/18

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

Press project on the left toolbar if it doesn t show an overview of the app yet.

1 카메라 1.1 제어절차 1.2 관련주요메서드 1.3 제작철차 서피스뷰를생성하고이를제어하는서피스홀더객체를참조해야함. 매니페스트에퍼미션을지정해야한다.


Arrays of Buttons. Inside Android

LifeStreet Media Android Publisher SDK Integration Guide

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

Android/Java Lightning Tutorial JULY 30, 2018

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

Android UI Development

API Guide for Gesture Recognition Engine. Version 2.0

Vienos veiklos būsena. Theory

APPENDIX CODE TO STORE THE BUTTON MENU AND MOVE THE PAGE

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

Android Hide Title Bar Example. Android Screen Orientation Example

ELET4133: Embedded Systems. Topic 15 Sensors

Learn about Android Content Providers and SQLite

Data Persistence. Chapter 10

else if(rb2.ischecked()) {

Starting Another Activity Preferences

User Interface Development in Android Applications

Android Beginners Workshop

Workshop. 1. Create a simple Intent (Page 1 2) Launch a Camera for Photo Taking

Android JSON Parsing Tutorial

Group B: Assignment No 8. Title of Assignment: To verify the operating system name and version of Mobile devices.

Database Development In Android Applications

Time Picker trong Android

API Guide for Gesture Recognition Engine. Version 1.1

Notification mechanism

Q.1 Explain the dialog and also explain the Demonstrate working dialog in android.

An Overview of the Android Programming

android:layout_margintop="5dp" > <EditText android:layout_width="210dp"

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

Android CardView Tutorial

LAMPIRAN. byte bcdtodec(byte val) { return( (val/16*10) + (val%16) ); } void setup() {

Android Services. Victor Matos Cleveland State University. Services

Our First Android Application

LAMPIRAN PROGRAM. public class ListArrayAdapterPost extends ArrayAdapter<ModelDataPost> {

SMART VEHICLE TRACKING APPLICATION

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

Coding Menggunakan software Eclipse: Mainactivity.java (coding untuk tampilan login): package com.bella.pengontrol_otomatis;

Text Properties Data Validation Styles/Themes Material Design

EMBEDDED SYSTEMS PROGRAMMING Application Basics

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

ANDROID DEVELOPER FUNDAMENTALS (As per the New Syllabus of Mumbai University for S.Y.B.Sc. (Computer Science), Semester IV, )

Nadar Saraswathi College of Engineering and Technology, Nadar Saraswathi College of Engineering and Technology,

1.1 Why Foxit MobilePDF SDK is your choice Foxit MobilePDF SDK Key Features Evaluation License...

Android Apps Development for Mobile Game Lesson 5

Basic UI elements: Android Buttons (Basics) Marco Ronchetti Università degli Studi di Trento

Diving into Android. By Jeroen Tietema. Jeroen Tietema,

Introduction to Android Development

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

Android Layout Types

Transcription:

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

MainActivity.java File package com.example.tutorialspoint; import android.manifest; SMS CODE & EXAMPLE import android.content.pm.packagemanager; import android.os.bundle; import android.app.activity; import android.support.v4.app.activitycompat; import android.support.v4.content.contextcompat; import android.telephony.smsmanager; import android.util.log; import android.view.menu; import android.view.view; import android.widget.button; import android.widget.edittext; import android.widget.toast; public class MainActivity extends Activity { private static final int MY_PERMISSIONS_REQUEST_SEND_SMS =0 ; Button sendbtn; EditText txtphoneno; EditText txtmessage; String phoneno; String message; @Override

protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); sendbtn = (Button) findviewbyid(r.id.btnsendsms); txtphoneno = (EditText) findviewbyid(r.id.edittext); txtmessage = (EditText) findviewbyid(r.id.edittext2); sendbtn.setonclicklistener(new View.OnClickListener() { public void onclick(view view) { sendsmsmessage(); ); protected void sendsmsmessage() { phoneno = txtphoneno.gettext().tostring(); message = txtmessage.gettext().tostring(); if (ContextCompat.checkSelfPermission(this, Manifest.permission.SEND_SMS)!= PackageManager.PERMISSION_GRANTED) { if (ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.SEND_SMS)) { else { ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.SEND_SMS, MY_PERMISSIONS_REQUEST_SEND_SMS);

@Override public void onrequestpermissionsresult(int requestcode,string permissions[], int[] grantresults) { switch (requestcode) { case MY_PERMISSIONS_REQUEST_SEND_SMS: { if (grantresults.length > 0 && grantresults[0] == PackageManager.PERMISSION_GRANTED) { else { SmsManager smsmanager = SmsManager.getDefault(); smsmanager.sendtextmessage(phoneno, null, message, null, null); Toast.makeText(getApplicationContext(), "SMS sent.", Toast.LENGTH_LONG).show(); Toast.makeText(getApplicationContext(), "SMS faild, please try again.", Toast.LENGTH_LONG).show(); return; activity_main.xml file <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" 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="mainactivity"> <ImageButton android:id="@+id/imagebutton" android:src="@drawable/abc" android:layout_below="@+id/textview2" android:layout_centerhorizontal="true" /> <EditText android:id="@+id/edittext" android:hint="enter Phone Number" android:phonenumber="true" android:textcolorhint="@color/abc_primary_text_material_dark" android:layout_below="@+id/imagebutton" android:layout_centerhorizontal="true" /> <EditText android:id="@+id/edittext2"

android:layout_below="@+id/edittext" android:layout_alignleft="@+id/edittext" android:layout_alignstart="@+id/edittext" android:textcolorhint="@color/abc_primary_text_material_dark" android:layout_alignright="@+id/imagebutton" android:layout_alignend="@+id/imagebutton" android:hint="enter SMS" /> <Button android:text="send Sms" android:id="@+id/btnsendsms" android:layout_below="@+id/edittext2" android:layout_centerhorizontal="true" android:layout_margintop="48dp" /> </RelativeLayout> ANDROID CALL CODE MainActivity.java file package com.example.saira_000.myapplication; import android.manifest; import android.content.intent; import android.content.pm.packagemanager; import android.net.uri;

import android.os.bundle; import android.support.v4.app.activitycompat; import android.support.v7.app.appcompatactivity; import android.view.view; import android.widget.button; public class MainActivity extends AppCompatActivity { private Button button; @Override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); button = (Button) findviewbyid(r.id.buttoncall); button.setonclicklistener(new View.OnClickListener() { public void onclick(view arg0) {

Intent callintent = new Intent(Intent.ACTION_CALL); callintent.setdata(uri.parse("tel:0377778888")); if (ActivityCompat.checkSelfPermission(MainActivity.this, Manifest.permission.CALL_PHONE)!= PackageManager.PERMISSION_GRANTED) { return; startactivity(callintent); ); activity_main.xml file <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <Button android:id="@+id/buttoncall" android:text="call 0377778888" /> </LinearLayout> AndroidManifest.xml file <?xml version="1.0" encoding="utf-8"?>

<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.saira_000.myapplication" > <uses-permission android:name="android.permission.call_phone" /> <application android:allowbackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/apptheme" > <activity android:name="com.example.saira_000.myapplication.mainactivity" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> </intent-filter> </activity> </application> </manifest>