Question

In Android Studio, how can I make a shape change color based on information read from...

In Android Studio, how can I make a shape change color based on information read from a database? (Java and xml code would be most helpful)

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

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid
android:color="#FFFF00" />
<padding android:left="8dp"
android:top="8dp"
android:right="8dp"
android:bottom="8dp" />
</shape>

<TextView
android:background="@drawable/test"
android:layout_height="50dp"
android:layout_width="110dp"
android:text="Moderate"
/>


so now you want this shape to change colors based on the information that you get back from web service call so that it may be red or yellow whatever it may be depending on the color i receivrd from web service call

Add a comment
Know the answer?
Add Answer to:
In Android Studio, how can I make a shape change color based on information read from...
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
  • (Android Studio) (Mobile App Development) Create a spinner that has drop down function on it (NOT...

    (Android Studio) (Mobile App Development) Create a spinner that has drop down function on it (NOT tab view). Place a scroll bar inside the dropdown of the spinner. The categories inside the spinner include: vegetable, fruit, meat, drink. Clicking on each section will pop up a fragment section below. Here, I clicked on the vegetable section, which leads me to a page displaying vegetables and their expiration dates. Note: Post XML and Java codes for both the main activity and...

  • (Mobile-Android Studio) Hello. Thank you for coming to help me:) I am using the Andriod studio...

    (Mobile-Android Studio) Hello. Thank you for coming to help me:) I am using the Andriod studio on mac. and using Java code to develop. and Please start with basic activity with constraints layout (not empty). (audio file is not given, let's say there any audio file). I just would like to see the codes how it works. Thank you very much. I would like to know how to write a program that includes two buttons called plays Play and Stop....

  • NOTE: by using Android Studio .Please if you can provide SCREENSHOTSresults and process is the most...

    NOTE: by using Android Studio .Please if you can provide SCREENSHOTSresults and process is the most important parts. NO ONLY NEED CODE BECAUSE I HAVE IT AND DID IT BUT NEED JUST YOUR RESULTS PHOTOS AND PROCESS THATS COULD HELP ME IN MY PROCESS. Project 2: Course Management App Project description: This android app helps student manage their courses. It enables a student to check the course details(lecturer, term, credits), browse his or her courses, add or remove a course....

  • (Android Studio) Create a camera app that allows the user to upload a picture from their...

    (Android Studio) Create a camera app that allows the user to upload a picture from their phone camera gallery, see the picture via summary page, and edit the picture as well. Clicking on "Insert picture here from camera photo gallery" in the add page will allow the user to upload a picture from their existing camera photo gallery on their phone. The user can choose where to save the picture, starting with Picture 1-5. Once they choose where to save...

  • 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...

  • • Create an Android Stop Watch mobile application based on the below requirements: ◦ The Stop Watch App will display the...

    • Create an Android Stop Watch mobile application based on the below requirements: ◦ The Stop Watch App will display the time as: ▪ HH:MM:SS.mmmm Where HH represents the number of hours; MM represents the number of minutes; SS represents the number of seconds; mmmm represents the number of milliseconds. For example, ▪ 02:09:57.1234 The above time example would read: ▪ Two hours and ▪ Nine minutes and ▪ Fifty seconds and ▪ One thousands two hundreds thirty four milliseconds...

  • I need help developing this app using java in android studio Assignment: Tic-Tac-Toe app User interface...

    I need help developing this app using java in android studio Assignment: Tic-Tac-Toe app User interface Operation The app allows the user to play a game of Tic-Tac-Toe. The user can click the New Game button at any time to start a new game. The app displays other messages to the user as the game progresses such as (1) whose turn it is, (2) if a player wins, and (3) if the game ends in a tie. Specifications The app...

  • Please help me with this project by using Android Studio. I need to know the xml...

    Please help me with this project by using Android Studio. I need to know the xml and the java activities in both activities. Also the manifest activity. I appreciate the effort and I'll rate you with 5 stars. 1. SUMMARY This project will simulate the card game Concentration for one player. In Concentration, all cards, or pictures in this case, are upside down. Two cards are chosen, and if they match they are taken out of the game. If they...

  • How to modify a color image to remove lightness factor from an image. Using visual studio...

    How to modify a color image to remove lightness factor from an image. Using visual studio c++ code. What are possible applications of what you have done, and why we might need to remove luminosity channel from the image.

  • How do I read an MSDS or SDS sheet? Out of all the information put there,...

    How do I read an MSDS or SDS sheet? Out of all the information put there, what information is the most important? Based on the inputted information, what precautions would be take for the compound or material? How do I find it on that sheet?

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