Explain the different navigation types, Android - android

I've been setting up an app for awhile now and now that I know exactly what I'm doing, I'm ready to pretty much restart and make a new version that's more user-friendly. While creating the app, Eclipse want to know what navigation type I want.
None
Tabs
Tabs+Swipe
Swipe View+Title Strip
Dropdown
Can somebody either explain (or give a link to something that explains) what the bottom four options look like and how to use them? So far all I've used is the 'none' option and I simply used buttons and a menu to navigate. I'd like to learn about the other options to make my app as sleek as possible.
--This part was answered: http://android-er.blogspot.com/2012/06/various-navigation-type-provided-in-new.html
But the 2nd part of this question:
Is is possible to have one navigation at one point in time and another type of navigation at a different time?
Example: Start-splash screen, go to login screen. Once logged in, go to a menu. If they pick 'edit forms', it brings them to a Swipe Views + Title Strip setup where each different view is a different form.

Is this what you want? It was the first search result. http://android-er.blogspot.com/2012/06/various-navigation-type-provided-in-new.html

Is that what you are looking for?
Android Developers

As the first part of your question has been answered and i cannot yet comment, i will consider this an "answer" to your second question:
It is not typically considered appropriate to post multi-part questions on Stack Overflow. Why you may ask? For situations exactly like this one. You have half your question answered and accepted that answer as the correct one, However... What of the second question? What if someone decides to answer it and gives a good answer. Only one person may have their answer marked as correct. And considering that those ratings change the level of interaction you may have on Stack Overflow, It would be wrong to accept one half and not the other simply because they were given by 2 different people.
If you have a question that is in some way a subset of your first, leave a comment on the answer in which you need elaboration. ie: (Question 1 = "What is a class?"; Question 2 = "Why would i need such a functionality?";)
If you have a question that is a fork in your first thought, create a new question. ie: (Question 1 = "What is a class?"; Question 2 = "What does it mean to instantiate an object?";)
If the core subject matter is different, you should create a new question. Otherwise you leave a comment. But never put 2 questions in 1 unless they would have the same problem / solution.
anyways...best wishes, on a year old post =P

Related

1000 questions in android need to create 1000 activities?

I'm doing a app that will ask question to users like:
what is the capital of australia?
Camberra - paris - washington - toquio
and I will have 4 options, so user can select the right one.
When it choose the answer the next question will show.
I'd like to know if I need to create one activity for each of this questions/answers or there is another method? can I have examples?
'You can use Viewpager or viewFlipper for that purpose. in this way you can show all of your's questions in one activity'
I would change dynamically the content of the question and answers components.
If you animate the changes in those components it will look really nice and you'll be saving resources that you would waste creating an activity for each question.

Android Design: Activity only or Fragments?

I am working on an app for school children. Basically, there would be questions with multiple choice answers as in image below. Main requirements are:
Each round of a test will have 10 questions (configurable)
Questions with answers are loaded from an api
The test is timed. So each question will be visible for 10 seconds and then the next one will be presented, maybe with some animation/slide effect
My question is which of the below is the better way to do the above?
Have the questions and answers appear in a UI fragment while storing data in a model fragment. New questions are provided by wiring up an adaptor.. something like a ViewPager without swipes
Everything is one Activity. Change the question and answers by changing android:text using maybe a handler and postDelayed()
Is option 1 better as it might handle Config changes better? Or is it easier to just use option 2. Thanks..
If you don't intend to have fancy UI, go for Option 2. And architect your code using MVP approach, where the logic is in the Presenter, and the View portion handle by the Activity.
You could read more on MVP in http://antonioleiva.com/mvp-android/

Android Questonnaire layout approach

I want to create a questionnaire but I'm not sure what is the best way to approach this. I'm pretty new to Android but at the moment I have a working app which has a main activity screen which has various options. One of them is to launch the questionnaire. I have created a single database table which contains 4 columns Question Number, Question, Answer, Explanation. The explanation is displayed when the user selects the incorrect answer.
I am envisaging that the screen will be simple enough, just a textview containing the question and 3 buttons, 'YES' 'NO' 'BACK'. I plan to have 15 questions. What I'm wondering is do I have to create an activity for every question and every explanation even though the layout is going to be the same from one question to the next?
Definitely not!
Do this the way you would in any other application. Put your questions in some kind of list and iterate through them. Set the content "question" view, in your layout with the successive values.
... and remember to save the position in the list across Pause and Resume!
Ultimately to get this to work I had to use a counter which I incremented after each successive question. No list was required.

