maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N900 (https://talk.maemo.org/forumdisplay.php?f=44)
-   -   anyone learn to program on their n900? (https://talk.maemo.org/showthread.php?t=55926)

extendedping 2010-06-11 17:43

anyone learn to program on their n900?
 
my linux skills are ok (recently passed my rhce) but I really suck on the programming end. I am aware that a real linux guru knows shell programming well and needs to know at least one other scripting language...from what I can tell mostly perl, perhaps some python.

Can I assume that bash is available for the n900 along with associated programs (sed awk etc) that are external but would be needed to learn shell scripting? can I further assume that I can download perl and python through apt-get and have a "real" linux computer in my pocket? thanks for listening...I know I cannot do these things on android...I can give up voice navigation for learning the basics on programming on a phone sized device...

fatalsaint 2010-06-11 17:46

Re: anyone learn to program on their n900?
 
I wrote this in python directly on my N900 today as an example for someone else's question using VI.

Bash3 is available in the repositories as well. Sed and Awk are both on my N900 provided by BusyBox.

So: Yes.

extendedping 2010-06-11 17:53

Re: anyone learn to program on their n900?
 
thanks that looks cool, I don't understand a word of python. If I am using bash to write a script, can bash use the busy box sed/awk, or do I have to be using busy box as the shell too? also what about perl is that available as well?

fatalsaint 2010-06-11 17:56

Re: anyone learn to program on their n900?
 
Yes; it'll be fine. It will just execute the sed/awk that's in your path which is the BusyBox. You could of course recompile/replace (or just copy the binaries from the SDK or something) to replace the BusyBox with the real deals.. but unless the BusyBox versions are specifically missing an option you want/need there's no reason to.

In fact you can pickup an N900 and start shell scripting right away without even loading the full Bash3 and (most) things will work just fine. Bash will have some specific options that will be lacking in the busybox shell but unless/until you run into those you don't need Bash either.

extendedping 2010-06-11 18:35

Re: anyone learn to program on their n900?
 
thanks, seems despite meego coming and some shortcomings I will put myself on the prowl for a cheap n900 used. btw and perl? is that in the repo too?

Rob1n 2010-06-11 18:46

Re: anyone learn to program on their n900?
 
Quote:

Originally Posted by extendedping (Post 710979)
thanks, seems despite meego coming and some shortcomings I will put myself on the prowl for a cheap n900 used. btw and perl? is that in the repo too?

Yes, perl's available for the N900 as well (though unfortunately a lot of the addon libraries aren't).

terryowen 2010-06-11 19:24

Re: anyone learn to program on their n900?
 
Perl is 5.8.3, which is kind of old but readily available in xterm. Python 2.5 is built in but it seems like every app installs extra Python libs so even though I love Perl, Python is probably where I'd start.

While not exactly on topic, I made myself a Roku remote last night with qtirreco - it was kind of fun not to have to buy an app - although I'd probably pay a dollar for one that was prettier. Being able to make something without having to wait for a developer to do it is pretty sweet.

If you like something like TCL, the arm etcl from Evolane that never ran on my Android phone ran fine on the N900. I have some badly modified (by me) games that I originally put together for my Dell Axim and they ran. That's always been my dream, reusable apps on the desktop and pda/phone.

Terry

gabby131 2010-06-11 19:35

Re: anyone learn to program on their n900?
 
because of so cool and friendly community, i now have enough knowledge to do partitions in the n900's memory.

Thanks!

geneven 2010-06-11 19:35

Re: anyone learn to program on their n900?
 
That's interesting about Roku, I have one of those.

Another programming language available is Ruby (and irb).

gabby131 2010-06-11 19:46

Re: anyone learn to program on their n900?
 
you awesome people are so cool!

i know English and Filipino languages but not C++, java, Ruby or anything else :D

deed 2010-06-11 19:52

Re: anyone learn to program on their n900?
 
You could also code in raw c. I used to code some small utilities in c for my linux home computer... long time ago!
I've installed gcc and tools, and thanks to Pygtkeditor, I've been able to write and compile a little tcp sniffer straight on my n900! (you can find it somewhere in app section).
Now I'm tinkering with netbeans on the phone. A bit slow though but usable. I have to try a bit of pyQt now.

extendedping 2010-06-11 20:06

Re: anyone learn to program on their n900?
 
thanks for the responses...I really want to learn updated versions of the languages, can you in fact install more recent (and working) versions in the easy debian chroot package I have heard about?

fatalsaint 2010-06-11 20:13

Re: anyone learn to program on their n900?
 
Quote:

Originally Posted by extendedping (Post 711117)
thanks for the responses...I really want to learn updated versions of the languages, can you in fact install more recent (and working) versions in the easy debian chroot package I have heard about?

Yes, with some work.

terryowen 2010-06-11 20:17

Re: anyone learn to program on their n900?
 
Quote:

Originally Posted by geneven (Post 711056)
That's interesting about Roku, I have one of those.

Another programming language available is Ruby (and irb).

Funny, this morning I was just thinking of installing Ruby so I could play with it.

The Roku remote settings were available for download from the program menu, so all I had to do was move buttons around and add a background. Not very polished but it worked. Now the next time the remote gets lost, I'm set.

And while not exactly a language, the SQLite database can be very rewarding to learn to use.

Terry

terryowen 2010-06-11 20:24

Re: anyone learn to program on their n900?
 
Quote:

Originally Posted by extendedping (Post 711117)
thanks for the responses...I really want to learn updated versions of the languages, can you in fact install more recent (and working) versions in the easy debian chroot package I have heard about?

While I complained a bit about the Perl being old, sometimes it can be better to learn an older version of a language, especially if it's widely used. Where I work, for some reason they only have Perl 5.6 installed so if I were to use 5.12 or Perl 6, I'd have to deal with even more compatibility issues.

So, you shouldn't have to worry about coding in Python 2.5 - either your stuff will run as backward compatible or you'll have thousands of fellow coders to keep you company as you find out which features are deprecated. Which is an equally useful learning experience with software. :-)

