![]() |
Development is too hard. Help me - help you.
So, As I am a student, learning C and C++, I decided i'd like to use C++/Qt and develop some apps for the N900.
This Post is about how hard it is to start programming C++/Qt for N900 - And even if similar posts have been posted before, i'll do it again - cause I can't find the information I am looking for, in a reasonable manner. Prior my collage studies I have had plenty of : TCL / Perl / Python programming. C# / Java Programming. ASP / PHP. I know how to use Eclipse, Visual Studio. I know how to use VIM, VNC, SSH, Putty. I already know how to write classes, inheritance and polymorphism in c++. And still, I have absolutely no idea how to start and program for the N900. Steps Iv'e done to get the show started : - Install Virtual Box - Install ubuntu, try to install scratchbox, failed miserably with plenty of errors. Gave up. - Install QtDesigner + QtCreator... Found out I can't make desktop widgets with Python and Qt. Gave up. - Decided again to go for C++/Qt. - Found out there is a VMware / VirtualBox image with everything ready on it!!!! Wooohooo. - Downloaded the 1.6G Beast, configured virtualbox, got ubuntu up and running. Updated all updates, installed Guest Additions. - Started Esbox, now what? looked for documents on how to get my Phone connected to the whole dev env, found a 102 pages document on pc-connectivity!! are you kidding me? I mean, 102 pages???????? OMG. - 102 pages I could have learned another programming language by that time. - Current status, frustrated, depressed, sad. Looked into madde, it's not exactly what I want, since I don't understand how to add widgets, application menu icon, etc etc. Programming for N900 is a jungle. and someone needs to cut the trees down, and put some pavement - cause I aint gonna wonder the jungle anymore. I got stung bad enough. If anyone here wants to elaborate, with easy to understand steps on the following topics, to help me get started, I'd be greatfull : 1. How do I connect my n900 via usb to the esbox. 2. How do I take care of all the dependencies thingy? How do I know what dependencies I actually have? 3. How do I compile, and copy to required files to my n900, add the application the the applications menu and run it? 4. How do I write desktop widgets for the n900? 5. How do I add my application to the extras repository? If I get all the required information, And I manage to get anywhere into this whole thing, I promise, 100% that i'll write a proper WORD document or wiki page, or even both - with vids pics and text that would explain step by step everything. cause right now - there are no proper guides or tutorials. Eitam. |
Re: Development is too hard - Help me - help you.
Quote:
http://talk.maemo.org/showthread.php?t=45978 http://talk.maemo.org/showthread.php?t=43663 |
Re: Development is too hard - Help me - help you.
Quote:
They don't discuss uploading to repositories, dependencies, desktop widgets, Installing apps you write on you phone, how to compile C++ apps etc etc etc. + It's rifling though threads again, When you are overwhelmed like I am now, you don't want to rifle through threads. I want a well written doc, or wiki. I am willing to write one, but I first need to understand what the hell is going on. And I am failing. I have written very nice apps in c# and Tk, people are using my apps. Why am I finding it so hard to start with maemo development? Hell I have even wrote symbian apps for my N95!!!!! Edit : BTW, thx for trying to help. Believe me I appreciate it, But I didn't start my n900 experience today, iv'e been at it for 2 weeks now. Still in the same spot. |
Re: Development is too hard - Help me - help you.
I have to say I agree with this. Trying to relearn programming after a long gap (20+ years) and it is a real uphill struggle trying to know where to start.
I have ubuntu with scratchbox SDK installed. I have compiled an app on it I want to port to Maemo. The app runs in the SDK window, but being PC based, I need to press Fn-keys to configure it so it doesn't get past the initial screen. I don't know if it is because of that or a more serious error yet. How to port this? I know I've seen a page in the past which gives a very crude example of this, "hildonizing" menus etc, but can I find it now I need it? Not a chance. Been looking for weeks at example after example but nothing with a useful "where to start" guide - and I'm not including "hello world" as useful! Then there's python. I'm sure this is something I could get to grips with, but are there any examples out there specific to the N900? I don't consider myself stupid, I've been hacking around with Linux since Slackware'96, I can recompile kernels, and I'm very at home with a CLI. I even use VIM as my preferred editor! My problem is that all my programing is business based, so databases, accounts etc. but I think with a few good examples and some API references, I may be able to have a go at this. I have some ideas for some very nice apps! More developers on board means more apps for all of us! |
Re: Development is too hard - Help me - help you.
Quote:
But I don't know if that is from Qt 4.5 or 4.6.2 or 4.7? Or Maybe just from PR1.2 ? ./Sigh. |
Re: Development is too hard - Help me - help you.
Quote:
Quote:
A quick note here that I think it *should* be perfectly possible to create desktop widgets with Python. I haven't tried this myself in my Qt tutorials series (http://blog.rburchell.com), but I may do so in the future when I get time. For installing, again, this (mostly) relates to packaging, so I won't go too much into it as it isn't my field, however, using MADDE (which you mention, so I assume you've read some stuff about it), you can compile (and create packages, again, not my field though) stuff for your device. MADDE is probably the easiest way to head with that. For my own part, I use MADDE to compile, then 'scp' (standard utility, not specific to Maemo, so should be easy to read up on) to copy the binary over to my n900 for testing. MADDE is also becoming increasingly integrated with the rest of the Qt toolchain, so it's only going to get simpler with time: see http://wiki.maemo.org/MADDE/QtCreato...on_for_windows Quote:
Keep asking questions, keep writing, keep soldiering on, and I and others will do our best to help. |
Re: Development is too hard - Help me - help you.
Quote:
Qt 4.6 is the better choice, and is planned to be deployed with the PR 1.2 update, but in terms of API, it doesn't offer much that 4.5 doesn't - it just does it in a better way (kinetic scrolling etc). Don't bother with 4.7 for now. It's still in early stages, and won't be released final for a while yet. The primary thing it offers that 4.6 down don't is QML, which will be very useful for compelling UI design - but that won't be "easy" for quite some time after release, as tool support (e.g. in Creator) will likely lag behind it. |
Re: Development is too hard - Help me - help you.
I'm also just starting to try writing programs for the N900, personally I have managed to get simple things working on the device with Qt and MADDE through following the MADDE/QtCreator integration tutorial and following the example program at the end of the Nokia Getting started with Maemo 5 introduction.
I can run programs I write on the device but only through the Qt interface, I am still trying to work out the next bit of getting programs loaded to the device etc. I would agree that trying to get started in this development is a jungle, there is definately a lot of information out there but it is spread across a wide range of tools, methods and platforms and takes a massive amount of researching to get anywhere. Not that I don't expect to do some amount of reading and learning to get started but its taken days of digging and installing / uninstalling various bits of downloaded software just to get to managing a "Hello World" app... All of the information out there is very useful and I'm sure will be necessary as I get further into developing but I can see how it can put people off at the start, beginners just need a single step by step spoon fed example document that takes you from nothing to having a simple working app installed on the device! |
Re: Development is too hard - Help me - help you.
Quote:
Quote:
I haven't written many recently as I'm busy transitioning to a new job, but see the thread over at http://talk.maemo.org/showthread.php?p=559241 Quote:
|
Re: Development is too hard - Help me - help you.
Quote:
|
Re: Development is too hard - Help me - help you.
Quote:
When I tried looking for the executable to copy into my N900, I could not find it. Not even after switching to ARMEL compilation mode, hitting build all. Where is it? Where should I look for it, How should I connect to my phone directly to run it from esbox? The python area does seem much more simple, and for what I want to do, Python performance will probably be more then enough. I just rather stick to one good dev env, and run with it. |
Re: Development is too hard - Help me - help you.
This does make me think that perhaps a simple, practical tutorial on building a 'hello world' with Creator + MADDE and deploying on n900 might be a good idea. I'll see if I get some time to work on this soon, if I get my laptop back from Sony repair anytime soon. :(
|
Re: Development is too hard - Help me - help you.
I mean run them on the N900 from within Qt on my PC over the USB connection rather than having them actually installed on the device to be able to run once the USB is disconnected.
|
Re: Development is too hard - Help me - help you.
Quote:
But I think the steps you are talking about are 2 or 3 commnad line commands with MADDE, that will create the .deb file, which you then just install on your n900. What will be the ICON? who knows (: |
Re: Development is too hard - Help me - help you.
Quote:
In the terminal, on my desktop, in my application's folder.. mad make # tell MADDE to build my project scp bin/myapp 192.168.0.5:/home/user/myapp # copy myapp executable to my n900 ssh root@192.168.0.5 # connect to my n900 via SSH, so I have a terminal on there chmod u+x /home/user/myapp # mark myapp executable /home/user/myapp You can also just open the terminal on your n900, and run '/home/user/myapp' manually. -- If you were using Windows, you'd open WinSCP, connect to 192.168.0.5, copy myapp executable to /home/user, mark it executable (by right clicking the n900 copy, and properties, or something - I haven't done this in forever, so I forget how), then use PuTTY to connect to your n900 and run it as above. -- There's probably a million ways to do it - this is mine. Hope this helps. |
Re: Development is too hard - Help me - help you.
@wOOt
Does this also pop the application into the applications menu? |
Re: Development is too hard - Help me - help you.
Quote:
Thanks! |
Re: Development is too hard - Help me - help you.
try this:
May not be perfect. But hopefully will be able to help you. 0. Install the GUI version (download from Nokia) http://www.forum.nokia.com/Tools_Doc...atforms/Maemo/ after that follow this I will assume you will use Ubuntu (I am using Ubuntu 9.04) lets call these machines: 1. Ubuntu Normal Screen 2. ScratchBox Screen --> where its actually running from Ubuntu Normal PC 1. Ubuntu Normal Screen /scratchbox/login --> this will launch Scratchbox Screen 2. Ubuntu Normal Screen Run Another Terminal then run this Xephyr :2 -host-cursor -screen 800x480x16 -dpi 96 -ac -kb 3. Scratchbox Screen On Scratchbox export DISPLAY=:2 af-sb-init.sh start Install QT (one time only) 4. Scratchbox Screen After login needs to install the following: fakeroot echo "deb http://repository.maemo.org/extras/ fremantle free non-free" >> /etc/apt/sources.list fakeroot echo "deb-src http://repository.maemo.org/extras/ fremantle free" >> /etc/apt/sources.list fakeroot echo "deb http://repository.maemo.org/extras-devel fremantle free non-free" >> /etc/apt/sources.list fakeroot echo "deb-src http://repository.maemo.org/extras-devel fremantle free" >> /etc/apt/sources.list fakeroot apt-get update fakeroot apt-get remove libqt4* fakeroot apt-get install libqt4-maemo5-dev fakeroot apt-get install libqt4-gui libqt4-dev fakeroot apt-get install libqt4-webkit libqt4-opengl 4b -> sb-conf select FREMANTLE_ARMEL arch -> make sure its arm go back to step 4 to install for the ARM platform (just do all the commands again) 5. logout 6. Execute Step 1 and 3 again (since we just install qt we need to make sure the path has been updated) 7. Create a sample Qt Application mkdir qt cd qt mkdir 1 cd 1 vi hello.cpp #include <qapplication.h> #include <qpushbutton.h> int main( int argc, char **argv ) { QApplication a( argc, argv ); QPushButton hello( "Hello world!", 0 ); hello.resize( 100, 30 ); //a.setMainWidget( &hello ); hello.show(); return a.exec(); } 8. Compile the program qmake -project qmake make ./1 or run-standalone.sh ./1 --> this will use the maemo theme 9. done ;-) have fun 10.To Shutdown the screen Scratchbox Screen to shutdown af-sb-init.sh stop --> Misc 1. How to include netwok in the compilation qmake -project then change the .pro result and add the following: QT += network To remove the GUI QT -= gui --> to support GUI QT += xml --> to add xml support to add all support QT += gui network support xml opengl sql how to transfer the file back to your maemo do it from the "scratchbox screen" 1. install openssh in your nokia n900 (nokia n900 device) dont forget to set your password scratchbox screen ------------------- 2. Set your compilation to ARM platform sb-conf select FREMANTLE_ARMEL --> for compile to your internet tablet sb-conf select FREMANTLE_X86 --> for normal compilation 3. qmake -project 4. qmake 5. make 6. the final file assuming the "demoapp" is the executable ARM binary. 7. scp demoapp root@192.168.2.168:/home/user 8. ssh root@192.168.2.168 9. cd /home/user 10. ./demoapp then you should see the application appears in your nokia n900 If you could not run the applicaiton, maybe the qt is not yet installed in your nokia n900 1. do this from your device as root apt-get install libqt4-gui apt-get install libqt4-webkit libqt4-opengl libqt4-dbus FAQ: 1. What if you can not change your Configuration from X86 to ARM? sb-conf killall --signal=9 2. How to see what is the device available in your Sb-conf? sb-conf ls -T |
Re: Development is too hard - Help me - help you.
Umm, why not download and run the Maemo SDK virtual machine?
|
Re: Development is too hard - Help me - help you.
Quote:
My question is, when you say install QT, is it in Ubuntu or the scratchbox? (Hope is the first, I did it there...) Quote:
Cheers, |
Re: Development is too hard - Help me - help you.
Quote:
Nothing but confusion resulted from that. I'll try the big post from above later (: |
Re: Development is too hard. Help me - help you.
If you want to use the virtual machine method then I found the Nokia Qt for Maemo developers guide very useful. It basically gives you a walkthrough of installing and setting up the virtual machine as well as previewing your app running on a virtual device in a Xephyr window. Lots of useful information in there. I got everything working by following that one guide, but I still think the Windows Qt and MADDE route is easier.
|
Re: Development is too hard - Help me - help you.
Quote:
|
Re: Development is too hard - Help me - help you.
4.
you will install QT on the scratchbox. |
Re: Development is too hard. Help me - help you.
I completely agree with the sentiments of the OP, with one minor correction: Development isnt too hard; setting it up is too hard.. The plethora of options, and the fact that (it seems) you have to spend hours messing about setting the environment up, every guide advises a different way, and all the software is still settling, makes for an incredibly frustrating experience
I decided I'd use QtCreator Downloaded it, installed it, wrote a hello world and it worked. Great. Then I tried to get the app onto the N900 I was sold on the write-once-run-anywhere of Qt. "It's java, but in c++" I thought. Ah, no it isnt. It has to be compiled for the device, it isnt interpreted by a vm (or whatever) So.. How do we compile for the N900 arm cpu, from windows QtCreator? Well, simplest way, I guess, would be just to install the compiler on the N900 - it's a computer after all. Wasted: 4 hours of messing with stuff trying to get libqt4-maem05-dev package to install, failing, and then finding out that the N900 is too slow CPU to compile apps anyway. I still dont understand that; how can a 600mhz cpu be too slow to compile an app, yet my 800mhz laptop (at its lowest stepping, 1600 at its highest) will be just fine? Whatever, the dev libs wont install on an N900 because of broken dependencies so we give up on that notion (probably noone is fixing it because they are all of the opinion that the N900 is too weak) OK, ask around a bit more.. Other options: scratchbox or madde Really cant be bothered dual booting/vmware my laptop just to get a dev env that will compile a project. Try madde instead 2 hours later Oh, MADDE is still on 4.5.3 - get some good help off the brains on IRC, harry passes over a 4.6.2 stab (unofficial) for madde but it has serious issues and QtC rejects it. Download QtC source code, read it Find out why QtC is rejecting, fix the issues with the 4.6.2 stab, attempt to make it go again - QtC no longer rejects it, but thinks the maemo built 462 hack is a desktop target, so it's still going to build the wrong apps anyway Figure I'll try 4.5 as shipped, because it's supposed to work.. maybe I'm not going to lose that much functionality. Maybe 4.5 has everything I want anyway. Load it in, link it up to QtC options, great. It looks like it's going to work Nip into the project build settngs.. add it as a.. oh.. it's not there. Maybe it's because I havent set up the N900 as a device yet.. Download Mad Developer, set it up, can't get the SSH keys working, no detail in any guides, so stick to password mode.. back into build settings.. and Qt 4.5.3 STILL isnt there Maybe I hosed my setup by having 2 copies of QtC and a MADDE with 4 copies of qmake dotted around, but I wanted the 4.6 dev ability.. So after 9 hours of faffing with QtCreator I still can't make the damn thing build an ARM binary I realise that cross platform is a challenge, but that's kinda what Qt's raison d'etre is, no? Having it work out of the box for the platforms it's bridging would be a good thumbs up for me I'm still avoiding scratchbox, to the point where I'm trying to use MADDE as a kind of N900 terminal emulator, to build the apps manually, bollocks to the QtCreator integration at the moment - I appreciate that this is all new, and stuff is moving along at such a lick that it's hard to keep a guide accurate for even a few days, but the crux of the issue is: If Nokia want thousands of apps in their app store, and the Maemo community wants to be alive with the buzz of development, a developer shouldnt be spending days of his life messing about, setting up the damn IDE!, he should be just doing: Go to website Select operating system Download IDE Write program Select target platform Build Deploy because this will fill the app store, and set the community on fire with creativity I'm back off to my tinkering, because I do enjoy it and it's helping me learn about a lot of stuff under the hood, but really.. it's all too hard, painful and time consuming for the normal, sensible people who give up sooner |
Re: Development is too hard. Help me - help you.
I reverted all my efforts at getting 4.6 to work in madde, and went with the default guide as specced in the wiki. Not sure what pitfalls await me now, given that my write and debug env is 4.6 windows, and my deploy env is 4.5 - just have to find some documentation that tells me what's new in 4.6 and avoid it.
I'm sure that 4.6 support will be along soon, and if I run into coding that needs the 4.6 libs.. maybe have to go the scratchbox route.. |
Re: Development is too hard. Help me - help you.
I'm having problems in the supossedly easiest part of the tutorial :)
When trying to run the hello project, if I do ./1 it says the file doesn't exist. If I do ./1.pro it says I don't have the required permissions. What am I doing wrong? |
Re: Development is too hard. Help me - help you.
It sounds like you havent compiled the app?
A link to the tutorial youre following would be helful |
Re: Development is too hard. Help me - help you.
If you think that setting up the environment is hard... Wait until you want to package and release your application in the repositories. For me, that was the hardest part. It was a real pain. Once you succeed, it's ok (or so I think). Anyway, don't give up! Eventually, it will work...
|
Re: Development is too hard. Help me - help you.
Quote:
Debian packaging can indeed be tedious but OTOH requiring the developer to spend an extra effort on making sure all dependencies etc are properly listed allows the users have much smoother experience when installing. Thus spending two extra hours of developer time is easily worth saving a minute of each users time. |
Re: Development is too hard. Help me - help you.
I'd recommend to get QtCreator and start developing (with Qt 4.6.2) on your desktop. When you've got the application in the state you want, enough time will likely have passed so that PR1.2 is there and you can actually deploy it on your n900 without too much trouble.
|
Re: Development is too hard. Help me - help you.
Quote:
I'm following tirtawn tutorial on post 18 on second page of this same thread. Isn't qmake compiling it? |
Re: Development is too hard. Help me - help you.
Quote:
Anyone having these issues? I followed the 'MADDE on windows' tutorial, maybe I missed something? |
Re: Development is too hard. Help me - help you.
Quote:
For what its worth, when I started out with QtCreator, I just installed the official nokia version, read the example apps and started writing. I don't really know c++ (i'm .net/java), hence you'll find me in irc asking really newbie questions.. but it all seemed to work quite well and painlessly. Installing MADDE and getting the bugger to work on the n900 was different, but now i'm kinda on with the concept that qmake makes makefiles, and makefiles do the donkey work.. even to perform a clean, I have to qmake, then clean, then build. I usually do these things explicitly because sometimes when I switch config the IDE doesnt realise and builds for the wrong target (this doesnt happen if you have only one target) |
Re: Development is too hard. Help me - help you.
Quote:
Anyhows, I found a similar thing to you initially.. the buttons especially.. ..and then I realised that I was writing in windows and then recomping for the n900.. and the n900 has 800x480 packed into 3.5 inches.. so my buttons that looked fine in windows at 21 px high were screwed up on device, and need to be more like 70 px high.. Did you size your ui as per hildon/maemo guidelines? Note; you may indeed be discussing a 462 problem; all the apps I build for my n900 are limited to 453 because I ahvent succeeded in hacking 462 madde to work |
Re: Development is too hard. Help me - help you.
Quote:
|
Re: Development is too hard. Help me - help you.
GUI guidelines, read this thread: http://talk.maemo.org/showthread.php?t=46912
Why no 462 MADDE? There is, but it's a hack and it DOESNT WORK within QtC (1.3.80) http://chaos.troll.no/~harald/MADDE/ See the readme -> thats MADDE 462, BUT, the mkspecs folder has broken contents and (when I tried) it will not build a Qt app to target ARMEL (n900) properly within QtC.. At first when you add it to QtC it will say "invalid Qt version", but if you copy the default (unix/armel) file from the mkspecs folder in your 453 madde, to the relevant mkspaces in the 462 hack you can at least get qtc to say the version is valid, but it targets windows, not ARMEL. I gave up at that point because I wanted to start developing, not spend hours of my life configuring the IDE :) Possibly you can mess about with it more and get it working but I gave up and just am careful to use 453 stuff only until the dev teams wire 462 and QtC together. Note also because MADDE is a bit like cygwin; a small linux that runs under windows, you could maybe start a madde terminal and manually compile your apps to target armel in there, once you have them working in windows.. Or you can go the scratchbox route, or possibly even the whole hog of installing some debian based linux on your pc and using QtC inside that |
Re: Development is too hard. Help me - help you.
Quote:
Oops..I have added the make now. |
| All times are GMT. The time now is 22:20. |
vBulletin® Version 3.8.8