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

Size: px
Start display at page:

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

Transcription

1 60 LAMPIRAN 1. Source code Arduino. #include "Wire.h" #include <SoftwareSerial.h> #include <String.h> #define DS3231_I2C_ADDRESS 0x68 SoftwareSerial sim800l(11, 10); int dline[28]; byte *cacah=0; String stringpara = "AT+HTTPPARA=\"URL\",\" String stringend = "\""; String stringpara2 = ""; String bt = "&battery="; String en = "&engine_st="; String tr = "&transmission_st="; float fuel; float battery; String engine; String transmission; int power = 8; int start = 9; int pul = 3; int net = 2; byte bcdtodec(byte val) return( (val/16*10) + (val%16) ); void setup() Wire.begin(); sim800l.begin(19200); // the GPRS baud rate Serial.begin(19200); // the GPRS baud rate delay(500); pinmode(power,output); pinmode(start,output); pinmode(pul,output); pinmode(net,input); digitalwrite(power,high); delay (100); digitalwrite(start,high); delay (100);

2 61 cacah = 0; void readds3231time(byte *second, byte *minute, byte *hour, byte *dayofweek, byte *dayofmonth, byte *month, byte *year) Wire.beginTransmission(DS3231_I2C_ADDRESS); Wire.write(0); // set DS3231 register pointer to 00h Wire.endTransmission(); Wire.requestFrom(DS3231_I2C_ADDRESS, 7); // request seven bytes of data from DS3231 starting from register 00h *second = bcdtodec(wire.read() & 0x7f); *minute = bcdtodec(wire.read()); *hour = bcdtodec(wire.read() & 0x3f); *dayofweek = bcdtodec(wire.read()); *dayofmonth = bcdtodec(wire.read()); *month = bcdtodec(wire.read()); *year = bcdtodec(wire.read()); void SubmitHttpRequest() stringpara2 = stringpara + fuel + bt + battery + en + engine + tr + transmission + stringend; //Serial.println(stringPARA2); sim800l.println("at+csq"); // this code is to show the data from gprs shield, in order to easily see the process of how the gprs shield submit a http request, and the following is for this purpose too. sim800l.println("at+cgatt?"); sim800l.println("at+sapbr=3,1,\"contype\",\"gprs\""); the SAPBR, the connection type is using gprs //setting

3 62 sim800l.println("at+sapbr=3,1,\"apn\",\"internet\""); APN, the second need you fill in your local apn server //setting the sim800l.println("at+sapbr=1,1"); for detail you can refer to the AT command mamual delay(2000); sim800l.println("at+httpinit"); delay(2000); //setting the SAPBR, //init the HTTP request sim800l.println(stringpara2); // setting the httppara, the second parameter is the website you want to access sim800l.println("at+httpaction=0");//submit the request delay(3000); //the delay is very important, the delay time is base on the return from the website, if the return datas are very large, the time required longer. sim800l.println("at+httpread");// read the data from the website you access delay(300); checkforresponse(); sim800l.println("at+httpterm"); delay(100); void ShowSerialData() while(sim800l.available()!=0) Serial.write(sim800l.read()); void checkforresponse() sim800l.println("at+httpread");// read the data from the website you access delay(300);

4 63 // for (int i = 0; i < 50; i++) dline[i] = sim800l.read(); //Serial.println(dLine[i]); Serial.println(dLine[28]); if (dline[28]!= 97) SubmitHttpRequest(); void sensor() read_engine(); float Sensor1 = analogread(a1); // membaca sensor tegangan 1 delay (1000); Serial.println(Sensor1); fuel =( Sensor1) *1.85; if (fuel>100 fuel<0) fuel = 0; Serial.println(fuel); float Sensor2 = analogread(a2); // membaca sesor tegangan 2 delay (1000); battery = Sensor2 * (12.0 / 582.0); Serial.println(battery); digitalwrite(pul,high); delay(100); if ( digitalread(net) == HIGH) transmission = "ON GEAR"; else transmission = "NEUTRAL"; digitalwrite(pul,low); Serial.println(transmission); void read_engine() // puldown input neutral // membaca status transmisi

5 64 float val1 = analogread(a0); if (val1>10) engine = "ON"; else engine = "OFF"; Serial.println(engine); // membaca staus mesin void start_engine() digitalwrite(power,low); delay (4000); sensor(); if(fuel>31.45 && battery > 10 && transmission == "NEUTRAL" && engine == "OFF") cacah = 0; while (engine == "OFF" && cacah <3) digitalwrite (start,low); delay (500); digitalwrite (start,high); delay(2000); read_engine(); cacah++; if (engine == "ON") sensor(); SubmitHttpRequest(); delay (60000); digitalwrite (power,high); digitalwrite(power,low); delay (4000); sensor(); digitalwrite(power,high); SubmitHttpRequest();

