maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   New Developers/coders? Help!!?! (https://talk.maemo.org/showthread.php?t=36987)

noobmonkey 2009-12-15 21:38

Re: New Developers/coders? Help!!?!
 
Quote:

Originally Posted by pixelgeek (Post 429459)
I did it using the GUI installer following this guide here:
http://wiki.maemo.org/Documentation/...l_Installation

Cheers Pixel - running through it now :)

noobmonkey 2009-12-15 22:21

Re: New Developers/coders? Help!!?!
 
Hmmm got an issue on step 5........
Trying to run step 5 as my user
Quote:

greg@gregbuntu:/root$ ./maemo-sdk-install_5.0.sh
bash: ./maemo-sdk-install_5.0.sh: Permission denied
greg@gregbuntu:/root$
Trying to run step 5 as root
Quote:

root@gregbuntu:~# ./maemo-sdk-install_5.0.sh
This script will install maemo SDK 5.0 fremantle release to your computer.

Install options
Force remove of existing targets (no)
Alternative sources.list ('')

Target configuration for armel (FREMANTLE_ARMEL)
compiler=cs2007q3-glibc2.5-arm7
devkits=perl:debian-etch:qemu:doctools:svn:git
cputransp=qemu-arm-sb

Target configuration for i386 (FREMANTLE_X86)
compiler=cs2007q3-glibc2.5-i486
devkits=perl:debian-etch:doctools:svn:git

Checking for prerequisites
--------------------------

wget tool in path... /usr/bin/wget
Checking for dpkg tool in path... /usr/bin/dpkg
Running outside of scratchbox... yes
Script not run as user root... no
E: This script should NOT be run as user root.
Aghhh sooooo close!!!

pixelgeek 2009-12-16 07:56

Re: New Developers/coders? Help!!?!
 
just enter the following lines into the terminal:

sudo wget http://repository.maemo.org/stable/5.0/maemo-sdk-install-wizard_5.0.py
sudo chmod a+x maemo-sdk-install-wizard_5.0.py
sudo ./maemo-sdk-install-wizard_5.0.py

this will get you the GUI installer...

noobmonkey 2009-12-16 08:18

Re: New Developers/coders? Help!!?!
 
Quote:

Originally Posted by pixelgeek (Post 430099)
just enter the following lines into the terminal:

sudo wget http://repository.maemo.org/stable/5...-wizard_5.0.py
sudo chmod a+x maemo-sdk-install-wizard_5.0.py
sudo ./maemo-sdk-install-wizard_5.0.py

this will get you the GUI installer...

Lol - i really do need to learn these commands :)
Quote:

greg@gregbuntu:/root$ sudo ./maemo-sdk-install-wizard_5.0.py
: cannot connect to X server
but i am becoming an expert at logging in as root :), and then back in as me :)

Quote:

root@gregbuntu:~# sudo ./maemo-sdk-install-wizard_5.0.py
: cannot connect to X server

noobmonkey 2009-12-16 08:35

Re: New Developers/coders? Help!!?!
 
someone explain to me how typing "export DISPLAY=:0" helped?! gui is on my screen! yay, but got work in 15 mins!!!

edgedemon 2009-12-16 08:53

Re: New Developers/coders? Help!!?!
 
Im a noob, but my understanding is that you are redirecting the output from the screen or xserver to your emulator?
Depending on the programs you are running, you could change the value of 0 to another number and re-direct elsewhere
Ducks head and prepares to be shot down by the experts!

jaem 2009-12-16 09:26

Re: New Developers/coders? Help!!?!
 