Terry

T-unit 2010-06-11 20:27

Re: anyone learn to program on their n900?
 
I learned to program in ruby on my n900...

terryowen 2010-06-11 20:46

Re: anyone learn to program on their n900?
 
Quote:

Originally Posted by T-unit (Post 711157)
I learned to program in ruby on my n900...

I'd love to see a ruby thread if anyone has any scripts to share. I'm totally self-taught when it comes to scripting and modifying existing scripts is the easiest way for me to learn.

Actually, a scripting thread on these forums would be nice to have. Something between more specialized than Applications and less formal than Development.

Terry

extendedping 2010-06-11 23:26

Re: anyone learn to program on their n900?
 
Quote:

Originally Posted by fatalsaint (Post 711129)
Yes, with some work.

ah work that a mortal like myself could overcome? I just bought a beginning perl book (oreilly press) and it covers perl 5.10 and I really just want to be able to work with the examples in the book...

ability to run updated versions of perl and python will probably be the deciding factor in this purchase. I do get that I could learn on the older versions, but linux = choice and I think on real linux I should have the choice for a newer version right? so how hard on the debian chroot install?

fatalsaint 2010-06-12 04:04

Re: anyone learn to program on their n900?
 
Easy Debian is not all the difficult to install or use.. but once you start updating packages weird things "can" happen.

It's certainly within the realm of possibility to update to whatever debian's latest perl or python is; and if you have any problems or questions there are quite a few of us here willing to help you through it.

jaeezzy 2010-06-12 04:48

Re: anyone learn to program on their n900?
 
To add, there's a thread Developing on the N900 itself? about getting the SDK in the N900 itself which opens door to lot of things ;) however, I haven't yet managed to work it out :D and 'm still waiting for answers from our great intelligent people here :)

extendedping 2010-06-12 13:16

Re: anyone learn to program on their n900?
 
I do wonder though...If I can hold till later this year, would more programming options be available on the first meego phone? or would it still be older versions of python/perl? course non of that matters if the meego does not have a hardware keyboard...

Joorin 2010-06-12 13:36

Re: anyone learn to program on their n900?
 
Quote:

Originally Posted by extendedping (Post 711942)
I do wonder though...If I can hold till later this year, would more programming options be available on the first meego phone? or would it still be older versions of python/perl? course non of that matters if the meego does not have a hardware keyboard...

Having the latest version isn't always the best alternative. Focus on learning the basics which are the same in an older version. Then, when you need to, upgrade to whatever is needed. The older version has been tested by more people and used in more ways which often leads to more stable code with the updates that have been released. New versions include new functionality that's not very well tested.

Personally, I view Perl as the least inviting option to do anything. Python is still pretty unknown to me and Ruby is just something I've read about.

I stick to C and some shell scripting when needed. Had there been an easy way to get Java going on the device, I might use that too.

But, there are more options than those: C++, LISP, LUA and some more obscure ones too. Pick the right tool for the problem and you'll be fine.

extendedping 2010-06-12 15:47

Re: anyone learn to program on their n900?
 
thanks, the reason I am looking at perl is I am trying to make the switch to linux admin and every job I look for asks for perl scripting. some mention python but perl seems to for whatever reason be the one for admins (not developers but scripting admins). plus my book (learning perl 5th addition) though backwards compatible, focuses on 5.10 perl.

so do we think I could fire up a recent version on the debian chroot with the help of this forum?

fatalsaint 2010-06-12 17:37

Re: anyone learn to program on their n900?
 
Quote:

Originally Posted by extendedping (Post 712079)
thanks, the reason I am looking at perl is I am trying to make the switch to linux admin and every job I look for asks for perl scripting. some mention python but perl seems to for whatever reason be the one for admins (not developers but scripting admins). plus my book (learning perl 5th addition) though backwards compatible, focuses on 5.10 perl.

so do we think I could fire up a recent version on the debian chroot with the help of this forum?

I already said this. Yes.

I also don't think you need to be so obsessed with the "newest" versions, either. Most newer versions still run and work with scripts written in "older" versions. The vast majority of them have backwards compatibility and mostly just add some things, not remove them.

Thus, if you learn to code in an older perl, sit at a computer with a newer perl, you will still be able to code in it. Just like I said earlier regarding Sed, Awk, and Bash - Until you actually run into something that is only in the version you want, there is no reason to beat your head against the wall to get the "newest" of anything if the older easily obtainable one does the job just fine.

I'll just put it this way: I have no idea what version of Ruby, perl, or Python I learned on. I especially have no idea what version of QT I learned first a few years ago. I don't have any idea what version of any of the above are on systems that I manage because I don't bother looking.. I realize I need to script something in either bash or perl and I just script it and run it.. and have not once had it error and then realize it's running some archaic version.

terryowen 2010-06-14 22:46

Re: anyone learn to program on their n900?
 
Quote:

Originally Posted by extendedping (Post 712079)
thanks, the reason I am looking at perl is I am trying to make the switch to linux admin and every job I look for asks for perl scripting. some mention python but perl seems to for whatever reason be the one for admins (not developers but scripting admins). plus my book (learning perl 5th addition) though backwards compatible, focuses on 5.10 perl.

so do we think I could fire up a recent version on the debian chroot with the help of this forum?

Just because the book is 5.10 doesn't mean everyone updates their Perl installation when a new version comes out. And no one rewrites existing code unless something breaks, either.

Using the built-in Perl of 5.8 would still be beneficial if you want to become an admin. Odds are you would have to maintain scripts written in earlier versions of Perl anyway. When I have to troubleshoot a script I didn't write, that's the first thing I ask.

You can always search Google for Perl 5.8/Perl 5.10 changes. There are tons of hits. But if you don't know Perl, they won't mean anything until you do.

IMO, nothing beats opening an x-term and just writing a script. Why get bogged down with advanced features until you actually need them? Practice your regular expressions and system calls. Write shell scripts, lots of them. Wrangle text files and log ouptut. Then maybe worry about EasyDebian.

Terry

devu 2010-06-14 23:04

Re: anyone learn to program on their n900?
 
I've already managed hot to create Hello World app in QT and compile it with my own icon using MADDE to N900. I've got cool big button I can press :)

C++ development itself is a different story to learn but who knows.. If time permits. Using QT to figure out library functionality is quite intuitive and there is a lot of examples, thumbs up for that. I'm completely noob to this area.

I even figured out how to use WebKit and launch some website but getting flash working under this will be my next step to learn. No luck at the moment.


All times are GMT. The time now is 07:57.

vBulletin® Version 3.8.8