Android app for phone and tablet: 1 or 2 apps?

后端 未结 4 1999
北海茫月
北海茫月 2020-12-13 04:21

I have to develop an application for both Android phones as tablets. The application logic is the same, while the UI is completely different. I\'m wondering how I should dea

相关标签:
4条回答
  • 2020-12-13 04:37

    I have been mulling over the same stuff, although i already have my code layouts split out for tablet / phone variants I am looking for size optimisation by using two apps, however I set out a method for using ONE code set to build both variants.

    https://stackoverflow.com/questions/13956515/android-should-i-split-my-app-into-tablet-and-phone-variants

    0 讨论(0)
  • 2020-12-13 04:48

    Certainly make one application.

    You can create different layout files for phones and tablets. For tablets you should create extra layout file in res folder which is called layout-large (for tablets), for phone which provides default layout file, and at the same time for landscape mode you can create one more folder named as layout-large-landscape (tablets) for phones layout-landscape

    create extra resourse folders like this

    and add some tags to support multiple screens:

    1. <uses-sdk android:minSdkVersion="4" android:targetSdkVersion="9"/>
    2. <supports-screens android:anyDensity="true" />
    0 讨论(0)
  • 2020-12-13 04:50

    My Answer, one app. The iosched - Google I/O App for Android demo example from Google I/O explains everthing about how and what. Source Code available! Worth trying it!

    Apk Download Link : http://www.mediafire.com/?wck52jweyz1

    0 讨论(0)
  • 2020-12-13 04:58

    Certainly make one application.

    Android is perfectly designed to be targeted to various devices, its automatic resource selection from res/ folders depending on device's capabilities is big help for you. You can have completely different screen layout for large screens vs small ones, for portrait vs landscape, for tablets vs phones, etc.

    And your code is written/maintained just once.

    Of course, you would make come conditional code depending on if your loaded layout has particular view, for example loaded only on large screen, and conditionally fill there additional data if its present.

    Read documents on Android developer site about how to support multiple screens, multiple Android versions, compatibility modes with older Android versions, etc.

    Also, if you ship just one app, you get single users' feedback / rating on Android Market, not in 2 separate apps.

    0 讨论(0)
提交回复
热议问题