6 65 else SubmitHttpRequest(); else SubmitHttpRequest(); void loop() byte second, minute, hour, dayofweek, dayofmonth, month, year; readds3231time(&second, &minute, &hour, &dayofweek, &dayofmonth, &month, &year); if (hour==07 && minute==00 && second == 00) start_engine(); digitalwrite(power,high); 2. Source code PHP a. input.ph <?php date_default_timezone_set("asia/jakarta"); $time = date("h:i:sa"); $date = date ("Y/m/d"); $server = "mysql.hostinger.in"; // host name $username = "u _bike"; // database username $password = "harpot"; // database password $dbname = "u _auto"; //database name // Create connection $conn = mysqli_connect($server, $username, $password, $dbname); // Check connection $sql = "INSERT INTO Minerva (fuel,battery, engine_st, transmission_st, time, date)

7 66 VALUES ('".$_GET['fuel']."','".$_GET['battery']."','".$_GET['engine_st']."','".$_GET ['transmission_st']."','$time','$date')"; echo "a"; mysqli_query($conn,$sql);?> b. Getdata.php <?php require_once('connect.php'); $sql = "SELECT * FROM Minerva ORDER BY number DESC LIMIT 1"; $r = mysqli_query($con,$sql); $res = mysqli_fetch_array($r); $result = array(); array_push($result,array( "battery"=>$res['battery'], "fuel"=>$res['fuel'], "engine_st"=>$res['engine_st'], "transmission_st"=>$res['transmission_st'], "date"=>$res['date'], "time"=>$res['time'])); echo json_encode(array("result"=>$result)); mysqli_close($con);?>

