Question

Please use JAVA IN ANDROID STUDIO. thanks so much its really appreciated.

6.1.1 Steps to Follow 1. Add a Jaea library to the Android project created in Step #1. For more details about how 2 In the Ja

0 0
Add a comment Improve this question Transcribed image text
Answer #1

As you had mentioned you had already implemented the drink part,

I will provide you the details for Food menu

NOTE:- THIS FOOD PROGRAM IS ALREADY DONE BY ME WITH DIFFERENT NAMES..

MAKE NECESSARY CHANGES.

NOTES

  • THE APP CONTAINS 3 LAYOUTS
  • 3 OF THEM INDICATES 3 DIFFERENT FOOD ITEMS
  • AND A MAIN LAYOUT TO SHOW MENU
  • 3 FOOD LAYOUTS CAN BE MODIFIED AS YOU WISH FOR ADDING MORE DETAILS ABOUT FOOD
  • PLEASE NOTE THAT THE PROJECT NAME AND PACKAGES NEED TO BE CHANGED.
  • IF YOU HAVE ANY DOUBTS FEEL FREE TO COMMENT

activity_main.xml

<?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:id="@+id/activity_main"
    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.example.android.food.MainActivity">
    <ImageView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:src="@drawable/bg"
        android:layout_centerVertical="true"/>

    <TextView
        android:text="WELCOME TO FOOD MENU"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="13dp"
        android:id="@+id/menu_tv"
        android:textStyle="normal|bold"
        android:textSize="24sp"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true" />

    <Button
        android:text="PIZZA"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/menu_tv"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="73dp"
        android:id="@+id/pizza_bt"
        android:onClick="pizzaFn" />

    <Button
        android:text="SALAD"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerVertical="true"
        android:layout_alignStart="@+id/pizza_bt"
        android:id="@+id/salad_bt"
        android:onClick="saladFn" />

    <Button
        android:text="BBQ"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/salad_bt"
        android:layout_alignStart="@+id/salad_bt"
        android:layout_marginTop="64dp"
        android:id="@+id/steak_bt"
        android:onClick="steakFn" />
</RelativeLayout>

activity_salad.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent">

    <ImageView
        android:paddingTop="10dp"
        android:layout_width="500dp"
        android:layout_height="250dp"
        android:src="@drawable/salad"
        android:id="@+id/imageView" />

    <TextView
        android:text="salad - $ 50"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/imageView"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="53dp"
        android:id="@+id/textView"
        android:textStyle="bold"
        android:textSize="15sp" />

</RelativeLayout>

activity_pizza.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent">

    <ImageView
        android:paddingTop="10dp"
        android:layout_width="500dp"
        android:layout_height="250dp"
        android:src="@drawable/pizza"
        android:id="@+id/imageView" />

    <TextView
        android:text="Pizza - $85"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/imageView"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="53dp"
        android:id="@+id/textView"
        android:textStyle="bold"
        android:textSize="15sp" />

</RelativeLayout>

activity_steak.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent">

    <ImageView
        android:paddingTop="10dp"
        android:layout_width="500dp"
        android:layout_height="250dp"
        android:src="@drawable/steak"
        android:id="@+id/imageView" />

    <TextView
        android:text="STEAK - $50"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/imageView"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="53dp"
        android:id="@+id/textView"
        android:textStyle="bold"
        android:textSize="15sp" />

</RelativeLayout>

JAVA FILE

MainActivty

package com.example.android.food;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

    }
    /*FUNTION THAT WILL BE CALLED WHEN WE CLICK BUTTON PIZZA AND IT WILL GO TO THE PIZZA LAYOUT*/
    public void pizzaFn(View v) {

        Intent i = new Intent(MainActivity.this,PizzaActivity.class);
        startActivity(i);
    }
    /*FUNTION THAT WILL BE CALLED WHEN WE CLICK BUTTON SALAD AND IT WILL GO TO THE SALAD LAYOUT*/
    public void saladFn(View v) {

        Intent i = new Intent(MainActivity.this,SaladActivity.class);
        startActivity(i);
    }
    /*FUNTION THAT WILL BE CALLED WHEN WE CLICK BUTTON STEAK AND IT WILL GO TO THE STEAK LAYOUT*/
    public void steakFn(View v) {

        Intent i = new Intent(MainActivity.this,SteakActivity.class);
        startActivity(i);
    }
}

Feel free to comment if you need any queries

