Re: Developing for AWT/Swing and Android portability

Discussion in 'Java' started by Stefan Ram, Aug 14, 2013.

  1. Stefan Ram

    Stefan Ram Guest

    Martin Gregorie <> writes:
    >are there any decent Android emulators that can be used to
    >develop Android graphical apps under Linux?


    The standard Android SDK contains an emulator (which can be
    somewhat slow).

    >Are there any decent compatibility packages that would let a Java
    >graphical application compile and run on both Linux and Android platforms?


    The emulator can execute Android software under Linux.

    Otherwise, Android applications (especially user interfaces,
    but also other parts) have to be structured differently than
    Swing applications from the beginning (from ground up), so a
    compatibility layer is difficult and one would have to forgo
    many features of Android or Swing using such a layer.

    However, one can split an application into two parts, which I
    here call the »application-specific processing library«
    (ASPL) and the »platform-specific application proper« (PSAP).

    The ASPL contains code for data storage (in containers, such
    as java.util.list) and data processing and uses solely the
    common subset of both Java implementations (i.e., of Android
    and of Java SE). It is a library written specifically for
    the use by the specific application (it might, however,
    itself delegate to other, more general, libraries).

    The two PSAPs contains everything that depends on the
    platform, including the methods »main« or »onCreate«,
    respectively.

    So, you have to write a new PSAP for every platform, but you
    do only have to write one ASPL. Start by writing the
    application for one platform first, building the PSAP and
    the ASPL at the same time. Try to move as much code as
    possible out of the PSAP and into the ASPL. You can even
    refactor an existing application this way, starting with an
    empty ASPL and the whole application being the PSAP, and
    then step-by-step moving parts into the ASPL. Then, write a
    new PSAP for the next platform, but now you can /reuse/ the
    same ASPL. (If the splitting was not done with both
    platforms already in mind, some changes to the ASPL might
    still become necessary, because the structure of the ASPL
    might impose some constraints on the PSAP that cannot be
    fulfilled on the other platform.)
    Stefan Ram, Aug 14, 2013
    #1
    1. Advertising

  2. Stefan Ram

    Stefan Ram Guest

    -berlin.de (Stefan Ram) writes:
    >Otherwise, Android applications (especially user interfaces,
    >but also other parts) have to be structured differently than
    >Swing applications from the beginning (from ground up), so a
    >compatibility layer is difficult and one would have to forgo
    >many features of Android or Swing using such a layer.


    This becomes easier, however, when one is restricting the
    realm of the application to a specific field. Say, you only
    want to write software for rogue-like games (RLG). Then, you
    can write an interpreter for an RLG DSL once for both
    platforms and then write portable applications in that RLG
    DSL. But even in this case, you still have to think about
    what portability of software means when it is supposed to
    run on a screen of less than 3" (as some Android devices
    have it) and on a screen of 27" or supposed to use finger
    input as well as mouse or keyboard input and so on.
    Stefan Ram, Aug 14, 2013
    #2
    1. Advertising

  3. Stefan Ram

    Arivald Guest

    W dniu 2013-08-14 05:37, Stefan Ram pisze:
    > Martin Gregorie <> writes:
    >> are there any decent Android emulators that can be used to
    >> develop Android graphical apps under Linux?

    >
    > The standard Android SDK contains an emulator (which can be
    > somewhat slow).
    >


    It can be faster, if You use Intel ABI image, and Intel accelerator. It
    skips ARM->x86 translation.

    http://software.intel.com/en-us/art...or-image-add-on-from-the-android-sdk-manager/

    http://software.intel.com/en-us/art...ardware-accelerated-execution-manager-windows

    --
    Arivald
    Arivald, Aug 14, 2013
    #3
  4. Stefan Ram

    Joerg Meier Guest

    On Wed, 14 Aug 2013 08:58:24 +0200, Arivald wrote:

    > W dniu 2013-08-14 05:37, Stefan Ram pisze:
    >> Martin Gregorie <> writes:
    >>> are there any decent Android emulators that can be used to
    >>> develop Android graphical apps under Linux?

    >> The standard Android SDK contains an emulator (which can be
    >> somewhat slow).

    > It can be faster, if You use Intel ABI image, and Intel accelerator. It
    > skips ARM->x86 translation.


    > http://software.intel.com/en-us/art...or-image-add-on-from-the-android-sdk-manager/


    > http://software.intel.com/en-us/art...ardware-accelerated-execution-manager-windows


    I did not know about that at all, thank you for the links, I'll have to
    look into that.

    Liebe Gruesse,
    Joerg

    --
    Ich lese meine Emails nicht, replies to Email bleiben also leider
    ungelesen.
    Joerg Meier, Aug 14, 2013
    #4
  5. Stefan Ram

    Stefan Ram Guest

    Arivald <> writes:
    >W dniu 2013-08-14 05:37, Stefan Ram pisze:
    >>Martin Gregorie <> writes:
    >>>are there any decent Android emulators that can be used to
    >>>develop Android graphical apps under Linux?

    >>The standard Android SDK contains an emulator (which can be
    >>somewhat slow).

    >It can be faster, if You use Intel ABI image, and Intel accelerator. It
    >skips ARM->x86 translation.


    Now, new computers are announced with Windows 8.1 plus the
    capability to execute Android apps. (Currently, this already
    is possible with additional software for some apps.)

    Why should I use WinForms, WPF, Swing or Java FX anymore,
    when I now can write an app that runs on both Android and
    Windows using the Android API?

    This also finally fulfills my desire to have a standard
    environment that includes an SQL DBMS. (I had wished before
    that this would be part of the JDK, not an add-on.)
    Stefan Ram, Dec 30, 2013
    #5
  6. Stefan Ram

    Arne Vajhøj Guest

    On 12/30/2013 1:05 PM, Stefan Ram wrote:
    > Arivald <> writes:
    >> W dniu 2013-08-14 05:37, Stefan Ram pisze:
    >>> Martin Gregorie <> writes:
    >>>> are there any decent Android emulators that can be used to
    >>>> develop Android graphical apps under Linux?
    >>> The standard Android SDK contains an emulator (which can be
    >>> somewhat slow).

    >> It can be faster, if You use Intel ABI image, and Intel accelerator. It
    >> skips ARM->x86 translation.

    >
    > Now, new computers are announced with Windows 8.1 plus the
    > capability to execute Android apps. (Currently, this already
    > is possible with additional software for some apps.)
    >
    > Why should I use WinForms, WPF, Swing or Java FX anymore,
    > when I now can write an app that runs on both Android and
    > Windows using the Android API?


    It is certainly an option to consider.

    But ask yourself: why did everyone not switch to Swing 10 years ago.

    Maybe the single GUI app for all platforms is not the best fit for
    all.

    > This also finally fulfills my desire to have a standard
    > environment that includes an SQL DBMS. (I had wished before
    > that this would be part of the JDK, not an add-on.)


    Java has come bundled with Java DB aka Derby for many years.

    Arne
    Arne Vajhøj, Dec 30, 2013
    #6
  7. Stefan Ram

    markspace Guest

    On 12/30/2013 10:05 AM, Stefan Ram wrote:
    >
    > Now, new computers are announced with Windows 8.1 plus the
    > capability to execute Android apps.


    Well, Windows 8.1 isn't out yet. And there's going to be a lot of
    Windows platforms that can't natively run Android out there for a long
    while because most people won't upgrade any time soon.

    But assuming that MS has good compatibility with Android and it really
    is a complete Android system, then yes I think MS just drove a stake
    through the heart of JavaFX and JNLP.

    I'd be wary of MS's predilection to embrace, extend and extinguish, but
    that's my personal bias.
    markspace, Dec 30, 2013
    #7
  8. Stefan Ram

    Arne Vajhøj Guest

    On 12/30/2013 1:17 PM, markspace wrote:
    > On 12/30/2013 10:05 AM, Stefan Ram wrote:
    >>
    >> Now, new computers are announced with Windows 8.1 plus the
    >> capability to execute Android apps.

    >
    > Well, Windows 8.1 isn't out yet.


    Just for the record: 8.1 went GA October 17th.

    It is the 8.1 Plus or I believe more accurate 8.1 on PC Plus laptops
    that is to be announced at CES in less than 2 weeks.

    > And there's going to be a lot of
    > Windows platforms that can't natively run Android out there for a long
    > while because most people won't upgrade any time soon.
    >
    > But assuming that MS has good compatibility with Android and it really
    > is a complete Android system, then yes I think MS just drove a stake
    > through the heart of JavaFX and JNLP.


    I am sure that they want to try, but cross platform GUI is notorious
    difficult to get commercial success with.

    Arne
    Arne Vajhøj, Dec 30, 2013
    #8
  9. Stefan Ram

    Arne Vajhøj Guest

    On 12/30/2013 4:34 PM, Qu0ll wrote:
    > MS have lost most of their relevance and the fact/rumour that their
    > latest OS can support Android apps is incredibly insignificant. The
    > Windows OS is one of the least important on the landscape at the moment
    > and will continue to decline.


    The rumors of MS's and Windows's death is highly exaggerated.

    Windows is still completely dominant on both office PC's and
    home PC's.

    MS has not done well in phones, but that is not market share that
    they have lost - it is market shared that they have failed to gain.

    The PC market has shrunk a bit (10-15%) the last couple of years
    with tablets being the main reason. But the PC market has grown
    almost constantly for 30 years. Rather normal with a small reaction.

    The PC market will not go away. People need the keyboard, the large
    monitor(s) and all their usual applications for many purposes. Tablets
    will not kill PC's - they will replace PC's for light usage and
    supplement PC's for heavy usage.

    Arne
    Arne Vajhøj, Dec 30, 2013
    #9
  10. Stefan Ram

    Arne Vajhøj Guest

    On 12/30/2013 6:06 PM, Qu0ll wrote:
    > Much of what you say here Arne is correct but my point was "Windows OS
    > is one of the least important on the landscape at the moment" and I
    > stand by that.
    >
    > Think of it this way, when a software developer or software company is
    > planning their next app, which OS or OSes are they considering for
    > deployment? I will wager more are thinking of Android, then iOS, than
    > Windows and this trend will continue.
    >
    > Of course desktop PCs will be around for years and years but that was
    > not my point.


    If you develop an app for smartphone, then you do Android and iOS
    and maybe Windows Phone.

    But you develop an app for desktop PC, then you do Windows and maybe
    MacOS X and Linux.

    The number of applications that target both phones and desktop PC's
    with same UI must be very small. I can not think of any right away.
    And I find it difficult to see it the future as well. The optimal
    UI's are simply different.

    Arne
    Arne Vajhøj, Dec 30, 2013
    #10
  11. Stefan Ram

    Arne Vajhøj Guest

    On 12/30/2013 6:38 PM, Leif Roar Moldskred wrote:
    > Arne Vajhøj <> wrote:
    >> On 12/30/2013 6:06 PM, Qu0ll wrote:
    >>> Much of what you say here Arne is correct but my point was "Windows OS
    >>> is one of the least important on the landscape at the moment" and I
    >>> stand by that.
    >>>
    >>> Think of it this way, when a software developer or software company is
    >>> planning their next app, which OS or OSes are they considering for
    >>> deployment? I will wager more are thinking of Android, then iOS, than
    >>> Windows and this trend will continue.
    >>>
    >>> Of course desktop PCs will be around for years and years but that was
    >>> not my point.

    >>
    >> If you develop an app for smartphone, then you do Android and iOS
    >> and maybe Windows Phone.
    >>
    >> But you develop an app for desktop PC, then you do Windows and maybe
    >> MacOS X and Linux.

    >
    > Of course, today there is a third option. A lot of applications that
    > used to be made as desktop applications, particularly internal
    > software projects, are now made as web applications instead.
    >
    > I think that is a development that is actually a far greater danger to
    > Microsoft than the new OSes on tablets and cellphones.


    I somewhat agree.

    But that started 12-15 years ago.

    And it has not killed desktop apps yet.

    Arne
    Arne Vajhøj, Dec 30, 2013
    #11
  12. Stefan Ram

    Joerg Meier Guest

    On Tue, 31 Dec 2013 08:34:31 +1100, Qu0ll wrote:

    > MS have lost most of their relevance and the fact/rumour that their latest
    > OS can support Android apps is incredibly insignificant. The Windows OS is
    > one of the least important on the landscape at the moment and will continue
    > to decline.


    I hope what you meant to say was that desktop PCs are one of the least
    important markets (and even that is still pretty wrong), because Windows
    still holds a crushing 91% market share in the desktop segment, so calling
    Windows one of the least important anythings is outright laughable.

    All in all, Microsoft is still the giant in the room, just not in mobile -
    in 2013, 91% on desktops, 35% in webservers, 27% in console gaming, 38% in
    real time environment and even embedded they are holding on to like 10%.

    Smartphones are currently more interesting, but financially, they are a
    surprisingly soft target, and if you have a decently sized developer team,
    aiming software primarily at mobile devices is probably a mistake, unless
    you are supporting a web business.

    Liebe Gruesse,
    Joerg

    --
    Ich lese meine Emails nicht, replies to Email bleiben also leider
    ungelesen.
    Joerg Meier, Dec 31, 2013
    #12
  13. Stefan Ram

    Joerg Meier Guest

    On Mon, 30 Dec 2013 17:38:39 -0600, Leif Roar Moldskred wrote:

    > Of course, today there is a third option. A lot of applications that
    > used to be made as desktop applications, particularly internal
    > software projects, are now made as web applications instead.


    That trend seems to be on the decline again, especially with apps letting
    people experience the vast difference in usability between a web interface
    and native programs.

    Liebe Gruesse,
    Joerg

    --
    Ich lese meine Emails nicht, replies to Email bleiben also leider
    ungelesen.
    Joerg Meier, Dec 31, 2013
    #13
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. sterta bole
    Replies:
    0
    Views:
    775
    sterta bole
    Aug 27, 2012
  2. Arne Vajhøj
    Replies:
    1
    Views:
    236
    Arne Vajhøj
    Aug 14, 2013
  3. Joerg Meier
    Replies:
    1
    Views:
    247
    markspace
    Aug 15, 2013
  4. Richard Maher
    Replies:
    26
    Views:
    498
    Arne Vajhøj
    Aug 19, 2013
  5. Arne Vajhøj
    Replies:
    11
    Views:
    338
    Arne Vajhøj
    Aug 17, 2013
Loading...

Share This Page