Android project-several common application Architectures

Source: Internet
Author: User
Two tabs for android: TabActivity and ActivityGroup

Http://www.apkbus.com/blog-70574-40942.html

 

1. Single Activity Architecture (recommended)

The homepage is Activity, where the page is View

  • The bottom column of the header is public, but the text and pattern are changed.
  • The navigation bar at the bottom is RadioButton.
  • Slide switching is supported in the middle part.
  • The page jumps quickly, but the homepage is not smooth.

The advantage of this architecture is that the idea is clear and the system running overhead is small. The disadvantage is that the Code is messy if the control is not good, and the lifecycle is not easy to manage.

 

2. Multiple activities-use BaseActivity to provide commonalities

 

3. Multiple activities-use TabActivity

MainActivity (TabActivity)-> sub-Activity (BaseActivty)

  • Clear code and ideas
  • BaseActivity has the same backend and header bottom columns.

3.1 MainActivity (TabActivity)-> subactivity (ActivityGroup)-> grandson Activity (BaseActivty)

PS: Suitable for jump of multiple activities in one TabHost

3.2 combine Radiobutton and TabActivity to jump (the code is very clear)

4. Multiple Activity-ActivityGroup (officially marked as not recommended)

The Bottom Bar is implemented using the GridView, and the bottom is also implemented using RadioButton.

Forwarded to: http://www.cnblogs.com/TseChiHoi/archive/2012/09/06/2673978.html

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.