Dihydrosphingosine_overattentiveness_profarmer
.docx
keyboard_arrow_up
School
Houston Community College *
*We aren’t endorsed by this school
Course
53
Subject
Computer Science
Date
Feb 20, 2024
Type
docx
Pages
2
Uploaded by CountQuail2118
Question: When is the onStop() method invoked?
Answer: A call to onStop method happens when an activity is no longer visible to the user, either because another activity has taken over or if in front of that activity.
Question: When is the best time to kill a foreground activity?
Answer: The foreground activity, being the most important among the other states, is only killed or terminated as a last resort, especially if it is already consuming too much memory. When a memory paging state has been reach by a foreground activity, then it is killed so that the user interface can retain its responsiveness to the user.
Question: What data types are supported by AIDL?
Answer: AIDL has support for the following data types: -string, -charSequence, -List, -Map, -
all native Java data types like int, long, char and Boolean
Question: What is a visible activity?
Answer: A visible activity is one that sits behind a foreground dialog. It is actually visible to the user, but not necessarily being in the foreground itself.
Question: Describe Activities.
Answer: Activities are what you refer to as the window to a user interface. Just as you create
windows in order to display output or to ask for an input in the form of dialog boxes, activities play the same role, though it may not always be in the form of a user interface.
Question: Enumerate the three key loops when monitoring an activity
Answer: Entire lifetime – activity happens between onCreate and onDestroy, Visible lifetime
– activity happens between onStart and onStop, Foreground lifetime – activity happens between onResume and onPause
Question: What composes a typical Android application project?
Answer: A project under Android development, upon compilation, becomes an .apk file. This
apk file format is actually made up of the AndroidManifest.xml file, application code, resource files, and other related files.
Question: What are the different states wherein a process is based?
Answer: There are 4 possible states: foreground activity, visible activity, background activity, empty process
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Related Questions
USE JAVA LANGUAGE
arrow_forward
Create a test project to play with the Comparable interface. Edit the Card class to implement Comparable . Cards are to be compared using their value. They are considered the same if they have the value. One is less than the other if its value is less. Add the compareTo method that takes a Card object as a argument and returns 0 meaning the values are the same, 1 meaning the card is greater than the parameter, -1 meaning the card is less than the parameter.
Create a main() that creates a Deck. Use your code from the program that dealt out Cards from a Deck and showed the hands but this time, now that Cards are comparible, show them in sorted order using Arrays.sort if the had is an array, or Collections.sort if the hand is an ArrayList. Show the hands.
Document, document, document!
arrow_forward
The Factory method design pattern is useful since it can be used to create new
objects of a particular type dynamically.
True
False
arrow_forward
Objective:
Write a class that will test dates and times inputted by the user and determine whether or not it is valid. This will focus on the usages of methods to organize code.
First download the driver and put it in your project
DO NOT ALTER THE DRIVER!
Use this to run your project
The driver :
public class DateAndTimeDriver { public static void main(String[] args) { // TODO Auto-generated method stub DateAndTimeTester dtTester = new DateAndTimeTester(); dtTester.run(); } }
Write a class file called DateAndTimeTester
This DOES NOT have a main method
Create the following methods
run: This method returns nothing and takes no parameters. This is called by the driver and should handle all of the input from the Scanner and dialog for the user.
isValid: returns true or false if a given String has the correct date and time. The String parameter should be formatted “MM/DD hh:mm” This method should call the methods isValidDate and isValidTime to determine this.
isValidDate: returns…
arrow_forward
Making claims that fail Debug the programme.The issue: Normally, a failed assert only produces a message and causes the application to crash. Finding flaws with this is not really helpful. If a failed assert could launch the debugger, it would be much better.
arrow_forward
Please the code in Java eclipse. Please add comments for each instructions given in the image. I'll appreciate your help. And send the screenshoot of the output.
arrow_forward
1. Create a program class, TestFrame, that contains a main() to test and use the above class. This process should contain methods as follows:
main(): This method should:
1. Call makeFrame() to get the inputs and create a Frame object.
2. Call calcCost() to determine the cost of the picture.
3. Display the cost of the picture along with the attribute values.
4. Ask the user if he/she wants another picture.
5. If the answer is No, display the total cost of the picture
6. If the answer is Yes, implement steps 1 and 2 again (without a loop), then display:
● the number of frames created (through a variable)
• total cost of the picture(s), and
• average picture cost.
6. The program should then end.
Class methods: makeFrame() A function to prompt the user for inputs and accept the four (4) input values needed to create an instance of a
Frame. It instantiates a Frame object and returns the object to the calling method.
follows:
calcCost() This function has a Frame object as its formal argument…
arrow_forward
The
class object is added to the
class object.
When a state change is recognized, the
method
in the
interface is called.
The ConcreteObserver
the Observer interface.
arrow_forward
Create an interface called DVR that has methods that represent thestandard operations on a digital video recorder (play, stop, and soon). Define the method signatures any way you desire. Describehow a class might implement this interface.
arrow_forward
Complete MyProgram such that you can test all conditions
In the Theater constructor you need to instantiate each seat object based upon the information passed to the constructor, making sure they are available.
In the reassign method, make sure the from and to seat assignments are within range and return false if not.
There is test cases included with this exercise, so when you submit your screenshot, it needs to show the test cases passed.
arrow_forward
Design an interface named Encryptor that has a single (abstract) method named encrypt with oneString argument named message. The method should return a String (which will be the encryptedmessage).Design a class named EncryptorOne that implements the Encryptor interface, and with one intinstance variable named shift. The constructor should have one parameter to initialize the shift.Implement the method encrypt so that each letter of the message sent as the argument (withlowercase letters) is shifted by the value in shift. For example, if shift is 3, a will be replaced by d, bwill be replaced by e, c will be replaced by f, and so on with a wraparound (i.e. with shift 3, x will bereplaced by a, y will be replaced by b, and z will be replaced by c). The method should return themodified version of the message. (HINT: The value of a character literal is the integer value of thecharacter in the Unicode character set. So, adding an integer (say, shift) to a character and type-casting the…
arrow_forward
Does a constructor have any means of indicating to a client that it cannot correctly set up the new object’s state? What should a constructor do if it receives inappropriate parameter values?
arrow_forward
3- Implement onContextItemSelected(). When the user selects a menu
item, the system calls this method so you can perform the appropriate
action.
arrow_forward
A platform has space for at most n people at any one time. People are only admitted when the number of persons on the platform does not exceed the limit. Using a semaphore write a JAVA class that could be used to control automated access to the platform. Your class must keep a record of the number of people on the platform at any given point in time and must make this value visible through a public method count()
arrow_forward
True or False?
Interface can be used to store a common method implementation.
arrow_forward
Create a PhoneListing class that uses the Name class for one of its instance variables. Remember the instance data in the Name class is private to the class and must be accessed through its methods.Add additional instance variables to the PhoneListing class for the phone number. The phone number should be broken down into three parts, area code, city code, and local code.Create all appropriate methods for the new class, including the following three methods:
equals(PhoneListing):boolean, an equality of state method that returns true if the objects contain the same name and phone number.
compareTo(PhoneListing):int, a comparison method that returns -1 if the calling PhoneListing object should precede the argument PhoneListing object, 1 if the calling PhoneListing object should come after the argument PhoneListing object, and a 0 if they are equal. Use last, first, middle, phone number as the ordering values.
example:Adams, Alex, Henry, (609)473-2101 Adams, George, Henry, (509)373-1101…
arrow_forward
Create a Visible interface with two methods: makeVisible and makeInvisible. Both methods should accept no parameters and return a boolean value. Explain how a class may implement this interface.
arrow_forward
public void actionPerformed(ActionEvent ae) {try {SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy", Locale.ENGLISH);Date lk1 = from.getDate();Date lk2 = to.getDate();long df = Math.abs(lk1.getTime() - lk2.getTime());long deiffrent = TimeUnit.DAYS.convert(df, TimeUnit.MILLISECONDS);day.setText(String.valueOf(deiffrent));if (day.getText().equals("")) {JOptionPane.showMessageDialog(null, "Day field is empty");return;}
int days = Integer.parseInt(day.getText());if (numofroom.getText().equals("")) {JOptionPane.showMessageDialog(null, "Number of rooms field is empty");return;}
int room = Integer.parseInt(numofroom.getText());
if (ae.getSource() == studio){
double f = room * 300 * days;String a = String.valueOf(f);double vat1 = f * 0.15;String b = String.valueOf(vat1);double total1 = f + vat1;String c = String.valueOf(total1);if (ae.getSource() == calculate) {ty.setText("STUDIO" + "," + lk1 + "," + lk2);subtotolfield.setText(a);vat_f.setText(b);totolfield.setText(c);}} else if…
arrow_forward
Refer to image
arrow_forward
Challenge exercise The following object creation will result in the constructor of the Date class being called. Can you write the constructor’s header? new Date("March", 23, 1861) Try to give meaningful names to the parameters
arrow_forward
When you want to run an activity code, when the activity is partially visible and going background,
we will write the code in the method
out of
O a. none of these
question
O b. onStart()
O c. onFinish()
O d. onCreate()
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education
Related Questions
- USE JAVA LANGUAGEarrow_forwardCreate a test project to play with the Comparable interface. Edit the Card class to implement Comparable . Cards are to be compared using their value. They are considered the same if they have the value. One is less than the other if its value is less. Add the compareTo method that takes a Card object as a argument and returns 0 meaning the values are the same, 1 meaning the card is greater than the parameter, -1 meaning the card is less than the parameter. Create a main() that creates a Deck. Use your code from the program that dealt out Cards from a Deck and showed the hands but this time, now that Cards are comparible, show them in sorted order using Arrays.sort if the had is an array, or Collections.sort if the hand is an ArrayList. Show the hands. Document, document, document!arrow_forwardThe Factory method design pattern is useful since it can be used to create new objects of a particular type dynamically. True Falsearrow_forward
- Objective: Write a class that will test dates and times inputted by the user and determine whether or not it is valid. This will focus on the usages of methods to organize code. First download the driver and put it in your project DO NOT ALTER THE DRIVER! Use this to run your project The driver : public class DateAndTimeDriver { public static void main(String[] args) { // TODO Auto-generated method stub DateAndTimeTester dtTester = new DateAndTimeTester(); dtTester.run(); } } Write a class file called DateAndTimeTester This DOES NOT have a main method Create the following methods run: This method returns nothing and takes no parameters. This is called by the driver and should handle all of the input from the Scanner and dialog for the user. isValid: returns true or false if a given String has the correct date and time. The String parameter should be formatted “MM/DD hh:mm” This method should call the methods isValidDate and isValidTime to determine this. isValidDate: returns…arrow_forwardMaking claims that fail Debug the programme.The issue: Normally, a failed assert only produces a message and causes the application to crash. Finding flaws with this is not really helpful. If a failed assert could launch the debugger, it would be much better.arrow_forwardPlease the code in Java eclipse. Please add comments for each instructions given in the image. I'll appreciate your help. And send the screenshoot of the output.arrow_forward
- 1. Create a program class, TestFrame, that contains a main() to test and use the above class. This process should contain methods as follows: main(): This method should: 1. Call makeFrame() to get the inputs and create a Frame object. 2. Call calcCost() to determine the cost of the picture. 3. Display the cost of the picture along with the attribute values. 4. Ask the user if he/she wants another picture. 5. If the answer is No, display the total cost of the picture 6. If the answer is Yes, implement steps 1 and 2 again (without a loop), then display: ● the number of frames created (through a variable) • total cost of the picture(s), and • average picture cost. 6. The program should then end. Class methods: makeFrame() A function to prompt the user for inputs and accept the four (4) input values needed to create an instance of a Frame. It instantiates a Frame object and returns the object to the calling method. follows: calcCost() This function has a Frame object as its formal argument…arrow_forwardThe class object is added to the class object. When a state change is recognized, the method in the interface is called. The ConcreteObserver the Observer interface.arrow_forwardCreate an interface called DVR that has methods that represent thestandard operations on a digital video recorder (play, stop, and soon). Define the method signatures any way you desire. Describehow a class might implement this interface.arrow_forward
- Complete MyProgram such that you can test all conditions In the Theater constructor you need to instantiate each seat object based upon the information passed to the constructor, making sure they are available. In the reassign method, make sure the from and to seat assignments are within range and return false if not. There is test cases included with this exercise, so when you submit your screenshot, it needs to show the test cases passed.arrow_forwardDesign an interface named Encryptor that has a single (abstract) method named encrypt with oneString argument named message. The method should return a String (which will be the encryptedmessage).Design a class named EncryptorOne that implements the Encryptor interface, and with one intinstance variable named shift. The constructor should have one parameter to initialize the shift.Implement the method encrypt so that each letter of the message sent as the argument (withlowercase letters) is shifted by the value in shift. For example, if shift is 3, a will be replaced by d, bwill be replaced by e, c will be replaced by f, and so on with a wraparound (i.e. with shift 3, x will bereplaced by a, y will be replaced by b, and z will be replaced by c). The method should return themodified version of the message. (HINT: The value of a character literal is the integer value of thecharacter in the Unicode character set. So, adding an integer (say, shift) to a character and type-casting the…arrow_forwardDoes a constructor have any means of indicating to a client that it cannot correctly set up the new object’s state? What should a constructor do if it receives inappropriate parameter values?arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education