• 0

How to create portable apps?


Question

12 answers to this question

Recommended Posts

  • 0

I think he means portable to other platforms like Windows, Linux and Mac.

Well Windows/Linux portable applications can be easy to write in C++ for example.

A good way to do it is to make an abstraction layer between your application and the platform.

So if your application wants to display a popup dialog then write a method that your application uses.

You can then with preprocessor scripting choose which file to include when the file is compiled.

If you set a flag like FORWINDOWS it will include the file that contains your method that invokes the Windows API for the dialog box or otherwise it would include the file with the method that contains the Linux stuff.

That way you can compile for both platforms without touching your code.

  • 0

Great info!

Well, I'll be a little more specific, which is probably what I need to get the correct information.

I'm trying this for the first time and my project will be Windows Live Messenger. I don't want a single exe (that's the easy part, but it would be nice for the functionality), but at least that I'm able to make it portable.

Thanks

  • 0
  Andos said:
I think he means portable to other platforms like Windows, Linux and Mac.

Well Windows/Linux portable applications can be easy to write in C++ for example.

A good way to do it is to make an abstraction layer between your application and the platform.

So if your application wants to display a popup dialog then write a method that your application uses.

You can then with preprocessor scripting choose which file to include when the file is compiled.

If you set a flag like FORWINDOWS it will include the file that contains your method that invokes the Windows API for the dialog box or otherwise it would include the file with the method that contains the Linux stuff.

That way you can compile for both platforms without touching your code.

  Rastereffects said:
Java is portable. You can write any application and it will run as long as the platform has a JRE. If you want to use C or C++ use the Qt library from Trolltech.

He means "portable" as in being able to run it off a USB thumb drive or similar without leaving traces on the host computer.

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.