APPENDIX CODE TO STORE THE BUTTON MENU AND MOVE THE PAGE
|
|
- Diane Mills
- 6 years ago
- Views:
Transcription
1 APPENDIX FILE MainActivity.java CODE TO STORE THE BUTTON MENU AND MOVE THE PAGE package com.ste.sembakoapp; import Android.content.Intent; import Android.support.v7.app.AppCompatActivity; import Android.os.Bundle; import Android.view.View; import Android.widget.Button; public class MainActivity extends AppCompatActivity { private Button btn1,btn2,btn3; protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); btn1 = (Button) findviewbyid(r.id.menu1); btn2 = (Button) findviewbyid(r.id.menu2); btn3 = (Button) findviewbyid(r.id.menu3); btn1.setonclicklistener(new View.OnClickListener() { public void onclick(view v) { startactivity(new Intent(MainActivity.this, display.class)); ); btn2.setonclicklistener(new View.OnClickListener() { public void onclick(view v) { startactivity(new Intent(MainActivity.this, DetailActivity.class)); ); btn3.setonclicklistener(new View.OnClickListener() { public void onclick(view v) { startactivity(new Intent(MainActivity.this, AboutActivity.class)); ); A
2 FILE Display.java CODE TO TAKE DATA ON MINISTRY OF TRADE WEBSITE AND DISPLAY ALL PRICES package com.ste.sembakoapp; import Android.support.v7.app.AppCompatActivity; import Android.os.Bundle; import Android.view.View; import Android.widget.ArrayAdapter; import Android.widget.Button; import Android.widget.Spinner; import Android.widget.TextView; import org.jsoup.jsoup; import org.jsoup.nodes.document; import org.jsoup.nodes.element; import org.jsoup.select.elements; import java.io.ioexception; public class display extends AppCompatActivity { private Button getbtn; private TextView result; private Spinner spinner,spinner2; protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_display); result = (TextView) findviewbyid(r.id.result); getbtn = (Button) findviewbyid(r.id.getbtn); spinner = (Spinner) findviewbyid(r.id.tahun_spinner); ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this, R.array.tahun_array, Android.R.layout.simple_spinner_item); adapter.setdropdownviewresource(android.r.layout.simple_spinner_d ropdown_item); spinner.setadapter(adapter); spinner2 = (Spinner) findviewbyid(r.id.bulan_spinner); ArrayAdapter<CharSequence> adapter2 = ArrayAdapter.createFromResource(this, R.array.bulan_array, Android.R.layout.simple_spinner_item); adapter2.setdropdownviewresource(android.r.layout.simple_spinner_ dropdown_item); spinner2.setadapter(adapter2); getbtn.setonclicklistener(new View.OnClickListener() { public void onclick(view v) { final StringBuilder url = new StringBuilder(); final StringBuilder period = new StringBuilder(); String tahun = spinner.getselecteditem().tostring(); B
3 int bulan_pos = spinner2.getselecteditemposition(); String bulan = String.valueOf(bulan_pos+1); String str_bulan = spinner2.getselecteditem().tostring(); String URL = url.append(" year=").append(tahun).append("&month=").append(bulan).tostring(); String periode = period.append(str_bulan).append("-").append(tahun).tostring(); getwebsite(url,periode); ); private void getwebsite(final String URL, final String periode){ new Thread(new Runnable() { public void run() { final StringBuilder builder = new StringBuilder(); try { Document doc = Jsoup.connect(URL).get(); Element table = doc.select("table").get(0); Elements rows = table.select("tr"); Element row_tanggal = rows.get(1); Elements tgl = row_tanggal.select("th"); int[] tanggal = new int[tgl.size()]; for (int j=0; j<tgl.size(); j++){ String gettgl=tgl.get(j).text(); tanggal[j]=integer.parseint(gettgl); builder.append("\n"); LinkedListImpl listdata = new LinkedListImpl(); for(int i=2; i<rows.size(); i++){ Element row = rows.get(i); Elements cols = row.select("td"); String nama = cols.get(1).text(); int numofharga= cols.size()-3; float[] arrharga = new float[numofharga]; int idx=0; for (int k=3; k<cols.size(); k++){ String harga = cols.get(k).text(); String harga_rep = harga.replaceall("[^a-za-z0-9]",""); float c = 0; if (!harga_rep.equals("")){ c = Float.parseFloat(harga_rep); else { c = 0; arrharga[idx]=c; idx++; C
4 tanggal); node node = new node(nama, arrharga, listdata.addlast(node); Statistic stat = new Statistic(); node pointer = listdata.gethead(); while (pointer!= null) { builder.append("name : ").append(pointer.getnama()).append("\n"); builder.append("period : ").append(periode).append("\n"); builder.append("prices").append("\n"); float[] h = pointer.getharga(); int[] t = pointer.gettanggal(); for(int a=0; a<h.length; a++){ builder.append("date : ").append(t[a]); if (t[a] < 10){ builder.append(" "); else{ builder.append(" "); builder.append("price : ").append(h[a]).append("\n"); builder.append("\n"); builder.append("statistics").append("\n"); float meanval = stat.mean(h); double medval = stat.median(h); float modeval = stat.mode(h); builder.append("mean = ").append(meanval).append("\n"); builder.append("median = ").append(medval).append("\n"); builder.append("mode = ").append(modeval).append("\n"); pointer = pointer.getnext(); builder.append("\n").append("\n"); catch (IOException e) { builder.append("error :").append(e.getmessage()).append("\n"); runonuithread(new Runnable() { D
5 ); ).start(); public void run() { result.settext(builder.tostring()); FILE DetailActivity.java CODE TO DISPLAY THE DATA BASIC COMMODITIES ACCORDANCE WITH ITEMS SELECTED AND DISPLAY THE GRAPH OF STATISTICAL CALCULATIONS package com.ste.sembakoapp; import Android.graphics.Color; import Android.os.Bundle; import Android.support.v7.app.AppCompatActivity; import Android.view.View; import Android.widget.ArrayAdapter; import Android.widget.Button; import Android.widget.Spinner; import Android.widget.TextView; import Android.widget.Toast; import com.jjoe64.graphview.graphview; import com.jjoe64.graphview.gridlabelrenderer; import com.jjoe64.graphview.legendrenderer; import com.jjoe64.graphview.series.datapoint; import com.jjoe64.graphview.series.datapointinterface; import com.jjoe64.graphview.series.linegraphseries; import com.jjoe64.graphview.series.ondatapointtaplistener; import com.jjoe64.graphview.series.series; import org.jsoup.jsoup; import org.jsoup.nodes.document; import org.jsoup.nodes.element; import org.jsoup.select.elements; import java.io.ioexception; import java.util.random; public class DetailActivity extends AppCompatActivity { private Button getbtn; private TextView result; private Spinner spinner,spinner2,spinner3; private LineGraphSeries<DataPoint> mseries1; protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_detail); result = (TextView) findviewbyid(r.id.result); getbtn = (Button) findviewbyid(r.id.getbtn); E
6 spinner = (Spinner) findviewbyid(r.id.tahun_spinner); ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this, R.array.tahun_array, Android.R.layout.simple_spinner_item); adapter.setdropdownviewresource(android.r.layout.simple_spinner_d ropdown_item); spinner.setadapter(adapter); spinner2 = (Spinner) findviewbyid(r.id.bulan_spinner); ArrayAdapter<CharSequence> adapter2 = ArrayAdapter.createFromResource(this, R.array.bulan_array, Android.R.layout.simple_spinner_item); adapter2.setdropdownviewresource(android.r.layout.simple_spinner_ dropdown_item); spinner2.setadapter(adapter2); spinner3 = (Spinner) findviewbyid(r.id.item_spinner); ArrayAdapter<CharSequence> adapter3 = ArrayAdapter.createFromResource(this, R.array.item_array, Android.R.layout.simple_spinner_dropdown_item); adapter3.setdropdownviewresource(android.r.layout.simple_spinner_ dropdown_item); spinner3.setadapter(adapter3); getbtn.setonclicklistener(new View.OnClickListener() { public void onclick(view v) { final StringBuilder url = new StringBuilder(); final StringBuilder period = new StringBuilder(); String tahun = spinner.getselecteditem().tostring(); int bulan_pos = spinner2.getselecteditemposition(); int item_pos = spinner3.getselecteditemposition(); String item_name = spinner3.getselecteditem().tostring(); String bulan = String.valueOf(bulan_pos+1); String str_bulan = spinner2.getselecteditem().tostring(); String URL = url.append(" year=").append(tahun).append("&month=").append(bulan).tostring(); String periode = period.append(str_bulan).append("-").append(tahun).tostring(); ); getwebsite(url,periode,item_pos, item_name); F
7 private void getwebsite(final String URL, final String periode, final int item_position, final String item_name){ new Thread(new Runnable() { public void run() { final StringBuilder builder = new StringBuilder(); try { Document doc = Jsoup.connect(URL).get(); Element table = doc.select("table").get(0); Elements rows = table.select("tr"); Element row_tanggal = rows.get(1); Elements tgl = row_tanggal.select("th"); int[] tanggal = new int[tgl.size()]; for (int j=0; j<tgl.size(); j++){ String gettgl=tgl.get(j).text(); tanggal[j]=integer.parseint(gettgl); LinkedListImpl listdata = new LinkedListImpl(); for(int i=2; i<rows.size(); i++){ Element row = rows.get(i); Elements cols = row.select("td"); String nama = cols.get(1).text(); int numofharga= cols.size()-3; float[] arrharga = new float[numofharga]; int idx=0; for (int k=3; k<cols.size(); k++){ String harga = cols.get(k).text(); String harga_rep = harga.replaceall("[^a-za-z0-9]",""); float c = 0; if (!harga_rep.equals("")){ c = Float.parseFloat(harga_rep); else { c = 0; arrharga[idx]=c; idx++; tanggal); node node = new node(nama, arrharga, listdata.addlast(node); Statistic stat = new Statistic(); node pointer = listdata.get(item_position); builder.append("name : ").append(item_name).append("\n"); builder.append("period : ").append(periode).append("\n"); G
8 builder.append("prices").append("\n"); float[] h = pointer.getharga(); int[] t = pointer.gettanggal(); DataPoint[] values = new DataPoint[h.length]; for(int a=0; a<h.length; a++){ int x = t[a]; float y = h[a]; DataPoint v = new DataPoint(x, y); values[a] = v; builder.append("date : ").append(t[a]); if (t[a] < 10){ builder.append(" "); else{ builder.append(" "); builder.append("price : ").append(h[a]).append("\n"); Random rand = new Random(); int r = rand.nextint(255); int g = rand.nextint(255); int b = rand.nextint(255); int randomcolor = Color.rgb(r,g,b); mseries1 = new LineGraphSeries<>(values); mseries1.settitle(item_name); mseries1.setcolor(randomcolor); mseries1.setondatapointtaplistener(new OnDataPointTapListener() { public void ontap(series series, DataPointInterface datapoint) { Toast.makeText(DetailActivity.this, "Price : "+datapoint, Toast.LENGTH_SHORT).shown(); ); builder.append("\n"); builder.append("statistics").append("\n"); float meanval = stat.mean(h); double medval = stat.median(h); float modeval = stat.mode(h); builder.append("mean = ").append(meanval).append("\n"); builder.append("median = ").append(medval).append("\n"); builder.append("mode = ").append(modeval).append("\n \n"); builder.append("graph Data").append("\n"); catch (IOException e) { builder.append("error :").append(e.getmessage()).a ppend("\n"); H
9 runonuithread(new Runnable() { public void run() { result.settext(builder.tostring()); GraphView graph = (GraphView) findviewbyid(r.id.graph); GridLabelRenderer gridlabel = graph.getgridlabelrenderer(); gridlabel.sethorizontalaxistitle("dates : "+periode); gridlabel.setverticalaxistitle("prices (Rupiah)"); graph.addseries(mseries1); graph.getviewport().setxaxisboundsmanual(true); graph.getlegendrenderer().setvisible(true); graph.getlegendrenderer().setalign(legendrenderer.legendalign.top) ; graph.getviewport().setscalable(true); graph.getviewport().setscrollabley(true); graph.getviewport().setscalable(true); graph.getviewport().setscalabley(true); ); ).start(); FILE AboutActivity.java CODE TO DISPLAY PROJECT INFORMATION package com.ste.sembakoapp; import Android.support.v7.app.AppCompatActivity; import Android.os.Bundle; public class AboutActivity extends AppCompatActivity { protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_about); I
10 FILE Node.java CODE TO STORE ITEM DATA IN A NODE TO BE INSERTED INTO LINKED LIST package com.ste.sembakoapp; public class node { private String nama; private float[] harga; private int[] tanggal; private node next; private node prev; public node(string nama, float[] harga, int[] tanggal) { this.nama = nama; this.harga = harga; this.tanggal = tanggal; this.next = null; this.prev = null; public node(node E, node next, node prev) { this.nama = E.getNama(); this.harga = E.getHarga(); this.tanggal = E.getTanggal(); this.next = next; this.prev = prev; public String getnama() { return this.nama; public float[] getharga() { return this.harga; public int[] gettanggal() { return this.tanggal; public node getnext() { return next; public node getprev() { return prev; public void setnext(node next) { this.next = next; public void setprev(node prev) { this.prev = prev; J
11 FILE LinkedListImpl.java CODE TO STORE DATA INTO LINKED LIST package com.ste.sembakoapp; public class LinkedListImpl { private node head; private node tail; private int size; public LinkedListImpl() { size = 0; public int size() { return size; public boolean isempty() { return size == 0; public node gethead() { return head; public node get(int i) { if (i < size) { node pointer = head; int position = 1; while (position <= i) { pointer = pointer.getnext(); position++; return pointer; else { return null; public void addfirst(node E) { if (size == 0) { head = new node(e, null, null); tail = head; size++; else { head.setprev(e); E.setNext(head); head = E; size++; public void addlast(node E) { if (size == 0) { tail = new node(e, null, null); head = tail; K
12 size++; else { tail.setnext(e); E.setPrev(tail); tail = E; size++; public void dellfirst() { if (size == 1) { head = null; tail = null; size--; else if (size > 1) { node del = head; head = head.getnext(); head.setprev(null); del.setnext(null); size--; public void delllast() { if (size == 1) { head = null; tail = null; size--; else if (size > 1) { node del = tail; tail = tail.getprev(); del.setprev(null); tail.setnext(null); size--; public void sethead(node head) { this.head = head; public node gettail() { return tail; public void settail(node tail) { this.tail = tail; public int getsize() { return size; public void setsize(int size) { this.size = size; L
13 FILE Statistic.java CODE TO CALCULATE STATISTICS (MEAN, MEDIAN, MODE) ON DATA package com.ste.sembakoapp; import java.util.arrays; public class Statistic { public static float mean(float[] m) { float sum = 0; for (int i = 0; i < m.length; i++) { sum += m[i]; return sum / m.length; public static double median(float[] m) { int middle = m.length/2; Arrays.sort(m); if (m.length%2 == 1) { return m[middle]; else { return (m[middle-1] + m[middle]) / 2.0; public static float mode(float a[]) { float maxvalue=0; float maxcount=0; for (int i = 0; i < a.length; ++i) { int count = 0; for (int j = 0; j < a.length; ++j) { if (a[j] == a[i]) ++count; if (count > maxcount) { maxcount = count; maxvalue = a[i]; return maxvalue; M
14 FILE activity_about.xml CODE FOR ABOUT DISPLAY ACTIVITY <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android=" xmlns:tools=" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.ste.sembakoapp.aboutactivity"> <TextView android:layout_width="wrap_content" android:textappearance="?android:attr/textappearancelarge" android:text="about" android:layout_margintop="42dp" android:layout_alignparenttop="true" android:layout_centerhorizontal="true" /> <TextView android:layout_width="wrap_content" android:textappearance="?android:attr/textappearancemedium" android:text="purpose of the application is for monitoring basic commodities price from Ministry of Trades Website" android:layout_margintop="36dp" android:layout_centerhorizontal="true" /> <TextView android:layout_width="wrap_content" android:textappearance="?android:attr/textappearancemedium" android:text="created By : Stefani Yuanita" android:id="@+id/textview4" android:layout_below="@+id/textview3" android:layout_centerhorizontal="true" android:layout_margintop="35dp" /> </RelativeLayout> N
15 FILE activity_detail.xml CODE FOR ABOUT DETAIL ACTIVITY <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android=" android:layout_width="match_parent" android:layout_height="match_parent" android:fillviewport="true"> <RelativeLayout xmlns:android=" xmlns:tools=" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.ste.sembakoapp.detailactivity"> <Spinner android:layout_width="fill_parent" /> <Spinner android:layout_width="fill_parent" android:layout_alignparentleft="true" android:layout_alignparentstart="true" android:layout_margintop="31dp" /> <Spinner android:layout_width="fill_parent" android:layout_alignparentright="true" android:layout_alignparentend="true" android:layout_margintop="33dp" /> <Button android:layout_width="wrap_content" android:text="get Data" android:layout_centerhorizontal="true" android:layout_margintop="41dp" /> <TextView android:layout_width="wrap_content" O
16 android:text="" android:textsize="17sp" android:layout_margintop="57dp" android:layout_centerhorizontal="true" /> <com.jjoe64.graphview.graphview android:layout_width="match_parent" android:layout_height="200dip" /> </RelativeLayout> </ScrollView> FILE activity_display.xml CODE FOR ABOUT DISPLAY ACTIVITY <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android=" android:layout_width="match_parent" android:layout_height="match_parent" android:fillviewport="true"> <RelativeLayout xmlns:android=" xmlns:tools=" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.ste.sembakoapp.display"> <Spinner android:layout_width="fill_parent" /> <Spinner android:layout_width="fill_parent" android:layout_margintop="29dp" android:layout_alignparentright="true" android:layout_alignparentend="true" /> <Button android:layout_width="wrap_content" P
17 android:text="get Data" android:layout_centerhorizontal="true" /> <TextView android:layout_width="wrap_content" android:text="result..." android:textsize="17sp" android:layout_centerhorizontal="true" android:layout_margintop="27dp" /> </RelativeLayout> </ScrollView> FILE activity_main.xml CODE FOR ABOUT MAIN ACTIVITY <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android=" xmlns:tools=" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.ste.sembakoapp.mainactivity"> <Button android:layout_width="wrap_content" android:text="price Monitoring" android:layout_margintop="56dp" android:layout_alignparenttop="true" android:layout_centerhorizontal="true" /> <Button android:layout_width="wrap_content" android:text="detail Item" android:layout_margintop="31dp" /> Q
18 <Button android:layout_width="wrap_content" android:text="about" android:layout_centervertical="true" /> </RelativeLayout> R
19 S
20 T
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 informationStatistics http://www.statista.com/topics/840/smartphones/ http://www.statista.com/topics/876/android/ http://www.statista.com/statistics/271774/share-of-android-platforms-on-mobile-devices-with-android-os/
More informationProduced 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 informationMAD 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 informationFragment 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 informationAndroid 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 informationTip Calculator. xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
Tip Calculator activity_main.xml
More informationMobile 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 informationPENGEMBANGAN 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 informationAndroid 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 informationM.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// MainActivity.java ; Noah Spenser; Senior Design; Diabetic Breathalyzer
// MainActivity.java ; Noah Spenser; Senior Design; Diabetic Breathalyzer package com.noahspenser.seniordesign; import android.os.parcel; import android.os.parcelable; import android.support.v7.app.appcompatactivity;
More informationMAD 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 informationEMBEDDED 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 informationAndroid - 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 informationEMBEDDED SYSTEMS PROGRAMMING Application Tip: Saving State
EMBEDDED SYSTEMS PROGRAMMING 2016-17 Application Tip: Saving State THE PROBLEM How to save the state (of a UI, for instance) so that it survives even when the application is closed/killed The state should
More informationApplied 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 informationITU- 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<uses-permission android:name="android.permission.internet" />
Listing Program : 1. Android Manifest.xml
More informationCreate Parent Activity and pass its information to Child Activity using Intents.
Create Parent Activity and pass its information to Child Activity using Intents. /* MainActivity.java */ package com.example.first; import android.os.bundle; import android.app.activity; import android.view.menu;
More informationEMBEDDED SYSTEMS PROGRAMMING UI Specification: Approaches
EMBEDDED SYSTEMS PROGRAMMING 2016-17 UI Specification: Approaches UIS: APPROACHES Programmatic approach: UI elements are created inside the application code Declarative approach: UI elements are listed
More informationBasic 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 informationProduced 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 informationM.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 informationArrays of Buttons. Inside Android
Arrays of Buttons Inside Android The Complete Code Listing. Be careful about cutting and pasting.
More informationStoppUhr. <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="start1"
StoppUhr
More informationCSE 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 informationANDROID 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 informationIntents. 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 informationCSE 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 informationEMBEDDED 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 informationMobile 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 informationProduced by. Mobile Application Development. Eamonn de Leastar
Mobile Application Development Produced by Eamonn de Leastar (edeleastar@wit.ie) Department of Computing, Maths & Physics Waterford Institute of Technology http://www.wit.ie http://elearning.wit.ie A First
More informationDynamically Create Admob Banner and Interstitial Ads
Dynamically Create Admob Banner and Interstitial Ads activity_main.xml file 0 0 0
More informationTextView Control. EditText Control. TextView Attributes. android:id - This is the ID which uniquely identifies the control.
A TextView displays text to the user. TextView Attributes TextView Control android:id - This is the ID which uniquely identifies the control. android:capitalize - If set, specifies that this TextView has
More informationData 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 informationDatabase Development In Android Applications
ITU- FAO- DOA- TRCSL Training on Innovation & Application Development for E- Agriculture Database Development In Android Applications 11 th - 15 th December 2017 Peradeniya, Sri Lanka Shahryar Khan & Imran
More informationProduced 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 informationPROGRAMMING 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 informationELET4133: Embedded Systems. Topic 15 Sensors
ELET4133: Embedded Systems Topic 15 Sensors Agenda What is a sensor? Different types of sensors Detecting sensors Example application of the accelerometer 2 What is a sensor? Piece of hardware that collects
More informationFragments. Lecture 11
Fragments Lecture 11 Situational layouts Your app can use different layouts in different situations Different device type (tablet vs. phone vs. watch) Different screen size Different orientation (portrait
More informationAndroid/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 informationStarting 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... 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 informationAndroid - 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使用 TensorFlow 設計矩陣乘法計算並轉移執行在 Android 上 建國科技大學資管系 饒瑞佶 2017/8
使用 TensorFlow 設計矩陣乘法計算並轉移執行在 Android 上 建國科技大學資管系 饒瑞佶 2017/8 Python 設計 Model import tensorflow as tf from tensorflow.python.tools import freeze_graph from tensorflow.python.tools import optimize_for_inference_lib
More informationTabel 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 informationTime Picker trong Android
Time Picker trong Android Time Picker trong Android cho phép bạn lựa chọn thời gian của ngày trong chế độ hoặc 24 h hoặc AM/PM. Thời gian bao gồm các định dạng hour, minute, và clock. Android cung cấp
More informationCreate a local SQL database hosting a CUSTOMER table. Each customer includes [id, name, phone]. Do the work inside Threads and Asynctasks.
CIS 470 Lesson 13 Databases - Quick Notes Create a local SQL database hosting a CUSTOMER table. Each customer includes [id, name, phone]. Do the work inside Threads and Asynctasks. package csu.matos; import
More informationAndroid Apps Development for Mobile Game Lesson 5
Workshop 1. Create a simple Environment Sensors (Page 1 6) Pressure Sensor Ambient Temperature Sensor Light Sensor Relative Humidity Sensor 2. Create a simple Position Sensors (Page 7 8) Proximity Sensor
More information1. Location Services. 1.1 GPS Location. 1. Create the Android application with the following attributes. Application Name: MyLocation
1. Location Services 1.1 GPS Location 1. Create the Android application with the following attributes. Application Name: MyLocation Project Name: Package Name: MyLocation com.example.mylocation 2. Put
More information1. Simple List. 1.1 Simple List using simple_list_item_1
1. Simple List 1.1 Simple List using simple_list_item_1 1. Create the Android application with the following attributes. Application Name: MySimpleList Project Name: Package Name: MySimpleList com.example.mysimplelist
More information<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 informationSerious Gaming. Technical manual. This document is a collection of the code and installation process
Serious Gaming Technical manual This document is a collection of the code and installation process Peter Elliott 02/04/2017 Contents Table of figures... 3 Introduction... 4 Installation instructions...
More informationLAMPIRAN 1 LAMPIRAN 2 SCREENSHOOT LAMPIRAN 3 LISTING FILE JAVA CLASS 1. main_activity.java packagecom.example.sig.sigrs; import android.content.intent; import android.net.uri; import android.support.v7.app.appcompatactivity;
More informationAndroid 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 informationandroid:layout_margintop="5dp" > <EditText android:layout_width="210dp"
activity_main.xml
More information1. Explain the architecture of an Android OS. 10M The following diagram shows the architecture of an Android OS.
1. Explain the architecture of an Android OS. 10M The following diagram shows the architecture of an Android OS. Android OS architecture is divided into 4 layers : Linux Kernel layer: 1. Linux Kernel layer
More informationandroid-espresso #androidespresso
android-espresso #androidespresso Table of Contents About 1 Chapter 1: Getting started with android-espresso 2 Remarks 2 Examples 2 Espresso setup instructions 2 Checking an Options Menu items (using Spoon
More informationAPI 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 informationLAMPIRAN PROGRAM. public class Listdata_adiktif extends ArrayAdapter<ModelData_adiktif> {
1 LAMPIRAN PROGRAM JAVA Listdata_adiktif.java package com.example.win.api.adapter; import android.content.context; import android.support.annotation.nonnull; import android.view.layoutinflater; import
More informationIntroduction 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 informationAPI 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 informationUser Interface Development in Android Applications
ITU- FAO- DOA- TRCSL Training on Innovation & Application Development for E- Agriculture User Interface Development in Android Applications 11 th - 15 th December 2017 Peradeniya, Sri Lanka Shahryar Khan
More informationAndroid 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 informationelse if(rb2.ischecked()) {
Problem :Toy Calculator Description:Please design an Android application that contains 2 activities: cal_main and cal_result. The following figure is a suggested layout for the cal_main activity. For the
More informationAndroid CardView Tutorial
Android CardView Tutorial by Kapil - Wednesday, April 13, 2016 http://www.androidtutorialpoint.com/material-design/android-cardview-tutorial/ YouTube Video We have already discussed about RecyclerView
More informationPress project on the left toolbar if it doesn t show an overview of the app yet.
#3 Setting up the permissions needed to allow the app to use GPS. Okay! Press project on the left toolbar if it doesn t show an overview of the app yet. In this project plane, we will navigate to the manifests
More informationTopics of Discussion
Reference CPET 565 Mobile Computing Systems CPET/ITC 499 Mobile Computing Fragments, ActionBar and Menus Part 3 of 5 Android Programming Concepts, by Trish Cornez and Richard Cornez, pubslihed by Jones
More informationVienos veiklos būsena. Theory
Vienos veiklos būsena Theory While application is running, we create new Activities and close old ones, hide the application and open it again and so on, and Activity can process all these events. It is
More informationGUI Widget. Lecture6
GUI Widget Lecture6 AnalogClock/Digital Clock Button CheckBox DatePicker EditText Gallery ImageView/Button MapView ProgressBar RadioButton Spinner TextView TimePicker WebView Android Widgets Designing
More informationLAMPIRAN PROGRAM. public class ListArrayAdapterPost extends ArrayAdapter<ModelDataPost> {
1 LAMPIRAN PROGRAM JAVA ListArrayAdapterPost.java package com.example.win.api.adapter; import android.content.context; import android.support.annotation.nonnull; import android.view.layoutinflater; import
More informationLecture 14. Android Application Development
Lecture 14 Android Application Development Notification Instructor Muhammad Owais muhammad.owais@riphah.edu.pk Cell: 03215500223 Notifications Used to notify user for events Three general forms of Notifications
More informationAccelerating 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 informationPractical 1.ListView example
Practical 1.ListView example In this example, we show you how to display a list of fruit name via ListView. Android Layout file File : res/layout/list_fruit.xml
More informationA-1. Listing Program. CariKata.java. package com.indah.kmp;
A-1 Listing Program CariKata.java package com.indah.kmp; import java.io.bufferedreader; import java.io.file; import java.io.filenotfoundexception; import java.io.filereader; import java.io.ioexception;
More informationChapter 8 Positioning with Layouts
Introduction to Android Application Development, Android Essentials, Fifth Edition Chapter 8 Positioning with Layouts Chapter 8 Overview Create user interfaces in Android by defining resource files or
More informationCOMP61242: 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 information05. RecyclerView and Styles
05. RecyclerView and Styles 08.03.2018 1 Agenda Intents Creating Lists with RecyclerView Creating Cards with CardView Application Bar Menu Styles and Themes 2 Intents 3 What is Intent? An Intent is an
More informationAndroid 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 informationAppendix 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 informationAndroid 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 informationAPPENDIX. Application Store Admin. build.gradle. app/build.gradle
Application Store Admin build.gradle APPENDIX // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { jcenter() dependencies { classpath
More informationSD Module-1 Android Dvelopment
SD Module-1 Android Dvelopment Experiment No: 05 1.1 Aim: Download Install and Configure Android Studio on Linux/windows platform. 1.2 Prerequisites: Microsoft Windows 10/8/7/Vista/2003 32 or 64 bit Java
More informationMobile Health Sensing with Smart Phones
University of Arkansas, Fayetteville ScholarWorks@UARK Electrical Engineering Undergraduate Honors Theses Electrical Engineering 5-2015 Mobile Health Sensing with Smart Phones Abby Logan Wise University
More informationManifest.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 informationOur First Android Application
Mobile Application Development Lecture 04 Imran Ihsan Our First Android Application Even though the HelloWorld program is trivial in introduces a wealth of new ideas the framework, activities, manifest,
More informationUI (User Interface) overview Supporting Multiple Screens Touch events and listeners
http://www.android.com/ UI (User Interface) overview Supporting Multiple Screens Touch events and listeners User Interface Layout The Android user interface (UI) consists of screen views (one or more viewgroups
More informationAndroid SQLite Database Tutorial - CRUD Operations
Android SQLite Database Tutorial - CRUD Operations by Kapil - Monday, March 21, 2016 http://www.androidtutorialpoint.com/storage/android-sqlite-database-tutorial/ YouTube Video Android SQLite Introduction
More informationProgramming with Android: Introduction. Layouts. Dipartimento di Informatica: Scienza e Ingegneria Università di Bologna
Programming with Android: Introduction Layouts Luca Bedogni Marco Di Felice Dipartimento di Informatica: Scienza e Ingegneria Università di Bologna Views: outline Main difference between a Drawable and
More informationandroid:orientation="horizontal" android:layout_margintop="30dp"> <Button android:text="button2"
Parametrų keitimas veikiančioje aplikacijoje Let s create a project: Project name: P0181_DynamicLayout3 Build Target: Android 2.3.3 Application name: DynamicLayout3 Package name: ru.startandroid.develop.dynamiclayout3
More informationTutorial: Setup for Android Development
Tutorial: Setup for Android Development Adam C. Champion CSE 5236: Mobile Application Development Autumn 2017 Based on material from C. Horstmann [1], J. Bloch [2], C. Collins et al. [4], M.L. Sichitiu
More informationNadar Saraswathi College of Engineering and Technology, Nadar Saraswathi College of Engineering and Technology,
Nadar Saraswathi College of Engineering and Technology, DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING CS6611 MOBILE APPLICATION DEVELOPMENT LAB MANUAL (R-2017) Lab Manual Prepared By : Mr. R. Udhaya Kumar,
More informationAdapter.
1 Adapter An Adapter object acts as a bridge between an AdapterView and the underlying data for that view The Adapter provides access to the data items The Adapter is also responsible for making a View
More informationSimple 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 informationCITIZEN COP PRESENTED BY :- A CLOUD BASED CRIME REPORT APPLICATION. SOUVIK ROY - IT2014/066 AWSAF AMBAR - IT2014/067 SAYANI DUTTA - IT2014/089
CITIZEN COP CITIZEN COP A CLOUD BASED CRIME REPORT APPLICATION. PRESENTED BY :- SOUVIK ROY - IT2014/066 AWSAF AMBAR - IT2014/067 SAYANI DUTTA - IT2014/089 1 CITIZEN COP A CLOUD BASED CRIME REPORTING APP
More informationAndroid 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 informationThread. A Thread is a concurrent unit of execution. The thread has its own call stack for methods being invoked, their arguments and local variables.
1 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. Each virtual machine instance has at least one main
More informationText Properties Data Validation Styles/Themes Material Design
Text Properties Data Validation Styles/Themes Material Design Sisoft Technologies Pvt Ltd SRC E7, Shipra Riviera Bazar, Gyan Khand-3, Indirapuram, Ghaziabad Website: Email:info@sisoft.in Phone: +91-9999-283-283
More information