Multi-Activity App

Discussion in 'Android App Developers' started by cruskai239, May 18, 2011.

  1. cruskai239
    Offline

    cruskai239 New Member

    Joined:
    May 15, 2011
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    Ratings:
    +0
    I'm making an application that will have multiple pages. I've thought up two ways to do this.

    #1: Use different activities and intents (the way every tutorial does it).

    #2: Use a switch statement to "simulate" changing pages on the button push without actually changing activities.


    Which is more efficient for both speed and file size?
     
  2. naDroid.com
    Offline

    naDroid.com Member

    Joined:
    Feb 16, 2011
    Messages:
    31
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Canton, OH
    Ratings:
    +0
    Just a thought

    Not sure which is more efficient or if the difference in file size would even be noticeable but I would advise against this. The reason everyone does it in separate activities is because that is just the proper way to do it.

    This makes your code both more readable and more maintainable.
    In my experience it also makes your code less prone to bugs that can be introduced in complicated if/switch blocks.

    Just my 2 cents though. If it's easier for you and you are the only person that will ever touch it, then do it how you want. I just don't think you should base it off of an efficiency question since any difference will not be noticeable.
     
Search tags for this page
android dev activity with two pages
,

android multi page app

,
android multi page app tutorial
,
creating multi page apps in android
,
안드로이드 멀티액티비티
,
intents in multiactivityapp android