Best practices for implementing a multi-level Option Menu on Android? - android

I'm currently working on a port of an iPhone app into an Android. The iPhone app has a custom global navigation menu at the bottom of the screen, and when bringing this over to Android, it was suggested to replace this custom menu with the generic Option Menu (invoked via the option key on the device) to give it a more native Android look and feel.
The issue is that the menu itself has several layers (e.g. Three main option like A, B, C, and sub-options like A1, A2, A3). I've looked around but have not seen this sort of multi-level option menu on Android apps, so am looking for some guidelines on how this may be best achieved.
I've seen some questions on customizing the Option Menu such as this one; Android: customize application's menu (e.g background color); and they seem to suggest that the native framework doesn't support many options.
Should I be looking at a bit of hacking into the option menu (is this a good idea?), or looking at some other approach to modifying the app flow? Trying to understand what would be the best way to maintain a consistent user experience on Android, while reducing the level of variation from the iPhone app.
Thanks!

I've looked around but have not seen this sort of multi-level option menu on Android apps, so am looking for some guidelines on how this may be best achieved.
Options menus support sub-menus, but only one level deep (i.e., the menu can have a sub-menu, but a sub-menu cannot have a sub-sub-menu).

If you really need that (and want to violate the Android platform standards regarding menu depth), then you can easily implement this by using an AlertDialog with lists for every nested level of your menu. Visually those appear exactly the same like an options menu.

I've done something similar to what banana suggested. I would just add the reasoning behind the limitation is the myriad number or devices and screen resolutions that need to be supported. Multiple nested menus might look good on a tablet but not on a 5 inch screen so we need to keep that in mind.

For me, adding
android:onClick="onOptionsItemSelected"
to nested menu items worked.

Related

What is the current method of implementing an options menu in an application?

I am relatively new to android development and I'm having a good time so far. My application is functional and I'm ready to add a few options for the user. There seems to be a wealth of information on the ways to do this and I'm having trouble sorting through it and determining which way is the current "accepted" method of providing options to the user.
Does anyone have a great resource to share?
It really depends on the particular app, existing UX, branding and a ton of other design considerations.
In general, starting from scratch, a good starting point (though not universally!) would be the action bar. It gives the user access to ways of manipulating the data on screen, as well as a way of consistently presenting secondary functionality (the overflow menu). Design docs, implementation docs.
I would heartily recommend going through the Patterns section of the design documentation, as it explains the rationale behind many of the core design decisions.
P.S. The reason I'm eager to underline that it's not universal is apps with established UX and user expectations. Examples include Facebook, Path, Google Maps. They all have their reasons for not sticking strictly to the action bar paradigms but they work with it as much as they can.
This Menu Doc page is particularly helpful. But basically if it is API < 11 then you use the hard menu button for an options menu. After 10 the menu items will show in either the ActionBar as action items or in the overflow button. But can still be located in a hard menu button if one exists.
You also always have the option of a contextual menu, primarily with a long click, for things like certain menus depending on the View that is triggered. So maybe show an edit, delete, save menu for a list item.

clients still want lower screen iphone tabs on android, solution?

clients want exact replica app on iphone and android. the iphone design is the only one thought about, and it frequently has tabs on the lower part of the screen
in android, this can be replicated but the primary way of doing this was deprecated, for various reasons. (tabhost, tab groups, activity) android's replacement methods include action bars and viewpagers and fragments with a varying degree of backwards compatibility but they don't really put the resulting tabs at the bottom of the screen.
similarly, multiplatform web app tools like Sencha Touch can generate intuitive "bottom tabs" on both platforms. So for Android there are still a variety of ways to do bottom tabs, so it would be fiction to tell a client that they need to change their iphone design for android
how do developers and consultants approach this. any best practices?
I don't quite know what you're asking for. If it's a programming solution, then someone who's made bottom tabs before could answer. I've never done it, so I don't know if there's an easier way than the brute force do-it-yourself approach.
If it's a consultation answer, then the best approach that's worked for me is to convince the client that the "Android way" is to put tabs on the top. As such, people who use Android phones regularly come to expect a certain way things are done. Especially since ICS came out, soft buttons have been moved to the bottom of the screen. These can't be shifted, moved, or removed and having tabs on the bottom could result in the user accidentally pressing either back, home, or process-list.

