Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am trying to create a program that uses a set of checkboxes and numberpickers/number input regions to work out the price of an object.
I am just starting out with android, and I can't figure out how to do this, despite looking around a lot.
Here is a dropbox link to the image of what I have created and ideally want in xml
This is basically what I have set up using the XML. The checkboxes at the top relate to different grades of foam which all have different prices, and then the numberpickers will allow selection of the size and thickness of the foam.
So obviously I imagine there will be a fair amount of code to make this work, but I first off I really need to know how to get the values of the sizes, and get which box is checked.
Then how to use the checked box and the values to work out a price. I suppose I might need to start a new activity for each of the checkboxes?
You for sure do not need an activity for each component.
In general, what you will want to do is wire up the components to the main activity (e.g. EstimatorActivity or whatever you are calling it) such that as each one's values are changed, methods on the activity are triggered. The controller in an MVC design is a coordinator. The gang of four pattern Mediator is often used to explain this role: the model should not know the specific details of the ui and the ui components should not be bound to the model. (Also, the eventing of the components is really not part of the model.)
When you do interfaces like this, generally you will have some class that produces the estimate. You will create an instance of that when the activity is created, then as the change events occur, you will invoke the calculator again with the new values and update the result field.
Really not that complicated.
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 days ago.
Improve this question
Create a Notes App in Android – Full code and simple explanation
Project Requirements:
The project should have the following advantages:
Develop a master Activity that displays memos or tasks in a list that the user adds.
Develop an Activity that enables the user to enter a new memo or task. This activity sends data entered by the user as a result of the activity you called. Note: Do not allow the sending of blank data.
Use the activity you developed by adding a button to add a new memo within the main activity that contains the list.
This application provides three types of memos, and the item for each memo in the list must be displayed in a different CardView format that contains data to express the type of memo.
For the view, you can use StaggeredGridLayoutManager. It is used to replace both GridLayoutManager and LinearLayoutManager in the RecyclerView to display items in a distinctive way.
The user can click on any note to modify its content. So you'll need to develop Activity to view the memo details. A note can also be removed by long pressing.
A class must be created to represent the data of each type of memo. These classes will be used in the list to display data. Note: You can use the concept of inheritance and if statements to be able to use more than one class to display data in a single list.
Extra points: Change the important background that has been accomplished to green.
Correct and learn from mistakes
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 months ago.
Improve this question
I want to develop an android app and my app must show a matrix of elements where some are connected by a line (like paths). I'm programmer but I don't have a clear idea on how to do this (the graphical part) because still I'm starting in android development, but if you have an idea please to resolve this graphical problem, give me some help then I would research more about it.
Note: I want to create an app for my college, where an student could mark their passed courses, and there are courses that must be marked (passed) to mark others and know their progress on the career.
Like this image..
Use Grid View because GridView is a ViewGroup that displays items in a two-dimensional, scrollable grid. The grid items are automatically inserted to the layout using a ListAdapter. to Achieve your goal you must use custom grid view to make that but am not sure about the lines.
check out this tutorials it would help to make that .
Example 1:
Example 2
Example 3:
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I want to create an landing view for my application a user log in they need to land on this activity page (Image 1) if they click on any of the icon they will be take to the activity page of that activity. I want it needed to be change when user turn their screen to vertical or horizontal. But I don't know where to start.
Below I have added two images to show what I want to implement in my application. This is for my college project. In the landing view it have alert box and another box text from MySQL database but I am stuck in all points.
Image 1
Image 2
what you need is a dashboard activity/ fragment...
something like this.
the rotation of the screen is not a big problem, in fact, with the sdk you can design your activities and define behaviours of completely other layouts depending on the screen size, orienttation etc...
The work to do is not complicated but you need to do couple of stuff first, (define some layouts, classese etc,)
my recomendation is to take a look at this tutorial, and develope your app by following this steps
1 -
you can do it by set ImageButton in your main layout when click in any image will open new layout
show this link is simple code but he use button you can make some code and use ImageButton not Button only convert type name from button to ImageButton
this is link= : https://stackoverflow.com/a/10936133/4967569
2 -
screen to vertical or horizonta
i think you need use any size by Formula "dp"
3 -
sorry i cant help you in Database I have No experience
I am working on a simple quiz application for Android. It has 10 questions and displays them one by one. Each question has three options. When the user answers a question he's redirected to the next one.
I'm not sure what's the right way to implement this.
I guess I shouldn't make 10 different activities with the same look, just different text inside.
Probably I should reuse the same one, but how? And if I do, how'd I know which one is the 10th one in order to display the score after answering that one?
You can use a Listeners and an integer which contains the current question. You can use the switch from java to filter the value of the integer.
You may make array of questions and answers , then make a button to navigate to next index of question and loop up to the size of arrays.
I tried to create an expert system using eclipse.
In the expert system that I created, the user does not input the answer "yes" or "not".
But a more-Specific answers.
The concept layout that I use as a quiz.
Any answer will lead to the next layout.
The difference is the number of choices for each question has a different answer.
I have 10 questions.
Example:
1. The first question has answer options 3 (a, b and c)
2. The Second question has answer options 2 (a and b )
3. The Third question has answer option 4 (a,b,c and d)
What confuses me is the making of layouts.
So far I think to make a layout for any questions I had, because as I said earlier, each question has a number of different answers.
I want to ask is whether the 10 layouts that I created earlier can be replaced by only 1 layout?
1 layout which can be used for all the questions I had.
I hope you understood what I want to ask you
you can create a list that holds each questions answers. this way you can create a ListView that will hold your answers.
this should be a simple way to have one layout.
a simple ListView tutorial:
http://www.vogella.com/tutorials/AndroidListView/article.html