8 67 3. Source code Android a. Kelas MainActivity.java import android.widget.toast; import com.android.volley.requestqueue; import com.android.volley.response; import com.android.volley.volleyerror; import com.android.volley.toolbox.stringrequest; import com.android.volley.toolbox.volley; import org.json.jsonarray; import org.json.jsonexception; import org.json.jsonobject; public class MainActivity extends AppCompatActivity implements View.OnClickListener private Button buttonget; private TextView textviewresult; private ProgressDialog protected void oncreate(bundle savedinstancestate) super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); buttonget = (Button)findViewById(R.id.buttonGet); textviewresult = (TextView)findViewById(R.id.textViewResult); buttonget.setonclicklistener(this); private void getdata() loading = ProgressDialog.show(this, "Please wait...", "Fetching...", false, false); String url = Config.DATA_URL; StringRequest stringrequest = new StringRequest(url, new public void onresponse(string response) loading.dismiss(); showjson(response);, new

9 68 public void onerrorresponse(volleyerror error) Toast.makeText(MainActivity.this, error.getmessage().tostring(), Toast.LENGTH_LONG).show(); ); RequestQueue requestqueue = Volley.newRequestQueue(this); requestqueue.add(stringrequest); private void showjson(string response) String battery = ""; String fuel = ""; String engine_st = ""; String transmition_st = ""; String date = ""; String time = ""; try JSONObject jsonobject = new JSONObject(response); JSONArray result = jsonobject.getjsonarray(config.json_array); JSONObject bikedata = result.getjsonobject(0); battery = bikedata.getstring(config.key_battery); fuel = bikedata.getstring(config.key_fuel); engine_st = bikedata.getstring(config.key_engine_st); transmition_st = bikedata.getstring(config.key_transmition_st); date = bikedata.getstring(config.key_date); time = bikedata.getstring(config.key_time); catch (JSONException e) e.printstacktrace(); textviewresult.settext("battery:\t" + battery + "\nfuel:\t" + fuel + "\nengine_st:\t" + engine_st + "\ntransmission_st:\t" + transmition_st+ "\ndate:\t" + date+ "\ntime:\t" + public void onclick(view v)

10 69 getdata(); b. Kelas AndroidManifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android=" package="com.example.valgavin.bikeauto"> <uses-permission android:name="android.permission.internet"/> <application android:allowbackup="true" android:supportsrtl="true" <activity android:name=".mainactivity"> <intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> </intent-filter> </activity> </application> </manifest> c. Kelas Config.java package com.example.harry.bikeauto; /** * Created by Harry on 1/30/2017. */ public class Config public static final String DATA_URL = " public static final String KEY_BATTERY = "battery"; public static final String KEY_FUEL = "fuel"; public static final String KEY_ENGINE_ST = "engine_st"; public static final String KEY_TRANSMITION_ST = "transmition_st"; public static final String KEY_DATE = "date"; public static final String KEY_TIME = "time"; public static final String JSON_ARRAY = "result";

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

Tabel mysql. Kode di PHP. Config.php. Service.php Tabel mysql Kode di PHP Config.php Service.php Layout Kode di Main Activity package com.example.mini.webandroid; import android.app.progressdialog; import android.os.asynctask; import android.support.v7.app.appcompatactivity;

More information

Android - JSON Parser Tutorial

Android - JSON Parser Tutorial Android - JSON Parser Tutorial JSON stands for JavaScript Object Notation.It is an independent data exchange format and is the best alternative for XML. This chapter explains how to parse the JSON file

More information

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

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

More information

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

MAD ASSIGNMENT NO 3. Submitted by: Rehan Asghar BSSE AUGUST 25, SUBMITTED TO: SIR WAQAS ASGHAR Superior CS&IT Dept. 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;

More information

Getting Started With Android Feature Flags

Getting Started With Android Feature Flags Guide Getting Started With Android Feature Flags INTRO When it comes to getting started with feature flags (Android feature flags or just in general), you have to understand that there are degrees of feature

More information

EMBEDDED SYSTEMS PROGRAMMING Application Tip: Switching UIs

EMBEDDED SYSTEMS PROGRAMMING Application Tip: Switching UIs EMBEDDED SYSTEMS PROGRAMMING 2015-16 Application Tip: Switching UIs THE PROBLEM How to switch from one UI to another Each UI is associated with a distinct class that controls it Solution shown: two UIs,

More information

File: Unsaved Document 1 Page 1 of 7

File: Unsaved Document 1 Page 1 of 7 File: Unsaved Document 1 Page 1 of 7 /* Example 10.2 On/off timer tronixstuff.com/tutorials > Chapter 10 based on code by Maurice Ribble 17-4-2008 - http://www.glacialwanderer.com/hobbyrobotics and John

More information

Multiple Activities. Many apps have multiple activities

Multiple Activities. Many apps have multiple activities Intents Lecture 7 Multiple Activities Many apps have multiple activities An activity A can launch another activity B in response to an event The activity A can pass data to B The second activity B can

More information

EMBEDDED SYSTEMS PROGRAMMING Android Services

EMBEDDED SYSTEMS PROGRAMMING Android Services EMBEDDED SYSTEMS PROGRAMMING 2016-17 Android Services APP COMPONENTS Activity: a single screen with a user interface Broadcast receiver: responds to system-wide broadcast events. No user interface Service:

More information

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

Fragment Example Create the following files and test the application on emulator or device. Fragment Example Create the following files and test the application on emulator or device. File: AndroidManifest.xml

More information

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

Applied Cognitive Computing Fall 2016 Android Application + IBM Bluemix (Cloudant NoSQL DB) Applied Cognitive Computing Fall 2016 Android Application + IBM Bluemix (Cloudant NoSQL DB) In this exercise, we will create a simple Android application that uses IBM Bluemix Cloudant NoSQL DB. The application

More information

PENGEMBANGAN APLIKASI PERANGKAT BERGERAK (MOBILE)

PENGEMBANGAN APLIKASI PERANGKAT BERGERAK (MOBILE) PENGEMBANGAN APLIKASI PERANGKAT BERGERAK (MOBILE) Network Connection Web Service K Candra Brata andra.course@gmail.com Mobille App Lab 2015-2016 Network Connection http://developer.android.com/training/basics/network-ops/connecting.html

More information

Android JSON Parsing Tutorial

Android JSON Parsing Tutorial Android JSON Parsing Tutorial by Kapil - Thursday, May 19, 2016 http://www.androidtutorialpoint.com/networking/json-parsing-tutorial-android/ YouTube Video JSON(JavaScript Object Notation), is a language

More information

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

Software Practice 3 Before we start Today s lecture Today s Task Team organization 1 Software Practice 3 Before we start Today s lecture Today s Task Team organization Prof. Hwansoo Han T.A. Jeonghwan Park 43 2 Lecture Schedule Spring 2017 (Monday) This schedule can be changed M A R

More information

Introduction to Android Development

Introduction to Android Development Introduction to Android Development What is Android? Android is the customizable, easy to use operating system that powers more than a billion devices across the globe - from phones and tablets to watches,

More information

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

<uses-permission android:name=android.permission.internet/> Chapter 11 Playing Video 11.1 Introduction We have discussed how to play audio in Chapter 9 using the class MediaPlayer. This class can also play video clips. In fact, the Android multimedia framework

More information

LifeStreet Media Android Publisher SDK Integration Guide

LifeStreet Media Android Publisher SDK Integration Guide LifeStreet Media Android Publisher SDK Integration Guide Version 1.12.0 Copyright 2015 Lifestreet Corporation Contents Introduction... 3 Downloading the SDK... 3 Choose type of SDK... 3 Adding the LSM

More information

Android Application Development. By : Shibaji Debnath

Android Application Development. By : Shibaji Debnath Android Application Development By : Shibaji Debnath About Me I have over 10 years experience in IT Industry. I have started my career as Java Software Developer. I worked in various multinational company.

More information

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

IPN-ESCOM Application Development for Mobile Devices. Extraordinary. A Web service, invoking the SOAP protocol, in an Android application. Learning Unit Exam Project IPN-ESCOM Application Development for Mobile Devices. Extraordinary. A Web service, invoking the SOAP protocol, in an Android application. The delivery of this project is essential

More information

Android development. Outline. Android Studio. Setting up Android Studio. 1. Set up Android Studio. Tiberiu Vilcu. 2.

Android development. Outline. Android Studio. Setting up Android Studio. 1. Set up Android Studio. Tiberiu Vilcu. 2. Outline 1. Set up Android Studio Android development Tiberiu Vilcu Prepared for EECS 411 Sugih Jamin 15 September 2017 2. Create sample app 3. Add UI to see how the design interface works 4. Add some code

More information

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

Coding Menggunakan software Eclipse: Mainactivity.java (coding untuk tampilan login): package com.bella.pengontrol_otomatis; Coding Menggunakan software Eclipse: Mainactivity.java (coding untuk tampilan login): package com.bella.pengontrol_otomatis; import android.app.activity; import android.os.bundle; import android.os.countdowntimer;

More information

Mobile Development Lecture 9: Android & RESTFUL Services

Mobile Development Lecture 9: Android & RESTFUL Services Mobile Development Lecture 9: Android & RESTFUL Services Mahmoud El-Gayyar elgayyar@ci.suez.edu.eg Elgayyar.weebly.com What is a RESTFUL Web Service REST stands for REpresentational State Transfer. In

More information

... 1... 2... 2... 3... 3... 4... 4... 5... 5... 6... 6... 7... 8... 9... 10... 13... 14... 17 1 2 3 4 file.txt.exe file.txt file.jpg.exe file.mp3.exe 5 6 0x00 0xFF try { in.skip(9058); catch (IOException

More information

LAMPIRAN. public class MainActivity extends AppCompatActivity {

LAMPIRAN. public class MainActivity extends AppCompatActivity { LAMPIRAN 1. Coding MainActivity public class MainActivity extends AppCompatActivity { protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); this.requestwindowfeature(window.feature_no_title);

More information

Mobile Software Development for Android - I397

Mobile Software Development for Android - I397 1 Mobile Software Development for Android - I397 IT COLLEGE, ANDRES KÄVER, 2015-2016 EMAIL: AKAVER@ITCOLLEGE.EE WEB: HTTP://ENOS.ITCOLLEGE.EE/~AKAVER/2015-2016/DISTANCE/ANDROID SKYPE: AKAVER Timetable

More information

Android Volley Tutorial

Android Volley Tutorial Android Volley Tutorial by Kapil - Monday, May 16, 2016 http://www.androidtutorialpoint.com/networking/android-volley-tutorial/ YouTube Video Volley is an HTTP library developed by Google to ease networking

More information

Android Tutorial: Part 3

Android Tutorial: Part 3 Android Tutorial: Part 3 Adding Client TCP/IP software to the Rapid Prototype GUI Project 5.2 1 Step 1: Copying the TCP/IP Client Source Code Quit Android Studio Copy the entire Android Studio project

More information

Android/Java Lightning Tutorial JULY 30, 2018

Android/Java Lightning Tutorial JULY 30, 2018 Android/Java Lightning Tutorial JULY 30, 2018 Java Android uses java as primary language Resource : https://github.mit.edu/6178-2017/lec1 Online Tutorial : https://docs.oracle.com/javase/tutorial/java/nutsandbolts/inde

More information

EMBEDDED SYSTEMS PROGRAMMING Application Basics

EMBEDDED SYSTEMS PROGRAMMING Application Basics EMBEDDED SYSTEMS PROGRAMMING 2015-16 Application Basics APPLICATIONS Application components (e.g., UI elements) are objects instantiated from the platform s frameworks Applications are event driven ( there

More information

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

Produced by. Mobile Application Development. Higher Diploma in Science in Computer Science. Eamonn de Leastar Mobile Application Development Higher Diploma in Science in Computer Science Produced by Eamonn de Leastar (edeleastar@wit.ie) Department of Computing, Maths & Physics Waterford Institute of Technology

More information

SIM900A GSM/GPRS MODEM WITH PCB ANTENNA UART INTERFACE. [RKI-1644]

SIM900A GSM/GPRS MODEM WITH PCB ANTENNA UART INTERFACE. [RKI-1644] SIM900A GSM/GPRS MODEM WITH PCB ANTENNA UART INTERFACE. [RKI-1644] USER MANUAL ROBOKITS INDIA (www.robokits.co.in) http://www.robokitsworld.com Page 1 Description: The GSM/GPRS Modem uses SIM900A based

More information

Appendix A : Android Studio Code For Android

Appendix A : Android Studio Code For Android Appendix A : Android Studio Code For Android Monitoring : ` public Pubnub pubnub; public static final String PUBLISH_KEY = "pub-c-798bd0f6-540b-48af-9e98-7d0028a5132a"; public static final String SUBSCRIBE_KEY

More information

SMAATSDK. NFC MODULE ON ANDROID REQUIREMENTS AND DOCUMENTATION RELEASE v1.0

SMAATSDK. NFC MODULE ON ANDROID REQUIREMENTS AND DOCUMENTATION RELEASE v1.0 SMAATSDK NFC MODULE ON ANDROID REQUIREMENTS AND DOCUMENTATION RELEASE v1.0 NFC Module on Android Requirements and Documentation Table of contents Scope...3 Purpose...3 General operating diagram...3 Functions

More information

PROGRAMMING APPLICATIONS DECLARATIVE GUIS

PROGRAMMING APPLICATIONS DECLARATIVE GUIS PROGRAMMING APPLICATIONS DECLARATIVE GUIS DIVING RIGHT IN Eclipse? Plugin deprecated :-( Making a new project This keeps things simple or clone or clone or clone or clone or clone or clone Try it

More information

COMP61242: Task /04/18

COMP61242: Task /04/18 COMP61242: Task 2 1 16/04/18 1. Introduction University of Manchester School of Computer Science COMP61242: Mobile Communications Semester 2: 2017-18 Laboratory Task 2 Messaging with Android Smartphones

More information

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

Produced by. Mobile Application Development. Higher Diploma in Science in Computer Science. Eamonn de Leastar Mobile Application Development Higher Diploma in Science in Computer Science Produced by Eamonn de Leastar (edeleastar@wit.ie) Department of Computing, Maths & Physics Waterford Institute of Technology

More information

ANDROID PROGRAMS DAY 3

ANDROID PROGRAMS DAY 3 ANDROID PROGRAMS DAY 3 //Android project to navigate from first page to second page using Intent Step 1: Create a new project Step 2: Enter necessary details while creating project. Step 3: Drag and drop

More information

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

Mobile Application Development Lab [] Simple Android Application for Native Calculator. To develop a Simple Android Application for Native Calculator. Simple Android Application for Native Calculator Aim: To develop a Simple Android Application for Native Calculator. Procedure: Creating a New project: Open Android Stdio and then click on File -> New

More information

A Crash Course to Android Mobile Platform

A Crash Course to Android Mobile Platform Enterprise Application Development using J2EE Shmulik London Lecture #2 A Crash Course to Android Mobile Platform Enterprise Application Development Using J2EE / Shmulik London 2004 Interdisciplinary Center

More information

Brain Corporate Bulk SMS

Brain Corporate Bulk SMS Brain Corporate Bulk SMS W e S i m p l y D e l i v e r! API Documentation V.2.0 F e b r u a r y 2 0 1 9 2 Table of Contents Sending a Quick Message... 3 API Description... 3 Request Parameter... 4 API

More information

Intents. Your first app assignment

Intents. Your first app assignment Intents Your first app assignment We will make this. Decidedly lackluster. Java Code Java Code XML XML Preview XML Java Code Java Code XML Buttons that work

More information

Mobile Application Development

Mobile Application Development Mobile Application Development donation-web api { method: 'GET', path: '/api/candidates', config: CandidatesApi.find, { method: 'GET', path: '/api/candidates/{id', config: CandidatesApi.findOne, { method:

More information

Manifest.xml. Activity.java

Manifest.xml. Activity.java Dr.K.Somasundaram Ph.D Professor Department of Computer Science and Applications Gandhigram Rural Institute, Gandhigram, Tamil Nadu-624302, India ka.somasundaram@gmail.com Manifest.xml

More information

Basic GUI elements - exercises

Basic GUI elements - exercises Basic GUI elements - exercises https://developer.android.com/studio/index.html LIVE DEMO Please create a simple application, which will be used to calculate the area of basic geometric figures. To add

More information

Android UI Development

Android UI Development Android UI Development Android UI Studio Widget Layout Android UI 1 Building Applications A typical application will include: Activities - MainActivity as your entry point - Possibly other activities (corresponding

More information

2.2 IoT Internet of Things Android Studio

2.2 IoT Internet of Things Android Studio Sana 1 1... 3 1.1... 3 1.2... 4 2... 5 2.1... 5 2.2 IoT Internet of Things... 5 2.3... 5 2.4... 6 2.5 IoT a cfr... 6... 7 3.1... 7 3.2... 8 3.3 LAN... 10 4... 11 4.1 Android Studio... 11 4.2... 11 4.3

More information

Android Programs Day 5

Android Programs Day 5 Android Programs Day 5 //Android Program to demonstrate the working of Options Menu. 1. Create a New Project. 2. Write the necessary codes in the MainActivity.java to create OptionMenu. 3. Add the oncreateoptionsmenu()

More information

Arrays of Buttons. Inside Android

Arrays of Buttons. Inside Android Arrays of Buttons Inside Android The Complete Code Listing. Be careful about cutting and pasting.

More information

API Guide for Gesture Recognition Engine. Version 2.0

API Guide for Gesture Recognition Engine. Version 2.0 API Guide for Gesture Recognition Engine Version 2.0 Table of Contents Gesture Recognition API... 3 API URI... 3 Communication Protocol... 3 Getting Started... 4 Protobuf... 4 WebSocket Library... 4 Project

More information

Learn about Android Content Providers and SQLite

Learn about Android Content Providers and SQLite Tampa Bay Android Developers Group Learn about Android Content Providers and SQLite Scott A. Thisse March 20, 2012 Learn about Android Content Providers and SQLite What are they? How are they defined?

More information

Android - Widgets Tutorial

Android - Widgets Tutorial Android - Widgets Tutorial A widget is a small gadget or control of your android application placed on the home screen. Widgets can be very handy as they allow you to put your favourite applications on

More information

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

Android Apps Development for Mobile and Tablet Device (Level I) Lesson 2 Workshop 1. Compare different layout by using Change Layout button (Page 1 5) Relative Layout Linear Layout (Horizontal) Linear Layout (Vertical) Frame Layout 2. Revision on basic programming skill - control

More information

Software Practice 3 Today s lecture Today s Task Porting Android App. in real device

Software Practice 3 Today s lecture Today s Task Porting Android App. in real device 1 Software Practice 3 Today s lecture Today s Task Porting Android App. in real device Prof. Hwansoo Han T.A. Jeonghwan Park 43 INTENT 2 3 Android Intent An abstract description of a message Request actions

More information

INTRODUCTION TO ANDROID

INTRODUCTION TO ANDROID INTRODUCTION TO ANDROID 1 Niv Voskoboynik Ben-Gurion University Electrical and Computer Engineering Advanced computer lab 2015 2 Contents Introduction Prior learning Download and install Thread Android

More information

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

Android Apps Development for Mobile and Tablet Device (Level I) Lesson 4. Workshop Workshop 1. Create an Option Menu, and convert it into Action Bar (Page 1 8) Create an simple Option Menu Convert Option Menu into Action Bar Create Event Listener for Menu and Action Bar Add System Icon

More information

EMBEDDED SYSTEMS PROGRAMMING Android NDK

EMBEDDED SYSTEMS PROGRAMMING Android NDK EMBEDDED SYSTEMS PROGRAMMING 2015-16 Android NDK WHAT IS THE NDK? The Android NDK is a set of cross-compilers, scripts and libraries that allows to embed native code into Android applications Native code

More information

REMOTE ACCESS TO ANDROID DEVICES. A Project. Presented to the faculty of the Department of Computer Science. California State University, Sacramento

REMOTE ACCESS TO ANDROID DEVICES. A Project. Presented to the faculty of the Department of Computer Science. California State University, Sacramento REMOTE ACCESS TO ANDROID DEVICES A Project Presented to the faculty of the Department of Computer Science California State University, Sacramento Submitted in partial satisfaction of the requirements for

More information

Wireless Vehicle Bus Adapter (WVA) Android Library Tutorial

Wireless Vehicle Bus Adapter (WVA) Android Library Tutorial Wireless Vehicle Bus Adapter (WVA) Android Library Tutorial Revision history 90001431-13 Revision Date Description A October 2014 Original release. B October 2017 Rebranded the document. Edited the document.

More information

Mobile Programming Practice Background processing AsynTask Service Broadcast receiver Lab #5

Mobile Programming Practice Background processing AsynTask Service Broadcast receiver Lab #5 1 Mobile Programming Practice Background processing AsynTask Service Broadcast receiver Lab #5 Prof. Hwansoo Han T.A. Sung-in Hong T.A. Minseop Jeong 2 Background processing Every Android app has a main

More information

Software Practice 3 Today s lecture Today s Task

Software Practice 3 Today s lecture Today s Task 1 Software Practice 3 Today s lecture Today s Task Prof. Hwansoo Han T.A. Jeonghwan Park 43 FILE I/O IN ANDROID 2 3 Android And Linux Android is implemented on Linux OS Also Android filesystem is exactly

More information

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

1 카메라 1.1 제어절차 1.2 관련주요메서드 1.3 제작철차 서피스뷰를생성하고이를제어하는서피스홀더객체를참조해야함. 매니페스트에퍼미션을지정해야한다. 1 카메라 1.1 제어절차 서피스뷰를생성하고이를제어하는서피스홀더객체를참조해야함. 매니페스트에퍼미션을지정해야한다. 1.2 관련주요메서드 setpreviewdisplay() : startpreview() : stoppreview(); onpicturetaken() : 사진을찍을때자동으로호출되며캡처한이미지가전달됨 1.3 제작철차 Step 1 프로젝트를생성한후매니페스트에퍼미션들을설정한다.

More information

Diving into Android. By Jeroen Tietema. Jeroen Tietema,

Diving into Android. By Jeroen Tietema. Jeroen Tietema, Diving into Android By Jeroen Tietema Jeroen Tietema, 2015 1 Requirements 4 Android SDK 1 4 Android Studio (or your IDE / editor of choice) 4 Emulator (Genymotion) or a real device. 1 See https://developer.android.com

More information

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

ITU- FAO- DOA- TRCSL. Training on. Innovation & Application Development for E- Agriculture. Shared Preferences ITU- FAO- DOA- TRCSL Training on Innovation & Application Development for E- Agriculture Shared Preferences 11 th - 15 th December 2017 Peradeniya, Sri Lanka Shahryar Khan & Imran Tanveer, ITU Experts

More information

Starting Another Activity Preferences

Starting Another Activity Preferences Starting Another Activity Preferences Android Application Development Training Xorsat Pvt. Ltd www.xorsat.net fb.com/xorsat.education Outline Starting Another Activity Respond to the Button Create the

More information

Android permissions Defining and using permissions Component permissions and related APIs

Android permissions Defining and using permissions Component permissions and related APIs Android permissions Defining and using permissions Component permissions and related APIs Permissions protects resources and data For instance, they limit access to: User information e.g, Contacts Cost-sensitive

More information

Android Workshop: Model View Controller ( MVC):

Android Workshop: Model View Controller ( MVC): Android Workshop: Android Details: Android is framework that provides java programmers the ability to control different aspects of smart devices. This interaction happens through the Android SDK (Software

More information

M.A.D Assignment # 1

M.A.D Assignment # 1 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

More information

E-Blocks wifi controlled by an Android device

E-Blocks wifi controlled by an Android device E-Blocks wifi controlled by an Android device Benoit Pierret benoit.pierret@insa-lyon.fr Nicolas Stouls nicolas.stouls@insa-lyon.fr Yann Ricotti yann.ricotti@insa-lyon.fr Architecture This solution is

More information

An Overview of the Android Programming

An Overview of the Android Programming ID2212 Network Programming with Java Lecture 14 An Overview of the Android Programming Hooman Peiro Sajjad KTH/ICT/SCS HT 2016 References http://developer.android.com/training/index.html Developing Android

More information

MVC Apps Basic Widget Lifecycle Logging Debugging Dialogs

MVC Apps Basic Widget Lifecycle Logging Debugging Dialogs Overview MVC Apps Basic Widget Lifecycle Logging Debugging Dialogs Lecture: MVC Model View Controller What is an App? Android Activity Lifecycle Android Debugging Fixing Rotations & Landscape Layouts Localization

More information

MAD ASSIGNMENT NO 2. 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. MAD ASSIGNMENT NO 2 Submitted by: Rehan Asghar BSSE 7 15126 AUGUST 25, 2017 SUBMITTED TO: SIR WAQAS ASGHAR Superior CS&IT Dept. Android Widgets There are given a lot of android widgets with simplified

More information

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

Getting Started. Dr. Miguel A. Labrador Department of Computer Science & Engineering Getting Started Dr. Miguel A. Labrador Department of Computer Science & Engineering labrador@csee.usf.edu http://www.csee.usf.edu/~labrador 1 Goals Setting up your development environment Android Framework

More information

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

CSE 660 Lab 3 Khoi Pham Thanh Ho April 19 th, 2015 CSE 660 Lab 3 Khoi Pham Thanh Ho April 19 th, 2015 Comment and Evaluation: This lab introduces us about Android SDK and how to write a program for Android platform. The calculator is pretty easy, everything

More information

Notification mechanism

Notification mechanism Notification mechanism Adaptation of materials: dr Tomasz Xięski. Based on presentations made available by Victor Matos, Cleveland State University. Portions of this page are reproduced from work created

More information

Android Application Model I. CSE 5236: Mobile Application Development Instructor: Adam C. Champion, Ph.D. Course Coordinator: Dr.

Android Application Model I. CSE 5236: Mobile Application Development Instructor: Adam C. Champion, Ph.D. Course Coordinator: Dr. Android Application Model I CSE 5236: Mobile Application Development Instructor: Adam C. Champion, Ph.D. Course Coordinator: Dr. Rajiv Ramnath 1 Framework Support (e.g. Android) 2 Framework Capabilities

More information

Android Service. Lecture 19

Android Service. Lecture 19 Android Service Lecture 19 Services Service: A background task used by an app. Example: Google Play Music plays the music using a service Example: Web browser runs a downloader service to retrieve a file

More information

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

Created By: Keith Acosta Instructor: Wei Zhong Courses: Senior Seminar Cryptography Created By: Keith Acosta Instructor: Wei Zhong Courses: Senior Seminar Cryptography 1. Thread Summery 2. Thread creation 3. App Diagram and information flow 4. General flow of Diffie-Hellman 5. Steps of

More information

API Guide for Gesture Recognition Engine. Version 1.1

API Guide for Gesture Recognition Engine. Version 1.1 API Guide for Gesture Recognition Engine Version 1.1 Table of Contents Table of Contents... 2 Gesture Recognition API... 3 API URI... 3 Communication Protocol... 3 Getting Started... 4 Protobuf... 4 WebSocket

More information

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

Produced by. Mobile Application Development. Higher Diploma in Science in Computer Science. Eamonn de Leastar Mobile Application Development Higher Diploma in Science in Computer Science Produced by Eamonn de Leastar (edeleastar@wit.ie) Department of Computing, Maths & Physics Waterford Institute of Technology

More information

Android Application Model I

Android Application Model I Android Application Model I CSE 5236: Mobile Application Development Instructor: Adam C. Champion, Ph.D. Course Coordinator: Dr. Rajiv Ramnath Reading: Big Nerd Ranch Guide, Chapters 3, 5 (Activities);

More information

CS 193A. Multiple Activities and Intents

CS 193A. Multiple Activities and Intents CS 193A Multiple Activities and Intents This document is copyright (C) Marty Stepp and Stanford Computer Science. Licensed under Creative Commons Attribution 2.5 License. All rights reserved. Multiple

More information

EMBEDDED SYSTEMS PROGRAMMING Application Tip: Managing Screen Orientation

EMBEDDED SYSTEMS PROGRAMMING Application Tip: Managing Screen Orientation EMBEDDED SYSTEMS PROGRAMMING 2016-17 Application Tip: Managing Screen Orientation ORIENTATIONS Portrait Landscape Reverse portrait Reverse landscape ON REVERSE PORTRAIT Android: all four orientations are

More information

Simple Currency Converter

Simple Currency Converter Simple Currency Converter Implementing a simple currency converter: USD Euro Colon (CR) Note. Naive implementation using the rates 1 Costa Rican Colon = 0.001736 U.S. dollars 1 Euro = 1.39900 U.S. dollars

More information

shared objects monitors run() Runnable start()

shared objects monitors run() Runnable start() Thread Lecture 18 Threads A thread is a smallest unit of execution Each thread has its own call stack for methods being invoked, their arguments and local variables. Each virtual machine instance has at

More information

Data Persistence. Chapter 10

Data Persistence. Chapter 10 Chapter 10 Data Persistence When applications create or capture data from user inputs, those data will only be available during the lifetime of the application. You only have access to that data as long

More information

Understand applications and their components. activity service broadcast receiver content provider intent AndroidManifest.xml

Understand applications and their components. activity service broadcast receiver content provider intent AndroidManifest.xml Understand applications and their components activity service broadcast receiver content provider intent AndroidManifest.xml Android Application Written in Java (it s possible to write native code) Good

More information

Declaration Cover Sheet for Project Submission

Declaration Cover Sheet for Project Submission Declaration Cover Sheet for Project Submission SECTION 1 Student to complete Name: Sam Gormley Student ID: x12467312 Supervisor: Arghir Moldovan SECTION 2 Confirmation of Authorship The acceptance of your

More information

Android Beginners Workshop

Android Beginners Workshop Android Beginners Workshop at the M O B IL E M O N D AY m 2 d 2 D E V E L O P E R D A Y February, 23 th 2010 Sven Woltmann, AndroidPIT Sven Woltmann Studied Computer Science at the TU Ilmenau, 1994-1999

More information

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

M.A.D ASSIGNMENT # 2 REHAN ASGHAR BSSE 15126 M.A.D ASSIGNMENT # 2 REHAN ASGHAR BSSE 15126 Submitted to: Sir Waqas Asghar MAY 23, 2017 SUBMITTED BY: REHAN ASGHAR Intent in Android What are Intent? An Intent is a messaging object you can use to request

More information

Dynamically Create Admob Banner and Interstitial Ads

Dynamically Create Admob Banner and Interstitial Ads Dynamically Create Admob Banner and Interstitial Ads activity_main.xml file 0 0 0

More information

Services. Marco Ronchetti Università degli Studi di Trento

Services. Marco Ronchetti Università degli Studi di Trento 1 Services Marco Ronchetti Università degli Studi di Trento Service An application component that can perform longrunning operations in the background and does not provide a user interface. So, what s

More information

RS422/RS485 Shield. Application Note: Multiple RS485 busses. 1 Introduction

RS422/RS485 Shield. Application Note: Multiple RS485 busses. 1 Introduction 1 Introduction This application note will show you how to connect up to 3 independent RS485 busses to one Arduino. This can be useful if you want to create a gateway between these busses or if you want

More information

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

Screen Slides. The Android Studio wizard adds a TextView to the fragment1.xml layout file and the necessary code to Fragment1.java. Screen Slides References https://developer.android.com/training/animation/screen-slide.html https://developer.android.com/guide/components/fragments.html Overview A fragment can be defined by a class and

More information

Outline. Admin. Example: TipCalc. Android: Event Handler Blocking, Android Inter-Thread, Process Communications. Recap: Android UI App Basic Concepts

Outline. Admin. Example: TipCalc. Android: Event Handler Blocking, Android Inter-Thread, Process Communications. Recap: Android UI App Basic Concepts Outline Android: Event Handler Blocking, Android Inter-Thread, Process Communications 10/11/2012 Admin Android Basic concepts Activity, View, External Resources, Listener Inter-thread communications Handler,

More information

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

@Bind(R.id.input_ ) EditText EditText Button _loginbutton; package cyborg.pantaucctv; import android.app.progressdialog; import android.content.intent; import android.os.bundle; import android.support.v7.app.appcompatactivity; import android.util.log; import android.view.view;

More information

Mobile Development Lecture 8: Intents and Animation

Mobile Development Lecture 8: Intents and Animation Mobile Development Lecture 8: Intents and Animation Mahmoud El-Gayyar elgayyar@ci.suez.edu.eg Elgayyar.weebly.com 1. Multiple Activities Intents Multiple Activities Many apps have multiple activities.

More information

Accelerating Information Technology Innovation

Accelerating Information Technology Innovation Accelerating Information Technology Innovation http://aiti.mit.edu India Summer 2012 Review Session Android and Web Working with Views Working with Views Create a new Android project. The app name should

More information

Android Exam AND-401 Android Application Development Version: 7.0 [ Total Questions: 129 ]

Android Exam AND-401 Android Application Development Version: 7.0 [ Total Questions: 129 ] s@lm@n Android Exam AND-401 Android Application Development Version: 7.0 [ Total Questions: 129 ] Android AND-401 : Practice Test Question No : 1 Which of the following is required to allow the Android

More information

Assignment 1. Start: 28 September 2015 End: 9 October Task Points Total 10

Assignment 1. Start: 28 September 2015 End: 9 October Task Points Total 10 Assignment 1 Start: 28 September 2015 End: 9 October 2015 Objectives The goal of this assignment is to familiarize yourself with the Android development process, to think about user interface design, and

More information