android pop up menus

I cannot find either one of these two views in the source, but have seen them both in many apps. Can anyone please tell me what they are called?
Thanks
The second one is an options menu from the action bar. I think it is implemented as a ListPopupWindow.
The first one is not part of the Android SDK, though there are various implementations floating around. Here is an example of one designed for use with Google Maps, for example. Here is one designed for the "quick actions" pattern.
I'm going to assume that they're custom made ones, so you won't find them in the standard Android libraries.
The second one I think is just the way that the default menu looks in ICS (and honeycomb for that matter). If you build for 4.0 and include the code for an options menu I think you'll get that UI by default. If you are looking to customize it check out this page http://developer.android.com/guide/topics/ui/actionbar.html and pay close attention to the "Adding drop down navigation" section.
The first one is not a part of the android UI, that is something specific to the facebook app.

android menu vs android tab bar

What would be better to integrate in the application- all options (for new screens) in menu, customized for each screen or have it on top of screen as tab bar- squishing the screen? what do normal android users prefer using? and from design perspective is it okay to keep changing items in menu bar in the app?
It should be a combination.
Different Views into your app data can go as Tabs.
Quick actions like search can be ActionViews.
You can also show different tabs depending on the context.
An old question but for future generations:
In my case, it was the task to replicate an existing iOS app with iOS UITabBar, so playing with the bottom-navigation Android pattern I found that it is much easier to use FragmentContainerViews than the official bottom-navigation pattern from the Android Architecture repository. Check the repository, there's a test application that you can run to check if the solution matches your expectations: https://github.com/Codeveyor/Android-Tab-Bar

Android equivalent of top level menu

Desktop apps have top level menus (File, Edit, Search, ..., Help).
Web apps have very similar thing, menu tabs (Logo, Questions, Tags, Users, Badges, ...).
However I cannot find equivalent of top level menu in Android framework. Assume that my app has 5 main activities. According to menu design guidelines options menu should contain actions related to current activity. So how an app should allow users to easily switch to one of five main activities.
It seems that different apps solve the problem in different ways. Some have a tab list at the top of the screen, some at the bottom. Even Google applications aren't consisted in that field. Google Listen has an options menu item called 'Listen Home', however Listen main activity has no that options menu item. Others have two icons in app luncher which start two different activities from one app.
I realize that due to small phone screens Android apps have to be designed in a slightly different way than web or desktop apps. But I have a feeling that the app top level menu topic was omitted in Android framework. And developers are on their own here. Or am I missing something?
Update: this is Google blueprint for a great app
Update2: this an example app of these patterns
Update3: GreenDroid library helps a lot implementing these patters in your apps. It seems that dashboard and action bar patterns are becoming quite popular.
You should take a look at this Google I/O session: http://www.google.com/events/io/2010/sessions/android-ui-design-patterns.html
They talk about the design patterns they used for the Twitter application and basically the type of concept you are asking about. Basically, your activity should have a top bar that gives the user specific tasks to do in the view or allows them to switch into another activity.
Google has not implemented anything like this into the actual SDK yet so you're sort of on your own in terms of implementing it but the main concept is given in the presentation. This is the direction that Google would like to see Android shift into though.
Hopefully this helps you out somewhat.
The file/edit menus of desktop apps have a very different purpose than the questions/tags etc. tabs at the top of this webpage.
The contents of the file/edit menu should be implemented as in the options menu that appears when you press the menu button. This is, as you noted, to save space on the smaller screens.
App navigation like the questions/tags etc could be implemented using a Tab Layout. You are right that apps vary in whether or not the tabs are on the top or bottom, but I don't think thats a huge deal. In my unscientific look through apps on my phone, the bottom seems to be more common. However, I think it might depend on your specific implementation which you decide.
A lot of apps don't require any sort of navigation like that, and can get away with just having a path forward or back via the back button. I think this is preferable for a lot of applications, but won't work in all cases.
I'm not sure what more you would want built into the framework.. It seems like you can accomplish any kind of navigation desired with the above options.
You can look at the source of the Google IO app
ioshed

Categories

Resources