Okay, Batch Reply to a bunch of posts:
noobmonkey[27]:
If you got the so-called "sexy" pointer (:P) then plasma (the desktop shell) probably crashed. In my experience this virtually never happens anymore, so it could just be a quirk of your system. If you feel like trying it again (you can install the kubuntu-desktop package ontop of Ubuntu - it's just a different spin, not a different OS), and reporting a bug with useful info, I'm sure KDE would appreciate it. Also be aware that hitting Alt+F2 and typing in "plasma-desktop[enter]" should restart it manually, and then you can see if it was just temporary thing.
go1dfish[28]:
Without getting into an argument, the developers do consider it "user-ready" at this point, and for the most part I'd agree, however that view admittedly sounds a bit weak in light of noobmonkey's post. :P At this point I'd say it's the usual quesion of "who is it ready for?" rather than "is it ready?" (cf. "Year of the Linux Desktop" debate -grin-)

noobmonkey[38]:
Great! As I think I mentioned, though, Ubuntu is shipping an old beta of KDevelop4, so it lacks some fairly important features (working debugging being one, if I remember correctly). That said, even if you can't wait for it to be released and packaged for Ubuntu, it's still makes an awesome code editor, and I'd fully recommend it if it works for you.
As for your comments about DEBs, you might want to read up on it. You can essentially think about packages as being an archive file (like a ZIP or tarball) with a file tree of binaries and what-have-you, and some metadata. In reality they're more complicated, and often horribly pedantic, but that's the gist. So, while you can technically just dump your compiled program into your filesystem and run it, the proper way is to package it into a package for your distro (Maemo uses DEBian packages because of its Debian heritage). This is a reasonably time-consuming process to learn and to do right, so when you're just messing around, you probably don't want to worry about it. Just remember - files that aren't packaged aren't tracked by the system database, so if you leave them lying around and forget to clean them up, you may have issues - or at least cruft. If you do this, I'd recommend sticking them in /home/user/bin (which you'd have to create).

noobmonkey[45]: X has to run on a logical display. DISPLAY is an environment variable that is set when you fire up an X session (e.g. login). Since you're not logged into your graphical session as root (I hope not, anyway!), you need to set it manually.

