APPENDIX CODE TO STORE THE BUTTON MENU AND MOVE THE PAGE

Similar documents
EMBEDDED SYSTEMS PROGRAMMING Application Tip: Switching UIs


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

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


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

Android Programs Day 5

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

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

PENGEMBANGAN APLIKASI PERANGKAT BERGERAK (MOBILE)

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

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

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

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: Managing Screen Orientation

Android - JSON Parser Tutorial

EMBEDDED SYSTEMS PROGRAMMING Application Tip: Saving State

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

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

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

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

EMBEDDED SYSTEMS PROGRAMMING UI Specification: Approaches

Basic GUI elements - exercises

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

M.A.D Assignment # 1

Arrays of Buttons. Inside Android

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

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

Intents. Your first app assignment

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

EMBEDDED SYSTEMS PROGRAMMING Android Services

Mobile Software Development for Android - I397

Produced by. Mobile Application Development. Eamonn de Leastar

Dynamically Create Admob Banner and Interstitial Ads

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

Data Persistence. Chapter 10

Database Development In Android Applications

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

PROGRAMMING APPLICATIONS DECLARATIVE GUIS

ELET4133: Embedded Systems. Topic 15 Sensors

Fragments. Lecture 11

Android/Java Lightning Tutorial JULY 30, 2018

Starting Another Activity Preferences


Android - Widgets Tutorial

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

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

Time Picker trong Android

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

Android Apps Development for Mobile Game Lesson 5

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

1. Simple List. 1.1 Simple List using simple_list_item_1

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

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


Android Application Development. By : Shibaji Debnath

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

1. Explain the architecture of an Android OS. 10M The following diagram shows the architecture of an Android OS.

android-espresso #androidespresso

API Guide for Gesture Recognition Engine. Version 2.0

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

Introduction to Android Development

API Guide for Gesture Recognition Engine. Version 1.1

User Interface Development in Android Applications

Android UI Development

else if(rb2.ischecked()) {

Android CardView Tutorial

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

Topics of Discussion

Vienos veiklos būsena. Theory

GUI Widget. Lecture6

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

Lecture 14. Android Application Development

Accelerating Information Technology Innovation

Practical 1.ListView example

A-1. Listing Program. CariKata.java. package com.indah.kmp;

Chapter 8 Positioning with Layouts

COMP61242: Task /04/18

05. RecyclerView and Styles

Android Workshop: Model View Controller ( MVC):

Appendix A : Android Studio Code For Android

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

APPENDIX. Application Store Admin. build.gradle. app/build.gradle

SD Module-1 Android Dvelopment

Mobile Health Sensing with Smart Phones

Manifest.xml. Activity.java

Our First Android Application

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

Android SQLite Database Tutorial - CRUD Operations

Programming with Android: Introduction. Layouts. Dipartimento di Informatica: Scienza e Ingegneria Università di Bologna

android:orientation="horizontal" android:layout_margintop="30dp"> <Button android:text="button2"

Tutorial: Setup for Android Development

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

Adapter.

Simple Currency Converter

CITIZEN COP PRESENTED BY :- A CLOUD BASED CRIME REPORT APPLICATION. SOUVIK ROY - IT2014/066 AWSAF AMBAR - IT2014/067 SAYANI DUTTA - IT2014/089

Android JSON Parsing Tutorial

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.

Text Properties Data Validation Styles/Themes Material Design

Transcription:

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

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

int bulan_pos = spinner2.getselecteditemposition(); String bulan = String.valueOf(bulan_pos+1); String str_bulan = spinner2.getselecteditem().tostring(); String URL = url.append("http://www.kemendag.go.id/id/economicprofile/prices/national-price-table? 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

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

); ).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

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("http://www.kemendag.go.id/id/economicprofile/prices/national-price-table? 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

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

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

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

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

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

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

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

FILE activity_about.xml CODE FOR ABOUT DISPLAY ACTIVITY <?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="com.ste.sembakoapp.aboutactivity"> <TextView android:layout_width="wrap_content" android:textappearance="?android:attr/textappearancelarge" android:text="about" android:id="@+id/textview2" 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:id="@+id/textview3" android:layout_margintop="36dp" android:layout_below="@+id/textview2" 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

FILE activity_detail.xml CODE FOR ABOUT DETAIL ACTIVITY <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:fillviewport="true"> <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="com.ste.sembakoapp.detailactivity"> <Spinner android:id="@+id/tahun_spinner" android:layout_width="fill_parent" /> <Spinner android:id="@+id/bulan_spinner" android:layout_width="fill_parent" android:layout_below="@+id/tahun_spinner" android:layout_alignparentleft="true" android:layout_alignparentstart="true" android:layout_margintop="31dp" /> <Spinner android:id="@+id/item_spinner" android:layout_width="fill_parent" android:layout_below="@+id/bulan_spinner" android:layout_alignparentright="true" android:layout_alignparentend="true" android:layout_margintop="33dp" /> <Button android:id="@+id/getbtn" android:layout_width="wrap_content" android:text="get Data" android:layout_below="@+id/item_spinner" android:layout_centerhorizontal="true" android:layout_margintop="41dp" /> <TextView android:id="@+id/result" android:layout_width="wrap_content" O

android:text="" android:textsize="17sp" android:layout_margintop="57dp" android:layout_below="@+id/getbtn" android:layout_centerhorizontal="true" /> <com.jjoe64.graphview.graphview android:layout_width="match_parent" android:layout_height="200dip" android:layout_below="@id/result" android:id="@+id/graph" /> </RelativeLayout> </ScrollView> FILE activity_display.xml CODE FOR ABOUT DISPLAY ACTIVITY <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:fillviewport="true"> <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="com.ste.sembakoapp.display"> <Spinner android:id="@+id/tahun_spinner" android:layout_width="fill_parent" /> <Spinner android:id="@+id/bulan_spinner" android:layout_width="fill_parent" android:layout_margintop="29dp" android:layout_below="@+id/tahun_spinner" android:layout_alignparentright="true" android:layout_alignparentend="true" /> <Button android:id="@+id/getbtn" android:layout_width="wrap_content" P

android:text="get Data" android:layout_below="@+id/bulan_spinner" android:layout_centerhorizontal="true" /> <TextView android:id="@+id/result" android:layout_width="wrap_content" android:text="result..." android:textsize="17sp" android:layout_below="@+id/getbtn" 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="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="com.ste.sembakoapp.mainactivity"> <Button android:layout_width="wrap_content" android:text="price Monitoring" android:id="@+id/menu1" android:layout_margintop="56dp" android:layout_alignparenttop="true" android:layout_centerhorizontal="true" /> <Button android:layout_width="wrap_content" android:text="detail Item" android:id="@+id/menu2" android:layout_margintop="31dp" android:layout_below="@+id/menu1" android:layout_alignright="@+id/menu1" android:layout_alignend="@+id/menu1" android:layout_alignleft="@+id/menu1" android:layout_alignstart="@+id/menu1" /> Q

<Button android:layout_width="wrap_content" android:text="about" android:id="@+id/menu3" android:layout_centervertical="true" android:layout_alignleft="@+id/menu2" android:layout_alignstart="@+id/menu2" android:layout_alignright="@+id/menu2" android:layout_alignend="@+id/menu2" /> </RelativeLayout> R

S

T