Newbie Help For Creating First App


Darksci

Still Fresh
Joined
Feb 5, 2009
Messages
13
Ok, so I've learned Java from my job as an IT Consultant. Thou to be honest I'm mainly a Business Consultant or so my company lovingly training me in >_>

I know just the basics to go around creatings modules in Ecilpse. But I want to expand that knowledge and my programming skills in general.

Does anyone have any advice as to how I should start by making my first application whether it be a simple text editor on the Pandora? Which language, which O/S and how to compile it?

I don't imagine I should use Java for that, but a more direct language like C/C++.
I've used Ubuntu before, but I have never programmed in it or compiled anything (only used the repository).

I imagine I could create the app in Windows, then place the source code over to Linux - Is there some good website to give me an explaination of this
 
Last edited by a moderator:
If you want to make something like a text editor, you'll probably want to use GTK, which is a popular Windows / Linux GUI toolkit.

You can try C++ or Python, though any program that needs a lot of CPU time will be much faster in C++. Dev-cpp for Windows uses a variant of the GNU C++ compiler used on Linux, so all your code is pretty much guaranteed to port.

You can also try to develop without an IDE by using something like MSYS, where you just write the C++ source with a text editor and compile it manually, or with a makefile. Makefiles are much more portable than Dev-cpp projects, but the command takes a little getting used to.

Here's some links:

GTK+: http://www.gtk.org/
The toolkit used for a lot of GUI apps in Linux and probably most of the Pandora's apps.

Dev-Cpp: http://www.bloodshed.net/devcpp.html
C++ IDE

Code::Blocks is another good C++ IDE, it seems to come with a lot of default projects built in: http://www.codeblocks.org/

MSYS: http://www.mingw.org/
This gives you a Unix command line in Windows so you can compile C++ code directly if you don't want an IDE. It's a little more complicated, and you'll need to learn about makefiles, but it's the most portable way to write C++.
 
Last edited by a moderator:
If you want to have a go at windows console or gui programming the visual studio express editions are good way to go. It wont be very portable code, but you can use as a learning tool. With this method there's nothing to setup, with the previous post's suggestions theres some work in getting all the right packages.
 
Well if you just get Dev-cpp, you can program C++ pretty easily, and it uses the same compiler as the Pandora rather than any weird Microsoft stuff.

Also, my links are probably broken... You can just google Dev-Cpp.
 
You can stick with Java if you want. While GTK would be alright, Qt is without a doubt superior. Use it if at all possible from C++, Python, Ruby or even Java with Qt Jambi.
 
First off, Java is really, really popular for small devices like this. I don't know if it's supported on the Pandora off the bat (support was pretty horrible on the Sharp Zaurus, which also used ARM, but that was half a decade ago), but the ARM people do claim ("http://www.arm.com/products/multimedia/java/jazelle.html") that it works. I think the relevant downloads are here: "http://java.sun.com/javame/downloads/index.jsp", but Sun seems to go out of its way to not let you know if your device works with their API. That, or I need another coffee. Pun not intended.



That aside, I did all my programming in Qt ("http://www.qtsoftware.com/") (a toolkit mostly made for C++), and it was ultraportable. In Windows, it only required the installation of a single package (the installer retrieves and installs the compiler for you). I haven't done much with it in the past few years (the sadness of RSI -- this past year, I only had the oomph to program a simple 3D image viewer and a spreadsheet-like front-end for retreiving MRI data files via ftp), but apparently it now natively supports java and runs on Windows, OSX, X11, WinCE devices, embedded Linux devices, and soon the Symbian S60 smartphone platform.

The free version of Qt produces GPL and/or LGPL licensed software and uses the MinGW compiler. There is a pay version that will work with Visual Studio and allows you to design your own license. In my personal experience, the code cross compiled cleanly, and you use pretty easy #ifdef directives in certain cases when compiling for embedded platforms (for example, on the Sharp Zaurus PDA, when I create my main application window, I had to set it to a rigid 320x240 size, but on desktop platforms, the windows was set to be resizable by the OS and user). I personally prefer Qt because the code for defining widgets (windows and buttons and layous and such) is really simplified so that, for me, I can visualize it in my mind and then write it out as I want to see it. I don't really use drag'n'drop IDE GUI builders, though they exist for Qt, so I cannot vouch how awesome the one for this toolkit might or might not be.