Oh, and to put in my two cents about the C++/Python discussion, I would note that not only is C++ much nicer than C, but Qt takes care of most of the remaining messy bits. Python is still probably easier for many things, but it's a matter of preference as well as the situation, really. Also note that (probably) the majority of Linux software can be used directly by C++ programs, but there aren't Python bindings for everything (although it's close!).

noobmonkey 2009-12-16 10:21

Re: New Developers/coders? Help!!?!
 
Quote:

noobmonkey[27]:
If you got the so-called "sexy" pointer (:P) then plasma (the desktop shell) probably crashed. In my experience this virtually never happens anymore, so it could just be a quirk of your system. If you feel like trying it again (you can install the kubuntu-desktop package ontop of Ubuntu - it's just a different spin, not a different OS), and reporting a bug with useful info, I'm sure KDE would appreciate it. Also be aware that hitting Alt+F2 and typing in "plasma-desktop[enter]" should restart it manually, and then you can see if it was just temporary thing.
Hehe - did a few google searches, doesn't look like i was the only person with this problem :), after installing plain old Ubuntu - i have to say i much prefer it :)

Thanks for the F2 advice - hopefully won't need it now :)

Quote:

noobmonkey[38]:
Great! As I think I mentioned, though, Ubuntu is shipping an old beta of KDevelop4, so it lacks some fairly important features (working debugging being one, if I remember correctly). That said, even if you can't wait for it to be released and packaged for Ubuntu, it's still makes an awesome code editor, and I'd fully recommend it if it works for you.
As for your comments about DEBs, you might want to read up on it. You can essentially think about packages as being an archive file (like a ZIP or tarball) with a file tree of binaries and what-have-you, and some metadata. In reality they're more complicated, and often horribly pedantic, but that's the gist. So, while you can technically just dump your compiled program into your filesystem and run it, the proper way is to package it into a package for your distro (Maemo uses DEBian packages because of its Debian heritage). This is a reasonably time-consuming process to learn and to do right, so when you're just messing around, you probably don't want to worry about it. Just remember - files that aren't packaged aren't tracked by the system database, so if you leave them lying around and forget to clean them up, you may have issues - or at least cruft. If you do this, I'd recommend sticking them in /home/user/bin (which you'd have to create).
Thanks for the zip idea - makes sense to me! (Shocker!)

Not understanding the second part - but i'll refer back to it when i get hello world working! :) :)


Quote:

noobmonkey[45]: X has to run on a logical display. DISPLAY is an environment variable that is set when you fire up an X session (e.g. login). Since you're not logged into your graphical session as root (I hope not, anyway!), you need to set it manually.
Ahhh thanks to you and edge both on this one! - I'm yet to fully figure out the root v use ridea, i klnow it's similar to an administrator in windows... but not at the same time...
But i do know that i can swap between them when asked to now, so thats a start!


Quote:

Oh, and to put in my two cents about the C++/Python discussion, I would note that not only is C++ much nicer than C, but Qt takes care of most of the remaining messy bits. Python is still probably easier for many things, but it's a matter of preference as well as the situation, really. Also note that (probably) the majority of Linux software can be used directly by C++ programs, but there aren't Python bindings for everything (although it's close!).
From a very n00bish point of view, i'm looking for the first one that gets hello world on the screen - from there i will start analysing the code, play with it, compile it...see the changes, and doi it over and over again with new lines of code to compare changes :) - thats the way i learn :) hehehe

I have some object orientated programming experience and hated it to be honest, but i'll do what must be done to get hello world working :) hehehe

noobmonkey 2009-12-16 10:22

Re: New Developers/coders? Help!!?!
 
Forgot to mention, left the GUI installing at home - so will be on it tonight :)
Anniversary with the GF may get in the way of Ubuntu fun though!

p.s. jaem - you deserve a huuuuge pat on the back for all of your help. You have really given me a great boost so far.

jaem 2009-12-16 10:59

Re: New Developers/coders? Help!!?!
 
Quote:

Originally Posted by noobmonkey (Post 430235)
Hehe - did a few google searches, doesn't look like i was the only person with this problem :), after installing plain old Ubuntu - i have to say i much prefer it :)

To each their own :P
Quote:

Originally Posted by noobmonkey (Post 430235)
Thanks for the zip idea - makes sense to me! (Shocker!) Not understanding the second part - but i'll refer back to it when i get hello world working! :) :)

Well, on Windows, you (and your installers) just dump files anywhere they feel like it, which is part of the reason it can be easy for your Windows install to get a bit crufty over time. Linux, on the other hand, files everything away neatly, and keeps a database tracking all currently installed files, and which package they belong to. In most cases, then, you keep your personal (untracked) files inside your home directory. As long as you do this, then you can be assured that things will be installed/uninstalled cleanly, and your system will be happy. If you don't, and you say, install something manually that isn't packaged (e.g. by running make install, or copying the files into /usr/bin, /usr/lib, etc.), then you'll probably run into eventual issues, because you'll have a bunch of files floating around that your system doesn't know anything about, and that you'll probably forget you put there. This is one of the primary reasons for using package management, and if you don't follow it, it kind of defeats the point. What I was saying was that until you figure out the packaging process, just put the files in a subdirectory of /usr/home. If it's just a single binary, then you can run it from the terminal (once you've made it executable) by running "/path/to/binary". If you have more than one executable, or your own libraries, it's a bit more complicated - Google "path environment variable", and "ld.so.conf ldconfig" for details, and ask questions if you still don't get it.
Quote:

Originally Posted by noobmonkey (Post 430235)
Ahhh thanks to you and edge both on this one! - I'm yet to fully figure out the root v use ridea, i klnow it's similar to an administrator in windows... but not at the same time...
But i do know that i can swap between them when asked to now, so thats a start!

root is just another user, which has all permissions, and can do absolutely anything. By contrast, your personal user has some subset of those permissions, and is intended (for security reasons) to be used unless you have need for root access. Most distributions advocate using sudo (or su) if you do need root access, rather than logging in graphically as root - in fact, Ubuntu won't even let you do the latter by default. Standard *nix permissions are based on users and groups thereof - there's plenty of great documention and tutorials on how that all works on the Web, so I won't repeat it here.
Quote:

Originally Posted by noobmonkey (Post 430235)
From a very n00bish point of view, i'm looking for the first one that gets hello world on the screen - from there i will start analysing the code, play with it, compile it...see the changes, and doi it over and over again with new lines of code to compare changes :) - thats the way i learn :) hehehe

Yeah, just use Python for now, then - Hello World is pretty simple in any sane language, but Python should be more quickly understandable, while languages like C++ usually take a bit of handwaving until after they explain some other concepts :P

jaem 2009-12-16 11:03

Re: New Developers/coders? Help!!?!
 
Quote:

Originally Posted by noobmonkey (Post 430236)
p.s. jaem - you deserve a huuuuge pat on the back for all of your help. You have really given me a great boost so far.

No problem - I'm just glad to help you get going. Programming can be a really rewarding hobby, but it can be a bit overwhelming to dive into alone, especially when the platform is all new as well. I wish I'd had someone to give me a kickstart when I was learning, so I'm happy to do the same for you. (But that's why we have the big happy community of the Internet, right?)
To be honest, you've gotten a heck of a lot further than most people I know would have in this time. Pat yourself on the back for that. ;)

naabi 2009-12-16 11:22

Re: New Developers/coders? Help!!?!
 
Maybe it would be a good idea to start an own thread for Qt on Maemo, but I'll ask here. How can I controll the backlight with Qt? Also what audio formats should I prefer for playing simple notification sounds?

noobmonkey 2009-12-16 11:25

Re: New Developers/coders? Help!!?!
 
Quote:

Originally Posted by naabi (Post 430277)
Maybe it would be a good idea to start an own thread for Qt on Maemo, but I'll ask here. How can I controll the backlight with Qt? Also what audio formats should I prefer for playing simple notification sounds?

The how do i control things i'm going to assume it's API calls? (Just a guess!)

Not a bad idea, would be a good idea once i'm done to do another sticky thread for getting started. Using venomrush's post as one example, another starting from an Ubuntu install from scratch :)

Then once people have it up - pointing at either a python/QT/C thread to get people going :)

naabi 2009-12-16 14:10

Re: New Developers/coders? Help!!?!
 
Quote:

Originally Posted by noobmonkey (Post 430278)
The how do i control things i'm going to assume it's API calls? (Just a guess!)

Correct. Here's more thoughts about the issues mentioned. I guess the backlight has multiple (couple of hundred?) different brightness levels. My guess is also that you need to give this brightness value to the function call. How do I fetch the default brightness set by the user and what functions do I need to use to light up the screen? Also about the Qt's QSound class... What audio types are supported on Maemo?

pixelgeek 2009-12-16 16:37

Re: New Developers/coders? Help!!?!
 
as my "hello world" is still not working, I created a new thread for this problem: http://talk.maemo.org/showthread.php?p=430601
(@noobmonkey: keep me posted if this example works for you...)

noobmonkey 2009-12-16 16:42

Re: New Developers/coders? Help!!?!
 
Quote:

Originally Posted by pixelgeek (Post 430606)
as my "hello world" is still not working, I created a new thread for this problem: http://talk.maemo.org/showthread.php?p=430601
(@noobmonkey: keep me posted if this example works for you...)

Will do - going to try it tonight - heading home in 20 mins :)

noobmonkey 2009-12-16 19:35

Re: New Developers/coders? Help!!?!
 
Right.... i've gone off in a whole different direction! Wasn't enjoying the nokia C++ walk-through.... So i've banished myself to the world of python....

Right..... I have the sexy maemo displaying like an n900. yay!

I have used some example code to load a widget - as thats essentially what i want to try first (Probably a hard choice i know)....
Got my .py and .desktop files :) - yayness!

I've finished my first set of coding (Using Eric4 - again bad choice? not sure) - but was simple enough to type up some code!

How do i compile my code and put it in my shiny scratchboxy maemo N900 :)
Again, is that a stupidly hard question to ask to be explained?!!)

jaem 2009-12-16 20:00

Re: New Developers/coders? Help!!?!
 
Quote:

Originally Posted by noobmonkey (Post 430862)
I've finished my first set of coding (Using Eric4 - again bad choice? not sure) - but was simple enough to type up some code!
How do i compile my code and put it in my shiny scratchboxy maemo N900 :)

Python doesn't get compiled - it's an interpreted language (which is why there were comments about it sometimes being slower and more resource-hungry). To put it in scratchbox, that depends on where you want it. From outside sbox, your sbox home directory is actually at /scratchbox/users/[username]/home/[username]. Once logged into sbox, that is mapped to /home/[username]. After that, you'll have to copy your two files to somewhere Maemo expects them to be. To be honest, I can't remember where that is, but I think it's in /usr/lib. Be aware, however, that sbox has a different /usr/lib for each target, so you'll have to put it in /targets/[targetname]/usr/lib/whatever.
...and I just woke up, so that's about all I can tell you right now :P

naabi 2009-12-16 20:23

Re: New Developers/coders? Help!!?!
 
Quote:

Originally Posted by noobmonkey (Post 430862)
How do i compile my code and put it in my shiny scratchboxy maemo N900 :)
Again, is that a stupidly hard question to ask to be explained?!!)

I think the best thing would be to build a deb package from it. I'm trying to find out the best practices here, but interest seems to moderate :) Especially if you have lots of different kind of resources, i.e. executable, images, config items etc., it would be nice to have the package.

On the other hand, just execute it. You need to see some results to keep the motivation alive...

jaem 2009-12-17 05:46

Re: New Developers/coders? Help!!?!
 
Quote:

Originally Posted by naabi (Post 430949)
I think the best thing would be to build a deb package from it. I'm trying to find out the best practices here, but interest seems to moderate :) Especially if you have lots of different kind of resources, i.e. executable, images, config items etc., it would be nice to have the package.

On the other hand, just execute it. You need to see some results to keep the motivation alive...

Your completely right about best-practices, as well as less chance of messing things up with more complicated apps. My point was just that if noobmonkey is doing simple "Hello World!" - or even a more complicated single-binary app - it would probably be more simple to learn that part first, and then learn packaging once it is needed.
One note about that, because it probably isn't obvious: if you just type "foo" into the shell, the shell will interpret that as an executable program, and try to run it. It will look for that program in one or more places, in a specific order. By default on most Linux systems, those places (in some order) are usually /bin, /sbin, /usr/bin, /usr/sbin. That's all great, but if you're just wanting to run an app from your home directory, it's not going to look there, and it will give you some error about not being able to find it. There are two ways to deal with this:
1) If you want to be lazy: cd into the directory containing the binary, and run it with "./foo" or "/path/to/foo". This qualifies the path to the binary (relative or absolute, respectively), so it doesn't need to search for it.
2) If you are using a non-standard path long-term, or if you aren't running it manually: export PATH=foo will set the PATH environment variable in your shell to "foo". (You don't want to do this - it's just an example.) What PATH normally contains is the paths listed previously, separated by colons. If you want to add your custom binary path to the list, use "export PATH=$PATH:/path/to/custom/bindir". $PATH evaluates to the current value of the variable. You should probably append your custom path to the end unless you have a reason not to (see comments about order). This change will last only for the current shell session, in the current shell. You can make it permanent (or rather, autorun on login) by putting that line in your shell's rc file (e.g. /home/$user/.bashrc, .ashrc (on the N900), etc.)

aspidites 2009-12-17 06:28

Re: New Developers/coders? Help!!?!
 
IMHO, it doesn't make since to package a program for deployment until it gets closer to time to make the code public. It gets to be tedious having to issue all the commands to create a *.deb package after every code change.

My work flow has always been:
  1. write the code
  2. run locally (compiling if necessary)
  3. make corrections if there are any errors
  4. repeat steps 3 and 4 until desired results are reached
  5. copy the code to the remote platform and run there
  6. package for release
  7. test the package to make sure it installs/uninstalls correctly
  8. release the package

priya_du 2009-12-17 07:27

Re: New Developers/coders? Help!!?!
 
Hi
can anybod help me to import a existing project in esbox.Actually i want to open the given examples in esbox but m not getting success...

please help me to solve my prob...............

Thanks in advance........................

Regards
Priya


All times are GMT. The time now is 19:31.

vBulletin® Version 3.8.8