开发者

Single Activity Application

I will try to keep this short, but I need some advice.

I work on a team that is developing applications for android, iphone, and wp7 in parallel. We hav开发者_运维百科e a design team that comes up with a single design for all three platforms.

The latest application’s design is more marketing than productivity. The original POC for this app was done on the iphone. The design is very animation centric and most state changes are seamless (things will animate on and off the screen during state transitions).

If I keep developing against this design it means I will have to have everything in a single activity. So far, this has been a major headache. To my knowledge, dividing your application into activities is almost required. I could try to dynamically load and unload views as I change states but this doesn’t seem right.

I see where the design team is coming from where they want all these state changes to be seamless, but I don’t think this is right for android.

I would like to know what makes most sense. Should the design change to incorporate multiple activities or would it be worth trying to make this work.


We have a design team that comes up with a single design for all three platforms.

That's akin to coming up with a single floor plan to be applied to apartments, single family homes, and warehouses. The designers, or management, need to have their heads examined.

The latest application’s design is more marketing than productivity.

Did I mention that the designers, or management, need to have their heads examined?

If I keep developing against this design it means I will have to have everything in a single activity.

If I am interpreting your requirements correctly, that is probably accurate. While you can arrange for animations between activities, it is more of a "slide the old off, slide the new on", and I suspect that your requirements exceed that.

To my knowledge, dividing your application into activities is almost required.

It is certainly Android's intended development model for ordinary apps. However, games and the like may not follow this pattern, and you don't have to either.

I could try to dynamically load and unload views as I change states but this doesn’t seem right.

Depending on how many states there are, you might just hang onto all of them, recycling as you go.


I am surprised no one mentioned fragments which can be used instead of activities at many places.

Fragments can be seamlessly animated in and out or an activity.


You might want to take a look at subclassing ActivityGroup for your top-level activity. That can host multiple sub-activities. TabActivity, the only stock subclass of ActivityGroup, is perhaps not what you need because it includes a tab widget, but you can use it as inspiration for what you do need.

What specific headaches are you having with a single-activity architecture? Perhaps there are ways to make that less painful.


In general, if you are aiming to have native apps with a native look and feel, it is not reasonable to have a single UI design for all three platforms. The UI guidelines and user expectations for the systems are different, and those differences should be reflected in the UI designs.

If you really want to have a single UI for all platforms, just create a web app instead.

I'm not sure exactly what you mean by an "animation centric" design with seamless state changes. If you use multiple Activities, Android will animate between them in a way that Android users will expect. If you explain what exactly you are trying to accomplish, we can help you figure out if it makes sense in Android, and if so how to accomplish it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