(also, the reference documentation, at "http://doc.qtsoftware.com/", is pretty amazing)


I did play with Code::Blocks for a while, and it did seem pretty cool, by the way.

...oh, do we even know if the qt libraries are going to be in the default Pandora repository? That could be a deal breaker if not. And it would make me sad, because QtReader was an awesome ebook app that worked on the ARM architecture, and I wants it.


(btw, I tried bbcode urls but they didn't show up in Preview ... are they disabled here?)
 
Last edited by a moderator:
That's a good question. I've heard GTK will be ported and I know FLTK is small enough that you usually compile it statically, but I don't remember if they said Qt would be included.

I personally prefer GTK because Qt adds these weird extra steps to C++ compiling. Of course, GTK builds object-oriented programming on top of C, which makes it really awkward in C++, but that's because I'm too lazy to use gtkmm.
 
Last edited by a moderator:
'sindbad' said:
You can stick with Java if you want. While GTK would be alright, Qt is without a doubt superior. Use it if at all possible from C++, Python, Ruby or even Java with Qt Jambi.
GTK has probably a better chance to be available on pandora from the day one: QT support on small devices used to require a different, non X based, QT version, and historically in Openembedded/Angstrom it has been quite bad. This is changing with QT4, but it's probably going to take some time.

Anyway, bot java SE and J2ME are theoretically feasible on the pandora, but I don't know what will be available in the standard firmware.
 
Last edited by a moderator:
Qt-X11 with version 4.4 at least better be available by default. It works just fine on the beagleboard, there shouldn't be any problems.
 
Last edited by a moderator:
Personally I find programming on Linux to be one hell of a lot easier, as everything you need is available by default, and it actually has a decent, usable CLI, instead of the half backed junk that comes with Windows.
 
The angstrom distro already has JamVM included which is a java virtual machine so java should be perfectly fine on the Pandora.
 
Wanted to come back and add that I've tried eclipse and netbeans and I've fallen in love with netbeans. By default you'll need to install something like the Java SE JDK + Netbeans but it includes a GUI editor that auto-codes most of the stuff you need.

Plus the way it lays things out, you can auto-align buttons, text fields, change settings on how they act all with netbeans handling most of the code for you if your primarily interested in developing apps with a GUI.

I'm finding that netbeans really just handles a lot of the legwork for you...after tripping in eclipse I almost went back to just not wanting to code anymore but netbeans pretty much solved it in terms of usability and really easing you in.

Hope this helps,
Anthony
 
Last edited by a moderator:
So guys, I've been relearning C++, its going quite well so far. Using Code::Blocks. Its a hell of alot easier than the first time I looked at C++ in Windows 3.11 :eek:
 
Last edited by a moderator:
Darksci said:
So guys, I've been relearning C++, its going quite well so far. Using Code::Blocks. Its a hell of alot easier than the first time I looked at C++ in Windows 3.11 :eek:
Cool, if you really get into C::B theres a devkit setup that includes the GP2X devkit and libs. Although I know your aiming for pandora.
 
Last edited by a moderator:
Ok so my employer has now placed me on a new project where I need to learn C#.

Looks really similar to JAVA so should be able to breeze right though.

Though my question is whether I should or could abandom relearning C++ for the Pandora and use C#?
 
It depends.. if you are going to write GTK+ programs as opposed to SDL or QT or something else, it could make sense to start writing them in Vala. Vala is a new language modelled after C#, the main goal is to make it simple to write GTK+ programs. CODE
http://live.gnome.org/Vala/
 
While Vala is pretty cool, it's dependant on GLib, can't use Qt (although it will be able to at some point) and still is quite immature and there is very little documentation for it. It's something to keep an eye out for, but not quite usable right now.
 
Last edited by a moderator:
'sindbad' said:
While Vala is pretty cool, it's dependant on GLib, can't use Qt (although it will be able to at some point) and still is quite immature and there is very little documentation for it. It's something to keep an eye out for, but not quite usable right now.
You could give Mono a try - it is an open-source implementation of MS .Net. It includes support for C#, ASP.net, etc. and many of the foundation libraries, so porting and learning should be a piece of cake. Already many Linux apps are written using Mono.

Not sure if there will be an Angstrom build for the Pandora, but it seems like it should be feasible.
 
Last edited by a moderator:
Back
Top