Add a comment
Know the answer?
Add Answer to:
Please use JAVA IN ANDROID STUDIO. thanks so much its really appreciated. 6.1.1 Steps to Follow...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • If anyone here is a Java and Android Studio expert please I really need help fulfilling...

    If anyone here is a Java and Android Studio expert please I really need help fulfilling the requirements needed to make a Rock Paper Scissors game. I mainly need Java code to complete it I will post what I have so far I don't have much time left please if anyone can help me I would really appreciate it. Here's what the app is supposed to do... The player should be able to select either Rock, Paper, or Scissors.The app...

  • Can someone help me in java Net Beans IDE witht the code andjava comments. Thanks...

    Can someone help me in java Net Beans IDE witht the code and java comments. ThanksMany of these classes will just need to be copied from previous assignments. When you implement the Tree interface you may import the java.util.Iterator class. When you implement the AbstractBinaryTree class you may import the java.util.ArrayList class and the java.util.List class.In this project you will be doing the following:Create a NetBeans project named lab07 and ensure it is imported into your SVN.In this lab assignment...

  • Really need help with this. This is for my Advanced Java Programming Class. If anyone is...

    Really need help with this. This is for my Advanced Java Programming Class. If anyone is an expert in Java I would very much appreciate the help. I will provide the code I was told to open. Exercise 13-3   Use JPA to work with the library checkout system In this exercise, you'll convert the application from the previous exercise to use JPA instead of JDBC to access the database. Review the project Start NetBeans and open the project named ch13_ex3_library that's...

  • In c# So far, you have created object-oriented code for individual classes. You have built objects...

    In c# So far, you have created object-oriented code for individual classes. You have built objects from these classes. Last week, you created a UML for new inherited classes and objects. Finally, you have used polymorphism. When you add abstraction to this mix, you have the “4 Pillars of OOP.” Now, you begin putting the pieces together to create larger object-oriented programs. Objectives for the project are: Create OO classes that contain inherited and polymorphic members Create abstracted classes and...

  • For this assignment, you will use your knowledge of arrays and ArrayLists to write a Java...

    For this assignment, you will use your knowledge of arrays and ArrayLists to write a Java program that will input a file of sentences and output a report showing the tokens and shingles (defined below) for each sentence. Templates are provided below for implementing the program as two separate files: a test driver class containing the main() method, and a sentence utilities class that computes the tokens and shingles, and reports their values. The test driver template already implements accepting...

  • Please help me do the java project For this project you will be reading in a...

    Please help me do the java project For this project you will be reading in a text file and evaluating it in order to create a new file that represents the Class that will represent the properties of the text file. For example, consider the following text file: students.txt ID              Name                              Age                    IsMale           GPA 1                Tom Ryan                       22                       True              3.1 2                Jack Peterson                31                       True              2.7 3                Cindy LuWho                12                       False             3.9 When you read in the header line, you...

  • JAVA PROGRAMMING***** Please provide screenshots of output and write a tester class to test. The ...

    JAVA PROGRAMMING***** Please provide screenshots of output and write a tester class to test. The starter code has been provided below, just needs to be altered. For this project you will implement the Memento Design Pattern. To continue on with the food theme, you will work with Ice Cream Cones. You will need to use AdvancedIceCreamCone.java. Create at least three Ice Cream Cones - one with chocolate ice cream, one with vanilla ice cream and one with strawberry ice cream....

  • Please Implement this code using Java Eclipse. CIS 1068 Assignment 8 Warm Up with Objects Due:...

    Please Implement this code using Java Eclipse. CIS 1068 Assignment 8 Warm Up with Objects Due: Wednesday, March 25 70 points (+ up to 15 extra credit) The purpose of this assignment is to give you practice implementing your own classes. It also provides extra practice with arrays. Task Implement a class Task, which is used to represent a job that should be done. It should contain the following private fields: .name text description of what job should be done...

  • ***JAVA: Please make "Thing" movies. Objective In this assignment, you are asked to implement a bag...

    ***JAVA: Please make "Thing" movies. Objective In this assignment, you are asked to implement a bag collection using a linked list and, in order to focus on the linked list implementation details, we will implement the collection to store only one type of object of your choice (i.e., not generic). You can use the object you created for program #2 IMPORTANT: You may not use the LinkedList class from the java library. Instead, you must implement your own linked list...

  • the first question java code eclipse app the second question is java fx gui caculator please...

    the first question java code eclipse app the second question is java fx gui caculator please fast 1. Create project called "YourFirstName_QUID'. Eg. Aliomar_202002345 2. Create two package Q1 and Q2. 3. Add your name and studentID as comments on the top of each Java source file you submit. Question 1. Bookings APP [80 Points-six parts] Implement the following hotel booking system. Use the following class diagram to understand the structure of the system's classes, their attributes operations (or methods),...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT