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

Similar documents
EMBEDDED SYSTEMS PROGRAMMING Application Tip: Switching UIs

private static String TAG = BluetoothUtils.class.getSimpleName();

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

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

PENGEMBANGAN APLIKASI PERANGKAT BERGERAK (MOBILE)

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

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

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

EMBEDDED SYSTEMS PROGRAMMING Application Tip: Managing Screen Orientation

Intents. Your first app assignment


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

ANDROID PROGRAMS DAY 3

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

APPENDIX CODE TO STORE THE BUTTON MENU AND MOVE THE PAGE

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

Basic GUI elements - exercises

API Guide for Gesture Recognition Engine. Version 2.0

Android Programs Day 5

Android - JSON Parser Tutorial

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


API Guide for Gesture Recognition Engine. Version 1.1

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

EMBEDDED SYSTEMS PROGRAMMING Application Tip: Saving State

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

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

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

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

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

EMBEDDED SYSTEMS PROGRAMMING Android Services


EMBEDDED SYSTEMS PROGRAMMING UI Specification: Approaches

Dynamically Create Admob Banner and Interstitial Ads

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

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

M.A.D Assignment # 1

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

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

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

SMARTPHONE-CONTROLLED TOY BOAT

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

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

MyDatabaseHelper. public static final String TABLE_NAME = "tbl_bio";

Vienos veiklos būsena. Theory

ELET4133: Embedded Systems. Topic 15 Sensors

Produced by. Mobile Application Development. Eamonn de Leastar

Mobile Software Development for Android - I397

Android CardView Tutorial

Fragments. Lecture 11

android-espresso #androidespresso

Arrays of Buttons. Inside Android

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

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

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

Android/Java Lightning Tutorial JULY 30, 2018

Data Persistence. Chapter 10

1. Simple List. 1.1 Simple List using simple_list_item_1

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

Android Networking and Connec1vity

COMP61242: Task /04/18

Time Picker trong Android

PROGRAMMING APPLICATIONS DECLARATIVE GUIS

1D/2D android secondary development

Android Workshop: Model View Controller ( MVC):

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

Android UI Development

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

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

Bluetooth. Mobila applikationer och trådlösa nät HI /3/2013. Lecturer: Anders Lindström,

Android Layout Types

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

Android - Widgets Tutorial

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

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

Topics of Discussion

Our First Android Application

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

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

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.

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

Tutorial: Setup for Android Development

Android SQLite Database Tutorial - CRUD Operations

MVC Apps Basic Widget Lifecycle Logging Debugging Dialogs

Android Apps Development for Mobile Game Lesson 5

Android JSON Parsing Tutorial

Android Coding. Dr. J.P.E. Hodgson. August 23, Dr. J.P.E. Hodgson () Android Coding August 23, / 27

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

shared objects monitors run() Runnable start()

