I know this site is mainly about creating a portableapp version for non portable softwares. But what if you're the programmer him/herself? How would you make your program portable from the get go? Assuming it's a standalone program without registry access or anything.
It's not just the PC world (Mac, Linux, etc.). Keep in mind each mobile device relies on a different programming language too. So how can you reach the widest audience possible? Is Flash maybe the way to go?
Thanks!
It depends on what you mean by 'portable'.
If you're going for cross-platfrom, then some ways you can go are Python, C (without any platform-specific stuff), HTML + Javascript (then you're relying on Prism to maintain interoperability), and there's a whole lot more.
If you're going for USB Portable, then anything not using Microsoft's development software will do (just about), as long as you don't call the registry. If it's 100% standalone (as in it's a single EXE and nothing more), then PAFifying it is easy--you just plop it in the top directory in place of the launcher. You can also program it to write into the data folder from there.
If you mean mobile device portable, HTML + Javascript is really the only way to keep everything cross-platform.
Insert original signature here with Greasemonkey Script.
give it a commandline switch to tell it where the data should go.
Too many lonely hearts in the real world
Too many bridges you can burn
Too many tables you can't turn
Don't wanna live my life in the real world
In addition to what's been said already, many program's make use of the operating system's notion of users. On Windows you have the "Documents and Settings" folder (depending on your version of Windows) which contains a folder for each user of that particular computer. On Linux you have the "Home" directory, which does likewise.
Typically portable applications must ignore these directories in favor of storing application settings in one or more files that reside with the main executable. The only problem with this is that you then only have settings for all users, not per user. A way to get around this is to store settings in a separate file for each user (a profile if you like), but then you have give the user a mechanism for choosing his or her profile at load time which can be annoying.
One solution to that is to name the settings file based on the current login name, but that isn't without it's problems if you change computers frequently (and ergo change usernames). You could still create copies of a settings file, one for each username you're likely to use.
This could be a complete non-issue, if it doesn't make sense for your application to have per-user settings, sometimes it isn't necessary. However, something to think about.
You concentrate on how to save settings. But as you can see from the link, Nokia expects Java while Apple expects Apple's own code, etc. So how can a program be made to fit everything?
I think you may have misunderstood what PortableApps.com is about.
Here, the devs specialise in making Windows applications for full-blown PCs portable, in the sense that they can be carried with you, e.g. on a flash drive, and used on any PC you have access to.
It is not at all about writing applications that can run on multiple platforms. There is no complete solution to that, and nor will there ever be one. Java Mobile Edition is probably the closest you will get, but even there, you'll find quirks and differences in behaviour from one platform to another.
As was stated, if you're talking about cross-platform programming then the closest you're probably going to get is Java. I think there's a Java Virtual Machine for just about every popular platform on the planet (including embedded mobile devices). Although as noted, every platform has it's quirks.
A universal, one size fits all programming language is very impractical because of the underlying hardware (and its inherent capabilities) which differs from device to device.
Depending on how complicated your programs are, then the Web would be another direction, but even here there are devices that don't support Flash, or don't have a browser to be able to make use of HTML/JavaScript, so it's still very hit and miss.
As an addendum to what Jimbo said, it is just coincidence that many of the applications here happen to run on other platforms like Linux and OSX, partly because that is the nature of open source software and development tools used within that movement.