maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   What i need to know to start developing apps for N900? (https://talk.maemo.org/showthread.php?t=42390)

fatalsaint 2010-01-30 05:57

Re: What i need to know to start developing apps for N900?
 
Quote:

Originally Posted by ahmadka (Post 502065)
And what is the difference between Qt Designer and Qt Creator, because I have seen two of these things ?

I believe (not 100%) that QT Creator is a full IDE environment to code in... while QT Designer is simply an interface to build your graphical UI. QT Creator launches QT Designer when you go to modify your UI and then you save and finish coding in QT Creator.

I don't use QT Creator so am not 100% on it.. but I do use QT Designer directly just to build the GUI and then save my .ui file wherever I need it.

Quote:

Also, I heard somewhere that Qt is also a language thing .. that is, a replacement for c++/python which Nokia has developed for Maemo software development ? Is this true ? And if it is, shouldn't we use Qt for programming as well ?
You're getting mixed up here. QT is a C++ graphical library. It's not a language in and of itself, it's an extension to C++ that allows you to code a frontend interface to your application. There are "bindings" that adapt these libraries to python to allow for PyQt4 development, meaning that you are creating and using a QT interface from python instead of C++.

Quote:

Also, personally I have experience with C++, but not Python ... So I need to know which of the two is better .... So what do you say, which is the better one between Python and C++ ?
Again you won't find a single answer for this.

Fargus and I, I believe, offered a (somewhat) un-biased view of both languages in this thread that explained Python and C++. My personal preference in Python for non-critical or resource intensive applications because it's faster, and easier. C++ for the system critical applications.

But that is my personal preference.. others opinions vary greatly.

ahmadka 2010-01-30 06:09

Re: What i need to know to start developing apps for N900?
 
Quote:

Originally Posted by fatalsaint (Post 502069)
I believe (not 100%) that QT Creator is a full IDE environment to code in... while QT Designer is simply an interface to build your graphical UI. QT Creator launches QT Designer when you go to modify your UI and then you save and finish coding in QT Creator.

I don't use QT Creator so am not 100% on it.. but I do use QT Designer directly just to build the GUI and then save my .ui file wherever I need it.


You're getting mixed up here. QT is a C++ graphical library. It's not a language in and of itself, it's an extension to C++ that allows you to code a frontend interface to your application. There are "bindings" that adapt these libraries to python to allow for PyQt4 development, meaning that you are creating and using a QT interface from python instead of C++.


Again you won't find a single answer for this.

Fargus and I, I believe, offered a (somewhat) un-biased view of both languages in this thread that explained Python and C++. My personal preference in Python for non-critical or resource intensive applications because it's faster, and easier. C++ for the system critical applications.

But that is my personal preference.. others opinions vary greatly.

OK thanks for such good answers bro .. :)

The next matter which I would like to address is: developing environments .. !

The Maemo SDK, (whose installation guide is here), is based on which language ? Python or C++ ?

And which SDK do I install if I want to program using the other language ? (e.g. if Maemo SDK is for c++, what do I use for developing in Python ?)

Is esbox an SDK as well, or just an IDE ?

Lastly, do you know any links to ready-made 'hello world' type code examples for C++/Python which are ready to be deployed to the N900 ? (So that I can just continue on from there by enhancing the code in my own way .. ? )

Needless to say, I really appreciate your quick help here man :)

fatalsaint 2010-01-30 06:22

Re: What i need to know to start developing apps for N900?
 
Quote:

Originally Posted by ahmadka (Post 502078)
The Maemo SDK, (whose installation guide is here), is based on which language ? Python or C++ ?

Both.. Primarily C++.

The Scratchbox is an emulator, kind of like virtualbox/vmware/etc except that it'll emulate your CPU. In C++ you have to compile programs specific to the architecture that you plan to run on.. thus with C++ you need to compile against an ARMEL CPU.. whereas your computer is most certainly an x86 - which causes a problem. So you use scratchbox to "pretend" to be an ARMEL device to compile your software into something that the N900 can use.

Python doesn't have this problem.. technically you could code a PyQt4 app directly in ubuntu under a text editor, copy it to the N900 and it'll work in some fashion.

The SDK also provides a way to "emulate" the N900 directly using the Xephyr X-Server window. It opens a small box the same size/shape as the N900. You then run "af-sb-init.sh start" from inside an i386 scratchbox environment and it will talk to the Xephyr window making your own little mini-N900. Keep in the mind though, that this has to be done in the i386 scratchbox, not the ARMEL I discussed above. So once you get the app running right in your little window you have to close everything out, select the ARMEL target, re-start scratchbox, and then compile your program for the N900 and move it over. (real pain IMHO.)

I personally use the SDK Virtual Image since it had scratchbox and everything setup for me, and use the Xephyr to emulate the N900 because I do not have an N900. Then I write my python app (see sig) and when I get it looking right on the fake N900 I ask friends here on the board to load my deb files for me and check them on real N900 devices.

Quote:

Is esbox an SDK as well, or just an IDE ?
Meh.. I don't use it. I have used eclipse.. which is just an IDE. But I believe the way esbox works is it's built to work directly with scratchbox so when you compile/run your code from in the IDE.. it automatically compiles it against the correct targets for you.. (i could be corrected on this.. again: I don't use it.)

Quote:

Lastly, do you know any links to ready-made 'hello world' type code examples for C++/Python which are ready to be deployed to the N900 ? (So that I can just continue on from there by enhancing the code in my own way .. ? )
If you go one page back you'll find a post from me that links to another thread where I detail PyQt4 development and give many links to example PyQt4 programs that will "just run".

You need to install python2.5-qt4-gui on your device for them to work.. and be warned that will take ~20-30mb of your rootfs.

Inacurate 2010-01-30 06:34

Re: What i need to know to start developing apps for N900?
 
Ok, so like a lot of the programming n00bs in here, I have questions, but I would like to try and come at a different angle with my questions.

If I want to program a stand alone application, like Witter, Maep, or say Angry Birds - What were they each programmed using?

If I want to do something like the Conversation Plug-ins, or a load-applet, battery app - What are those programmed using?

What are the limitations of Python, for example? Could I write something that will change the menu structure using just python, or is something else a better option?

fatalsaint 2010-01-30 06:43

Re: What i need to know to start developing apps for N900?
 
Quote:

Originally Posted by Inacurate (Post 502090)
If I want to program a stand alone application, like Witter, Maep, or say Angry Birds - What were they each programmed using?

Witter = python
Maep = C++ (pretty sure)
Angry Birds = Dunno.. probably C++.

Quote:

If I want to do something like the Conversation Plug-ins, or a load-applet, battery app - What are those programmed using?

What are the limitations of Python, for example? Could I write something that will change the menu structure using just python, or is something else a better option?
Getting outside my knowledge here. May need to wait for more of the experts to show up. I haven't done any real hildon integration yet.

I do know that you can integrate python apps with the interface, several examples and tutorials here. But mostly apps that actually do this kind of thing I believe are done in C++, and in the developer section of the wiki they show C++ examples.

A lot of maemo's stuff is run through DBUS/MCE, which you can write python apps to communicate to and from that (AFAIK) that (should) work if you have a need for whatever those parts are.

thegnarlypanda 2010-01-30 08:51

Re: What i need to know to start developing apps for N900?
 
Thanks a lot guys for all these replies. It's good to see people who don't have the "if you have to ask you are too stupid attitude" that I see in a lot of communities.

thegnarlypanda 2010-01-30 14:09

Re: What i need to know to start developing apps for N900?
 
Quote:

Originally Posted by fatalsaint (Post 502084)
...

You need to install python2.5-qt4-gui on your device for them to work.. and be warned that will take ~20-30mb of your rootfs.

Ok, I've installed python2.5-qt4-gui on my N900. Now how do I execute .py files on the actual device itself?

For example, I have a simple:

print "sdgsdfsdf"

Python script, will this execute on the device or do I have to use specific qt commands like those tutorials you linked to?

Thanks for this by the way.


EDIT: Nevermind, I typed python sdgsdfsdf.py and it worked.

ahmadka 2010-01-30 17:49

Re: What i need to know to start developing apps for N900?
 
OK so let me get this straight ... From what I've understood and correct me if I'm wrong, Python is a scripting language which does not need compilation (like C++,Java, etc ... need it), and can be just executed on the fly .. However, Python's downside is that N900's would have to install the python2.5-qt4-gui thing before running any Python based programs ... is this all correct ?

And can Python can be everywhere, for all possible N900 programs ? .. I'm thinking of making a small sketching program (similar to sketch) .. Can I use python for this or it is better to use C++ ?

fatalsaint 2010-01-30 17:55

Re: What i need to know to start developing apps for N900?
 
Quote:

Originally Posted by ahmadka (Post 502771)
OK so let me get this straight ... From what I've understood and correct me if I'm wrong, Python is a scripting language which does not need compilation (like C++,Java, etc ... need it), and can be just executed on the fly .. However, Python's downside is that N900's would have to install the python2.5-qt4-gui thing before running any Python based programs ... is this all correct ?

And can Python can be everywhere, for all possible N900 programs ? .. I'm thinking of making a small sketching program (similar to sketch) .. Can I use python for this or it is better to use C++ ?

Yes exactly. The other downside of python is that it's an interpreted language..

here is just a randomly selected document of a google search "interpreted vs compiled".

Suffice to say, interpreted languages have more overhead because there is a middle man, someone who takes commands from your script, "interprets" it to something you computer cares about, and then tells your computer what and how to do it.

In compiled languages there is no middle man, your program directly tells your computer what to do in a language it understands. This is why I said for more resource intensive or critical applications C++ is the better way to go.. I personally wouldn't design a full UI or desktop in an Interpreted or VM-based language (read: Android)..

However for something like a sketch program, Python should be perfect.


All times are GMT. The time now is 18:17.

vBulletin® Version 3.8.8