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

后端 未结 4 2018
北海茫月
北海茫月 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: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.

提交回复
热议问题