else if(rb2.ischecked()) {

Practical 1.ListView example

Starting Another Activity Preferences

Introduction to Android Development

ANDROID APPS DEVELOPMENT FOR MOBILE AND TABLET DEVICE (LEVEL I)

Android + TIBBO + Socket 建國科技大學資管系 饒瑞佶

LAB MANUAL SITTTR KALAMASSERY SMART DEVICE PROGRAMMING LAB. SITTTR Smart Device Programming Manual Page 1

By The Name of Allah. The Islamic University of Gaza Faculty of Engineering Computer Department Final Exam. Mobile Computing

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

Appendix A : Android Studio Code For Android

API Guide for Gesture Recognition Engine. Version 1.3

Transcription:

// 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; import android.os.bundle; import android.bluetooth.*; import android.util.log; import android.view.view; import java.util.*; import android.widget.*; import java.io.ioexception; import android.os.handler; import android.content.intent; import java.io.*; import java.util.arraylist; import java.util.date; public class MainActivity extends AppCompatActivity { public static ArrayList<Reading> valuelist; public static boolean createflag=false; protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); Intent ia; float newreading; if(createflag==true){ Log.d("init2","createflag is true"); ia=getintent(); newreading=ia.getfloatextra("newreading",-1); if(newreading!=-1) { Reading nr = new Reading(newreading); valuelist.add(nr); Log.d("ocma","received reading"); savevaluelist(); if(createflag==false) { Log.d("init","createflag is false"); valuelist = new ArrayList<Reading>(); //fakevaluelist(); instantiatevaluelist(); createflag=true; final Button button1 = (Button) findviewbyid(r.id.membutton); button1.setonclicklistener(new View.OnClickListener() { public void onclick(view v) { Intent i2=new Intent(MainActivity.this,CheckHistory.class); i2.putparcelablearraylistextra("valuelist",valuelist); startactivity(i2); ); final Button button2 = (Button) findviewbyid(r.id.readbutton); button2.setonclicklistener(new View.OnClickListener() { public void onclick(view v) { Intent i2=new Intent(MainActivity.this,ReadFromDevice.class); startactivity(i2); ); /*final Button button3 = (Button) findviewbyid(r.id.settingsbutton);

button3.setonclicklistener(new View.OnClickListener() { public void onclick(view v) { Intent i2=new Intent(MainActivity.this,CheckSettings.class); startactivity(i2); );*/ void instantiatevaluelist(){ Log.d("ivl","trying to instantiate"); String a=null; File dir=getfilesdir(); File newfile=new File(dir,"afasafasa.txt"); FileReader fr; fr=new FileReader(newfile); catch(filenotfoundexception fs){ Log.d("ivl","filenotfound"); valuelist=new ArrayList<Reading>(); char read=0; int i=0; StringBuilder sbr=new StringBuilder(); for(;(int)read!=-1;){ Log.d("ivl","fullreading"); sbr.delete(0,sbr.length()); i=0; for(;i!=(int)'\r'&&i!=-1;){ i=fr.read(); read=(char)i; Log.d("ivl","reading "+read); sbr.append(read); i=fr.read(); if(sbr.tostring()!=""&&sbr.length()>2) { Log.d("ivl","abouttoaddreading"); Reading a1 = new Reading(sbr.toString()); valuelist.add(a1); Log.d("ivl","addedreading"); else{ break; catch(ioexception ioa) { Log.d("ivl","ioexception in create valuelist"); Log.d("ivl","abouttoclose"); fr.close(); catch(ioexception ioa1){ Log.d("ivl","couldn't close"); /*void fakevaluelist(){ Log.d("fvl","trying to create value list"); String a="23.4555 27.644 Tue Nov 15 2016 16:34:50 GMT-0500 (EST)\r\n2.45 270.644 Wed Nov 16 2016 16:34:52 GMT-0500 (EST)\r\n47.55 2.644 Thu Nov 17 2016 17:35:50 GMT-0500 (EST)\r\n"; FileWriter fw; File dir=getfilesdir();

File newfile=new File(dir,"afasafasa.txt"); newfile.createnewfile(); catch (IOException ioio){ Log.d("fvl","io create new file"); int len=valuelist.size(); fw=new FileWriter(newfile); catch(ioexception abc){ Log.d("fvl","IOexception in create fw"); fw.write(a); catch(ioexception abcd){ Log.d("fvl","IOexception in write"); fw.flush(); fw.close(); catch(ioexception argh){ Log.d("fvl","IOexception in close"); */ void savevaluelist(){ FileWriter fw; File dir=getfilesdir(); int len=valuelist.size(); File newfile=new File(dir,"afasafasa.txt"); newfile.createnewfile(); Log.d("svl","creatingfile"); catch (IOException ioio){ Log.d("svl","io create new file"); fw=new FileWriter(newfile); Log.d("svl","creatingfilewriter"); catch(ioexception abc){ Log.d("svl","ioexceptioncreatingfilewriter"); for (int counter = 0; counter < len; counter++) { fw.write(valuelist.get(counter).tostring()); Log.d("svl","writingvalue"); catch(ioexception abcd){ Log.d("svl","ioexceptionwritingvalue"); fw.close(); Log.d("svl","closingstream"); catch(ioexception abdcde){ Log.d("svl","ioexceptionclosing");

class Reading implements Parcelable { public float acetonevalue; public float convertedglucose; String dates; Reading(float av){ acetonevalue=av; Date date1=new Date(); dates=date1.tostring(); convertedglucose=this.convertglucose(acetonevalue); public float convertglucose(float av){ return 0; public int describecontents() { return 0; public void writetoparcel(parcel dest, int flags) { dest.writestring(this.tostring()); public String tostring(){ String a; String b=string.format("%f",acetonevalue); String c=string.format("%f",convertedglucose); a=(b+" "+c+" "+dates+"\r\n"); return a; public String toprintstring(){ String a; String b=string.format("%f",acetonevalue); String c=string.format("%f",convertedglucose); a=("acetone Value="+b+" PPM\n\rGlucose Value="+c+" UNITS\n\rDate and Time="+dateS.substring(4,24)); return a; Reading(String s){ Log.d("rdg","starting reading with s="+s); String a=""; String b=""; String c=""; StringBuilder sb1=new StringBuilder(); StringBuilder sb2=new StringBuilder(); StringBuilder sb3=new StringBuilder(); String adder; char a1; int sv=0; if(s!=""){ a1=s.charat(sv); for (;a1!=' ';sv++){ adder=character.tostring(a1); sb1.append(adder); a1=s.charat(sv+1); sv++; a1=s.charat(sv); for (;a1!=' ';sv++){ adder=character.tostring(a1); sb2.append(adder);

a1=s.charat(sv+1); sv++; a1=s.charat(sv); for (;a1!='\r';sv++){ adder=character.tostring(a1); sb3.append(adder); a1=s.charat(sv+1); dates=sb3.tostring(); acetonevalue=float.parsefloat(sb1.tostring()); convertedglucose=float.parsefloat(sb2.tostring()); sv+=2; else{ Log.d("reading","reading input null"); public static final Parcelable.Creator<Reading> CREATOR = new Parcelable.Creator<Reading>() { public Reading createfromparcel(parcel source) { return new Reading(source); public Reading[] newarray(int size) { return new Reading[size]; ; public Reading(Parcel data) { this(data.readstring()); Related XML File: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingbottom="@dimen/activity_vertical_margin" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" tools:context="com.noahspenser.seniordesign.mainactivity"> <TextView android:text="menu Options" android:layout_alignparentright="true" android:layout_alignparentend="true" android:layout_alignparenttop="true" android:layout_alignparentleft="true" android:layout_alignparentstart="true" android:id="@+id/textview" /> <Button android:text="read From Device" android:id="@+id/readbutton" android:layout_below="@+id/textview"

android:layout_centerhorizontal="true" android:layout_margintop="53dp"/> <Button android:text="view Previous Readings" android:id="@+id/membutton" android:layout_margintop="32dp" android:layout_below="@+id/readbutton" android:layout_centerhorizontal="true"/> </RelativeLayout> // CheckHistory.java ; Noah Spenser; Senior Design; Diabetic Breathalyzer package com.noahspenser.seniordesign; import android.content.intent; 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.listview; import java.util.arraylist; public class CheckHistory extends AppCompatActivity { ListView listview; ArrayList<Reading> valuelist; String[] stringarray; ArrayAdapter<String> adapter; protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_check_history); listview=(listview) findviewbyid(r.id.listview); Intent i2=this.getintent(); valuelist=i2.getparcelablearraylistextra("valuelist"); if(valuelist!=null){ if(valuelist.size()>0){ stringarray=new String[valueList.size()]; for(int cc=0;cc<valuelist.size();cc++){ stringarray[cc]=valuelist.get(valuelist.size()-1-cc).toprintstring(); else{ stringarray=new String[]{"No Previous Values Exist"; else{ stringarray[0]="no Previous Values Exist"; adapter=new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,stringArray); listview.setadapter(adapter); final Button button1 = (Button) findviewbyid(r.id.button2); button1.setonclicklistener(new View.OnClickListener() { public void onclick(view v) { Intent i2=new Intent(CheckHistory.this,MainActivity.class); i2.addflags(intent.flag_activity_clear_top); startactivity(i2); );

Related XML File: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingbottom="@dimen/activity_vertical_margin" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" tools:context="com.noahspenser.seniordesign.checkhistory"> <ListView android:id="@+id/listview" android:layout_alignparenttop="true" android:layout_alignparentleft="true" android:layout_alignparentstart="true" android:layout_above="@+id/button2" /> <Button style="?android:attr/buttonstylesmall" android:text="return" android:id="@+id/button2" android:layout_alignparentbottom="true" android:layout_centerhorizontal="true"/> </RelativeLayout> // ReadFromDevice.java ; Noah Spenser; Senior Design; Diabetic Breathalyzer package com.noahspenser.seniordesign; import android.bluetooth.bluetoothadapter; import android.bluetooth.bluetoothdevice; import android.bluetooth.bluetoothsocket; import android.content.intent; import android.os.build; import android.os.handler; import android.support.v7.app.appcompatactivity; import android.os.bundle; import android.util.log; import android.view.view; import android.widget.button; import android.widget.toast; import java.io.ioexception; import java.io.inputstream; import java.io.outputstream; import java.lang.reflect.method; import java.util.set; import java.util.uuid; import android.widget.textview; public class ReadFromDevice extends AppCompatActivity { private static final String TAG = "bluetooth1"; float readingv; final int RecvMsg=1; TextView textview3; protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate);

readingv=-1; setcontentview(r.layout.activity_read_from_device); textview3 = (TextView)findViewById(R.id.textView3); textview3.settext("pending Reading..."); final BluetoothSocket sock1=fromdevice(this.findviewbyid(android.r.id.content)); final Button button2 = (Button) findviewbyid(r.id.button); button2.setonclicklistener(new View.OnClickListener() { public void onclick(view v) { Intent i=new Intent(ReadFromDevice.this, MainActivity.class); i.addflags(intent.flag_activity_clear_top); if(readingv!=-1) { i.putextra("newreading",readingv); sock1.close(); Log.d("fd","closing bluetooth"); catch (IOException abcf){ Log.d("oc","couldn't close"); startactivity(i); ); BluetoothDevice device1=null; BluetoothAdapter commadapter=null; static UUID uuid1; Handler h; StringBuilder sb=new StringBuilder(); static String address; public BluetoothSocket fromdevice(view view){ commadapter = BluetoothAdapter.getDefaultAdapter(); h = new Handler() { public void handlemessage(android.os.message msg) { switch (msg.what) { case RecvMsg: // if receive message byte[] readbuf = (byte[]) msg.obj; String strincom = new String(readBuf, 0, msg.arg1); // create string from bytes array sb.append(strincom);//sb.append("435.222\r\n"); Log.d("rm","got incoming");// append string int endoflineindex = sb.indexof("\r\n"); Log.d("rm","end of line");// determine the end-of-line if (endoflineindex > 0) { Log.d("rm","foundendofline");// if end-of-line, String sbprint = sb.substring(0, endoflineindex); // extract string sb.delete(0, sb.length()); textview3.settext(sbprint); readingv=float.parsefloat(sbprint); catch(numberformatexception a){ textview3.settext("no Readable Value"); readingv=-1; Log.d(TAG, "...String:"+ sb.tostring() + "Byte:" + msg.arg1 + "..."); break; case 0: textview3.settext("no Readable Value"); ; if (commadapter == null){ Log.v("fd","it's null");

Intent i=new Intent(ReadFromDevice.this, MainActivity.class); i.addflags(intent.flag_activity_clear_top); startactivity(i); finish(); return null;//i dunno what to tell you man this requires Bluetooth int REQUEST_ENABLE_BT=1; Log.v("fd","it's still going"); if (!commadapter.isenabled()) { Intent enablebtintent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE); startactivityforresult(enablebtintent, REQUEST_ENABLE_BT); Set<BluetoothDevice> paireddevices = commadapter.getbondeddevices(); // If there are paired devices if (paireddevices.size() > 0) { // Loop through paired devices for (BluetoothDevice device : paireddevices) { // Add the name and address to an array adapter to show in a ListView Log.d("fd","found a device"+device.getaddress()); if (device.getaddress().equals("98:d3:31:40:49:1e")){ Log.d("fd","found the device"); device1 = device; uuid1= UUID.fromString("00001101-0000-1000-8000-00805F9B34FB"); address=device1.getaddress(); break; else { Log.d("fd","didn't find anything"); finish(); //need to pair BluetoothSocket sock1=null; Log.d("bsc","creating socket for device"); sock1 = createbluetoothsocket(device1); catch (IOException e1) { errorexit("fatal Error", "In onresume() and socket create failed: " + e1.getmessage() + "."); commadapter.canceldiscovery(); Log.d(TAG, "...Connecting..."); sock1.connect(); Log.d(TAG, "...Connection ok..."); catch (IOException e) { sock1.close(); Log.d("cs","closing socket"); catch (IOException e2) { errorexit("fatal Error", "In onresume() and unable to close socket during connection failure" + e2.getmessage() + "."); Log.d(TAG, "...Create Socket..."); ConnectedThread ct1 = new ConnectedThread(sock1); ct1.start(); return sock1; private BluetoothSocket createbluetoothsocket(bluetoothdevice device) throws IOException { if(build.version.sdk_int >= 10&&device.getName()=="HC-05"){ final Method m = device.getclass().getmethod("createinsecurerfcommsockettoservicerecord", new Class[] { UUID.class );

return (BluetoothSocket) m.invoke(device, uuid1); catch (Exception e) { Log.e(TAG, "Could not create Insecure RFComm Connection",e); else if(device.getname()!="hc-05"){ Log.e(TAG,"didn't really pass a device"); return device.createrfcommsockettoservicerecord(uuid1); private void errorexit(string title, String message){ Toast.makeText(getBaseContext(), title + " - " + message, Toast.LENGTH_LONG).show(); finish(); private class ConnectedThread extends Thread { private final InputStream instream1; private final OutputStream outstream1; public ConnectedThread(BluetoothSocket socket) { InputStream tmpin = null; OutputStream tmpout = null; // Get the input and output streams, using temp objects because // member streams are final tmpin = socket.getinputstream(); tmpout = socket.getoutputstream(); catch (IOException e) { instream1 = tmpin; outstream1 = tmpout; public void run() { byte[] buffer = new byte[256]; // buffer store for the stream int bytes; // bytes returned from read() // Keep listening to the InputStream until an exception occurs while (true) { // Read from the InputStream bytes = instream1.read(buffer); // Get number of bytes and message in "buffer" h.obtainmessage(recvmsg, bytes, -1, buffer).sendtotarget(); // Send to message queue Handler catch (IOException e) { break; /* Call this from the main activity to send data to the remote device */ public void write(string message) { Log.d(TAG, "...Data to send: " + message + "..."); byte[] msgbuffer = message.getbytes(); outstream1.write(msgbuffer); catch (IOException e) { Log.d(TAG, "...Error data send: " + e.getmessage() + "..."); public void savereturn(view view){ Intent i=new Intent(this, MainActivity.class);

i.addflags(intent.flag_activity_clear_top); if(readingv!=-1) { i.putextra("newreading",readingv); startactivity(i); Related XML File: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:weightsum="1"> <TextView android:textappearance="?android:attr/textappearancelarge" android:text="newest Reading Value" android:id="@+id/textview2" android:layout_gravity="center_horizontal" android:layout_weight="0.03" android:layout_margintop="50dp" /> <TextView android:textappearance="?android:attr/textappearancelarge" android:text=" " android:id="@+id/textview3" android:layout_gravity="center_horizontal" android:layout_weight="0.03" android:layout_margintop="30dp"/> <Button android:text="save Value and Return To Menu" android:id="@+id/button" android:layout_gravity="center_horizontal" android:layout_weight="0.03" android:layout_margintop="100dp"/> </LinearLayout>