need guidance on how to create a questionaire for android

I have a task to create 10 questions where a user should be able to input the answer by using a touch keypad. The user should be able to cycle through questions by pressing a button called "N" Once the the user answers all of the questions a total score out of 10 would be displayed.
Im not asking for an answer but how to approach such a task.
So far ive created a keypad consisting of numbers and i can get 1 question to work and display whether the user entered correct or incorrect information but trying to get more then 1 question to work is messing up.
I had a thought and know that i can create 10 seperate activities for 10 questions but thats slightly crazy.
Can someone give me guidance on how to approach such as task
note im pretty new to android.
Thank You
All views have a visibility attribute (android:visibility); what would look nice is every time the user presses next is to simply hide the old view and make the next one show up (Can even add a fading transition to make it look fun as well)
In XML you can set them all to android:visibility="gone" to begin with, and then in your code, set it to objectName.setVisibility(0) to make it visible, and objectName.setVisibility(8) to hide it completely again.
Here is one approach (not necessarily the best):
*Wherever your question is (hopefully a TextView), get a reference of it in your activity.
*When the user answers a question, output if it was correct or not (A toast?)
*Change the TextView to the next question
You can programmatically add and remove views. You could create an empty view with just a linear layout then add and modify the existing views as you need them.
Are you writing it as a native Android app? A web-app (HTML, Javascript) could do what you're asking, and could be turned into an native app with embedded webkit view.

Design advice: multiple choice quiz

I'm interested in hearing what you guys think is the most efficient/solid object-oriented design for a simple multiple choice quiz.
Basically, the app presents a series of questions with 4 choices each. If the choice you selected is correct, then a new activity will display some congrats and full details behind the correct answer and if you're wrong it'll say you got it wrong, along with the details, etc.
After that, the user goes to the next question. On each new question, you'll see your score so far. So maybe you get 50 points for each correct answer, something like that.
Here's how I thought about implementing this: Create a custom view with some radiobuttons or some other widget that could be used for choosing an answer. The custom view takes a Question object, which is just a regular old java object, with fields for choices 1-4. Then, in the custom view, I can set the text of the radiobuttons to the choices from my Question object.
So in my activity it would look something like Question myQuestion = new Question("string for choice 1", "string for choice 2"...)
And then..
Use the question with my custom view. QuestionView myView = new QuestionView(this, myQuestion);
Ok so that's all great. I'm just wondering if I'm setting myself up for trouble. For one, I've got to keep track of the score across all the question activities. Does it make sense to have all of my questions subclass some, mostly empty, activity that I create which can have a counter in it that gets incremented anytime the user gets an answer right (i.e in my superclass activity int scoreKeeper; and in each activity that subclasses this activity: if(choiceIsCorrect) scoreKeeper++). This will allow the score to persist across the activities. I realize I could hold a score between activities by passing and extra to each new activity and then simply adding to it, but that doesn't really seem to make sense to me.
Sorry for all of the blabbering..but I guess my questions are: what do you think is the simplest design for this? Also, in general, I always assumed that you should always use a new activity whenever the user is doing a "single, focused thing"...as the Android paradigm states. But sometimes it feels weird to create so many activities. I know the fact that "it feels weird" is no reason not to do it, but when does it make sense to simply reuse on activity (e.g. in this case, just swapping in a new question in my activity and updating the UI accordingly) as opposed to starting a new activity?
Also, a more detailed question - what would be a smooth way to set which choice (e.g. which radiobutton) contains the right answer, so that when the user presses submit, I can check if they have the right answer and yes/no then react accordingly?
To summarize:
What is a straightforward, object-oriented way to create a succession of multiple choice question activities?
What's the most sensible way to keep track of the score?
Does each question necessarily need to be a separate activity? (And, in general, how do you guys approach the question of whether something ought to be a separate activity?)
Also, kind of a particular: what's the easiest way for me to flag which choice is the correct one so I can check to see if the user got right? I know that with a radiobutton, for example, you can use onCheckedChangeListener and retrieve which radiobutton is currently checked, but I'm not sure how to use that in my design to check if the user got it right...
Thanks!
I would not make the "correct/incorrect information activity" its own activity. Instead, when the user selects a radio button choice, and then clicks an "OK" button, a Dialog should pop up. When they close the dialog, there is a button there to advance to the next question.
I would say you should do this all in one activity.
I'm going to use one activity with a ViewFlipper for cycling through questions.

Categories

Resources