programming the Aspire One

Discussion in 'Acer Aspire One' started by George Shering, Nov 5, 2008.

  1. George Shering

    George Shering

    Joined:
    Nov 5, 2008
    Messages:
    24
    Likes Received:
    0
    I just got my Aspire One Aw Unix today from Tesco.
    Perfect except that the touch pad is a bit fast for older people.
    I want to write a program for it which I have already developed in Visual C#.
    I gather from the web that the best way is to use Gvim, make and gdb?
    I would need the resources for Graphics user interaction and USB interface.
    Is all this available for the Aspire one?
     
    George Shering, Nov 5, 2008
    #1
  2. George Shering

    Duncan_Rowland

    Joined:
    Aug 25, 2008
    Messages:
    246
    Likes Received:
    0
    Hi George, welcome aboard :)
    Probably best if you say exactly what it is the code you're developing needs to do...
    ..there are lots of options here.
    e.g. porting to another language, compiling c# for mono, or for window and running in wine...
     
    Duncan_Rowland, Nov 5, 2008
    #2
  3. George Shering

    George Shering

    Joined:
    Nov 5, 2008
    Messages:
    24
    Likes Received:
    0
    The code is a graphics program which reads data from an embedded microprocessor via USB.
    It displays and interacts with the data, including saving it, and can change the device settings.
    I wrote it myself in C# with a version in C++ in Visual 2005 and 2008.
    It is for model airplanes and needs to be used in the field. The Aspire One is a very suitable device.
    I can easily re-work the code in either C or C++ .
    I need a development system but I do not know where to start.
    I am not afraid of the traditional unix tools if these are the most readily available.
    George
     
    George Shering, Nov 5, 2008
    #3
  4. George Shering

    Duncan_Rowland

    Joined:
    Aug 25, 2008
    Messages:
    246
    Likes Received:
    0
    OK, well first principles I guess? Open a terminal and install a C compiler
    Click Files -> My Documents and then File->Terminal, type

    $ sudo yum install gcc

    You can use mousepad to edit a text file (hello.c), e.g.
    $ mousepad hello.c
    and enter your code...

    #include <stdio.h>
    main()
    {
    fprintf(stdout,"hi");
    }

    then compile it on the command line with
    $ gcc hello.c
    and run it with
    $ ./a.out

    Is that the sort of thing you need?
    Alternatively, have you looked into installing wine? It is not unlikely that your software could run as it...
    see http://www.winehq.org (I would recommend trying this first ;))
     
    Duncan_Rowland, Nov 5, 2008
    #4
  5. George Shering

    George Shering

    Joined:
    Nov 5, 2008
    Messages:
    24
    Likes Received:
    0
    Thanks, Duncan. I have read the Wine site and it is very interesting. Looked at the pictures too. Are you going to USA for the conference?
    My program uses .net 3.5.
    But my orientation is towards the Aspire One, not Windows.
    Has ANYBODY written a program on the Aspire One for the Aspire One?
    I don't know where to start and need some pointers.
    George
     
    George Shering, Nov 6, 2008
    #5
  6. George Shering

    Duncan_Rowland

    Joined:
    Aug 25, 2008
    Messages:
    246
    Likes Received:
    0
    I see, well the wine page says .NET 3.5 does not work, so I guess you do need to do some work :)
    http://appdb.winehq.org/objectManager.p ... n&iId=2586
    Aspire One Linix is Fedora (8), so in theory, (nearly) anything developed for that Fedora should work.
    Lots of people have written lots of applications on and for this operating system,
    (it's not like you develop for a specific laptop usually...)
    What the best development platform will be really depends on what you want to do and your own bias.
    You can code it all in C (following on from what I've shown you), or you can develop in other languages
    (Python for example). All require libraries to look into to make accessing complex features simpler.
    Good place to start is often thinking about GUI...
    e.g. Is the application form based or does it require a complex interface with bespoke graphics elements?
     
    Duncan_Rowland, Nov 6, 2008
    #6
  7. George Shering

    N6546R

    Joined:
    Aug 27, 2008
    Messages:
    126
    Likes Received:
    0
    N6546R, Nov 6, 2008
    #7
  8. George Shering

    George Shering

    Joined:
    Nov 5, 2008
    Messages:
    24
    Likes Received:
    0
    Thanks Duncan and Perry.
    Duncan, I did what you said to download and use gcc. It worked though I was a bit worried about answering "y" to some of the questions.
    So I have written my first simple program for the Aspire One.
    I have discovered that the operating system is Linpus lite and the desktop system is Xfce 4.
    I now need include files to create a form and draw a button and textbox on it.
    Where can I get these files and the supporting documentation?
    Thanks, George.
     
    George Shering, Nov 6, 2008
    #8
  9. George Shering

    Duncan_Rowland

    Joined:
    Aug 25, 2008
    Messages:
    246
    Likes Received:
    0
    Duncan_Rowland, Nov 6, 2008
    #9
  10. George Shering

    George Shering

    Joined:
    Nov 5, 2008
    Messages:
    24
    Likes Received:
    0
    After more research I find that Xfce has a development system called Xfc Foundation classes to be used with C++.
    This seems to fit my requirement.
    I am having problems installing Xfc on the Aspire One and am trying their help contact, no joy so far!
    Also C++. This gives the error "gcc: error trying to exec 'cc1plus': execvp: No such file or directory"
    when called on .cc file.

    Maybe the problems are related to my ignorance of Linux. I used Unix a lot after Bill Joy came and sold BSD Unix to my organisation in the '70s, but not since. So the Aspire One is my first contact with Unix for 30 years, and the first one I have ever owned. I am now retired far away from Unix expertise, so I was hoping the Aspire One community would fill that need. But nobody seems to program these days. Around 1980 a young fellow wrote a BASIC interpreter, combined it with a small operating system from down the road, and sold it to IBM. He became the richest man in the world and a great philanthropist. I think the Linux Aspire one is delightful, but it will never hold a candle to the Windows version if programs cannot be written for it.
     
    George Shering, Nov 9, 2008
    #10
  11. George Shering

    RockDoctor

    Joined:
    Aug 21, 2008
    Messages:
    963
    Likes Received:
    0
    Location:
    Minnesota, USA
    If you're using GTK, you might look at Glade. It's an interactive GUI-creation tool. Once upon a time it would generate C code (don't know about C++); now it just produces an xml file that you can import and work with.
     
    RockDoctor, Nov 9, 2008
    #11
  12. George Shering

    George Shering

    Joined:
    Nov 5, 2008
    Messages:
    24
    Likes Received:
    0
    Thanks. I think Glade is used somewhere in the Aspire One, I have seen the name whilst browsing the files.
    Or maybe the Xfc files.
    I'll keep my eyes open for it.
    I don't think I should have to become a system expert in order to write program!
     
    George Shering, Nov 9, 2008
    #12
  13. George Shering

    George Shering

    Joined:
    Nov 5, 2008
    Messages:
    24
    Likes Received:
    0
    I see that there is indeed a library that will run Glade xml on Xfc.
    Are you a glade expert?
    Does glade run on the Aspire One?
    It seems have a lot of "Gnome" in the file names?
     
    George Shering, Nov 9, 2008
    #13
  14. George Shering

    Duncan_Rowland

    Joined:
    Aug 25, 2008
    Messages:
    246
    Likes Received:
    0
    If you want gui authoring in glade, you might like to try installing glade2
    $ sudo yum install glade2
    and run it with
    $ glade-2
    (I don't use it myself, but I did try it out it and I think it would probably work best on a slightly larger screen than the One has - these days people often develop on a system different to where their software will eventually run...). I think your frustration "nobody seems to program these days" is entirely understandable, getting an appropriate development environment is often tricky and it can seem that you need to know everything before you start. BTW, If you like computing history, here's some suggested watching then:
    Best -Duncan.
     
    Duncan_Rowland, Nov 9, 2008
    #14
  15. George Shering

    RockDoctor

    Joined:
    Aug 21, 2008
    Messages:
    963
    Likes Received:
    0
    Location:
    Minnesota, USA
    To address your questions/statements:
    1. No, by no means am I an expert. I'm getting pretty good at RTFM (reading the fine manual), googling to find code that I can borrow that's similar to what I'm trying to write, and, when I run out of ideas, asking for help (like which FM to R). 2. Yes. Glade does run on the AA1. I've been using Glade-3 on my AA1 with lua-gtk. For the record, I'm not a BASIC, C, C++, FORTRAN, Forth, Java, Javascript, Lua, Pascal, Perl, PL/1, Python, SQL, etc...) expert either- I just hack away.
    3. Glade certainly has the capability of working with GNOME widgets, however, you need not use any GNOME components to work effectively with Glade.
    Bonus Answer to an unasked question:
    4. Once upon a time, Glade-2 could generate C (and, I think, C++) code from your interface definition. I believe it is still the case. Glade-3 only produces xml files

    HTH
     
    RockDoctor, Nov 10, 2008
    #15
  16. George Shering

    George Shering

    Joined:
    Nov 5, 2008
    Messages:
    24
    Likes Received:
    0
    Thanks for all your help.
    I have decided to go for GTK+ programmed directly in C.
    XFC does not respond, and anyway I prefer C to C++ as the other end of the USB link is programmed in C at best, otherwise assembler.
    I looked at Anjunta but it is a lot to learn and I fear slowness as the AA1 is a small machine.
    Same for Glade-3 with libglade. Glade-3 with a C code generator would be attractive if I had a lot of programs to write, but I only have one!
    Also problems of distribution. GTK+ 1 and 2 are both already installed and I was able to download the development modules using add/remove programs. Not so for the other development options, they all had unsatisfied requirements, even though I did fedora-release thing advocated elsewhere.
    It should now be simple, just hack-read-hack-read from now 'till Christmas!
    I'll give a progress report when I have something working and maybe do a "How to".
     
    George Shering, Nov 10, 2008
    #16
  17. George Shering

    George Shering

    Joined:
    Nov 5, 2008
    Messages:
    24
    Likes Received:
    0
    I got my program finished on Christmas eve, to my wife's relief. It works just fine, as well or better than on the PC.
    The combination of C and GTK+ worked perfectly, technically, but the programming is hard and long, struggling with the documentation.
    I used a book by Andrew Krause, and the GTK demo /usr/bin/gtk-demo as good introductions, then
    http://library.gnome.org/
    as the main working support.
    The external tutorial is a particularly good introduction and might save buying the book.
    George.
     
    George Shering, Dec 31, 2008
    #17
  18. George Shering

    RockDoctor

    Joined:
    Aug 21, 2008
    Messages:
    963
    Likes Received:
    0
    Location:
    Minnesota, USA
    Glad it all worked. Last month you mentioned coding directly in C without Glade or any type of IDE. Just out of curiosity, is that what you ended up doing, and, if so, what did you select for your text editor?
     
    RockDoctor, Dec 31, 2008
    #18
  19. George Shering

    jukk

    Joined:
    Jul 31, 2008
    Messages:
    54
    Likes Received:
    0
    jukk, Jan 2, 2009
    #19
  20. George Shering

    George Shering

    Joined:
    Nov 5, 2008
    Messages:
    24
    Likes Received:
    0
    That was an interesting article.
    The application is all programmed in tight C-code, source file size 60kBytes.
    I used mousepad. I tried VI but the (re)learning curve was not worth the advantages. The main lack in mousepad is no bracket matching.
    I did not use any debugger but ran the program as sudo ./UniF5B from a terminal window. printf statements in the code were enough for the debugging.
    I did nor use resource files but hard coded everything.
    There are about 127 widgets over three windows. It uses files and USB as well as GTK+.
    I used defaults everywhere except for a few text boxes with large coloured text and some buttons with no surrounds for space.
    Maybe one man-month work.
    George.
     
    George Shering, Jan 6, 2009
    #20
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.