Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How many activities should I use? [closed]

Tags:

android

I'm starting Android doing an application for searching restaurants, and some guidance would be welcome! On the first screen I'd like to have a search field with a submit button (I get the data from a web service), and below a list with the results of the search. When clicking on one of the items of the list it will show a screen with the restaurant details as well as a map showing its location. My questions are:

  • Can I do everything in one single activity or should I do an activity for the search, one for the result list, one for the restaurant description, and another for the map?
  • Would doing one single activity make the application more responsive?
  • How can I use a list and a map within a normal activity (without ListActivity and MapActivity)?
like image 322
jul Avatar asked May 06 '10 15:05

jul


People also ask

Should your activities list be in your own words?

I know, some of you are probably wondering: “But Ethan, which verbs should I use?” Behold … As with a resume, you want your activities list to be in your own words, to sound like you. Overwriting can make it sound like you hired a professional to write it, which can detract from your application.

How many values should be in an activities list?

If your Activities List shows a nice variety of 10 or so values, that’s enough. Really. Once you’ve got some great verbs and some great content, here are: 1. Aim for variety, making sure your verbs aren’t redundant. Instead of: Instructed, helped, taught children tennis (how are these three different?)

How many characters do you get on the activities list?

The Epic List of Activities List Verbs 2. The BEABIES Exercise 3. The Values Scan You only get 150 characters on the activities list for the Common Application. How do you make the most of them?

How do I write a great activities list?

I think one of the best ways to write a great activities list is to look at some really solid Common App activities section examples (which I’ll share in this guide).


3 Answers

Can I do everything in one single activity or should I do an activity for the search, one for the result list, one for the restaurant description, and another for the map?

The answer to this really depends on the flow of your application. I think the most important thing to keep in mind here is how the user will control your app with the "back" button. When you create a new Activity, that puts it on the stack, and the user can always press "back" to pop it from the stack.

One extreme is to put all these steps into different Activities. Then the user has ultimate control using the "back" button, but they might get annoyed jumping around Activities. Putting it all into one Activity is the other extreme, and I highly advise against that; users expect new screens to be a different Activity, one that they can "back" out of, and so if you put all your eggs into one Activity you'll have to start handling "back" yourself.

I think there's a good middle ground that your app could take, though of course your UI design may differ than what I propose. I would say you could do this in two Activities; in the first, you have a search field at the top (with a submit button next to it), and below that search field is a ListView which is populated with results. In the second, you use a TabActivity, where one tab is for the description and the other is for the map. I think this is advantageous for two reasons: on the first Activity, the user sees the results of their search on the same page as the search, and can quickly change the search parameters if necessary. And on the second Activity, the back key encapsulates backing out of one restaurant.

Would doing one single activity make the application more responsive?

Not really. Activities take time to create/tear down, but not that much time. It's better to segment your application in a logical way (for the user experience).

How can I use a list and a map within a normal activity (without ListActivity and MapActivity)?

You can get away with a ListView inside of a normal Activity without ListActivity; just include a ListView in your Activity's content, then in code grab the ListView and set its adapter manually. All ListActivity does is add some handy wrapper functions for one primary ListView, but it's not necessary at all.

Maps are a different matter. You will need to use a MapActivity for displaying maps, because MapActivity has special setup and teardown code that needs to run. Sorry.

like image 185
Dan Lew Avatar answered Oct 06 '22 03:10

Dan Lew


I would like to add some guidance to Daniel's excellent answer.

Users can't tell the difference between one activity with views that change and multiple activities each with their own view - until they press the back button. So it is actually quite important that the back button should have a natural and logical purpose in relation to what is on the screen when it is pressed. The user should never be surprised by what happens when they use it.

So for each activity you have, ask yourself if the behaviour of the back button is logical to the end-user at all times. If you find a scenario where it is not then you should look at refactoring your activities - which could involve combining two or more activities into one, moving some responsibilities from one activity to another (but keeping them both), or even splitting an activity in two.

Creating a user interface that behaves logically as the user navigates around it is important, and the more your application does (and the more navigation there is) the more important it becomes. Unpredictable navigation behaviour stops people from learning how to get the best out of your application at the time when they are most likely to uninstall it - in the first few hours after downloading it.

like image 21
Phil Haigh Avatar answered Oct 06 '22 03:10

Phil Haigh


I would have an Activity with both the search and list, then another that shows the details of the restuarant.

I don't think it would work well with just a single Activity.

Activities can contain multiple views - a single activity can contain a map and a list if necessary.

like image 37
cjk Avatar answered Oct 06 '22 03:10

cjk