webOS Nation Forums >  webOS Discussion >  Open webOS General Discussion > C Programming on the TouchPad
C Programming on the TouchPad
  Reply
Like Tree1Likes
  • 1 Post By LizardWiz

 
Thread Tools Display Modes
Old 01/16/2012, 04:48 PM   #1 (permalink)
Member
 
Posts: 1,623
I just bought a book on programming in C. I need the ability to write, compile, and run a C program on my TouchPad. Is this possible and what do I need to install to get this working? Can I do it with the version of Ubuntu that is available for the TouchPad?

---Sent from my HP TouchPad using Communities (a great webOS app!)
k4ever is offline   Reply With Quote
Old 01/16/2012, 04:52 PM   #2 (permalink)
Member
 
Posts: 252
there is this? Application:Tide - WebOS Internals
Not sure if its any help i dont know much about C programming
rbyrne is offline   Reply With Quote
Old 01/16/2012, 06:09 PM   #3 (permalink)
Homebrew Developer

 
Posts: 3,536
To actually do it all on touchpad, I think you'd have to install Ubuntu. Otherwise, you should use the developer SDK and PDK ..
__________________
Author:
Remove Messaging Beeps patch for webOS 3.0.5, Left/Right bezel gestures in LunaCE,
Whazaa! Messenger and node-wa, SynerGV 1 and 2 - Google Voice integration, XO - Subsonic Commander media streamer, AB:S Launcher
Quote:
(1:39:33 PM) halfhalo: Android multitasking is like sticking your fingers into a blender
GO OPEN WEBOS!
People asked me for a donate link for my non-catalog work, so here you are:
eblade is offline   Reply With Quote
Old 01/17/2012, 04:20 AM   #4 (permalink)
Member
 
Posts: 327
I have installed Ubuntu in a VM and used the following guide for setting up the toolchain:
https://developer.palm.com/content/r...ad.html#c28522

I keep the emulator running in another VM (in parallel to my Ubuntu VM).
__________________
Preł (iPhone 4), TouchPad 32 GB (PlayBook 16 GB)
T-Pad is offline   Reply With Quote
Old 01/17/2012, 04:25 AM   #5 (permalink)
Member
 
Posts: 237
You could always use SplashTop, and code on your PC using the TP.
__________________
My apps:
Giddy 3 | Gridword
Xeron is offline   Reply With Quote
Old 01/17/2012, 10:19 AM   #6 (permalink)
Member
 
Posts: 73
For or on?
awats is offline   Reply With Quote
Old 01/17/2012, 12:21 PM   #7 (permalink)
*Moderator in Memorium*
 
OldSkoolVWLover's Avatar
 
Posts: 7,732
Quote:
Originally Posted by k4ever View Post
I just bought a book on programming in C. I need the ability to write, compile, and run a C program on my TouchPad. Is this possible and what do I need to install to get this working? Can I do it with the version of Ubuntu that is available for the TouchPad?

---Sent from my HP TouchPad using Communities (a great webOS app!)
Curious what book did you get?
__________________
I love physical keyboards... but there is two devices that would make me consider a slab, one is something running a full version of Open webOS. The other is an iPhone!!!! HA HA just kidding (about the iPhone that is)...
OldSkoolVWLover is offline   Reply With Quote
Old 01/17/2012, 03:40 PM   #8 (permalink)
Member
 
Posts: 1,623
Quote:
Originally Posted by OldSkoolVWLover View Post
Curious what book did you get?
Programming in C. A complete introduction to the C programming language. 3rd Edition

By Stephen G. Cochan

Sent from my PG86100 using Tapatalk
k4ever is offline   Reply With Quote
Old 01/17/2012, 03:47 PM   #9 (permalink)
Member
 
Posts: 1,623
Right now my TouchPad is a brick. I installed Arch Linux to it last night to try to set-up a programming environment on it. I ran a recommended update by the Arch Linux TouchPad folks that borked the install and caused it to loop. I could not reclaim the space I allocated for the install so I doctored it. Now I can't log into my webOS account for some reason. HP says the servers are down. I'm not a happy camper at all. I started a thread about it for help.

Once I get the TouchPad back up and running, I'm going to install Ubuntu.

Sent from my PG86100 using Tapatalk
k4ever is offline   Reply With Quote
Old 01/17/2012, 03:48 PM   #10 (permalink)
*Moderator in Memorium*
 
OldSkoolVWLover's Avatar
 
Posts: 7,732
I was recommended "The C Programming Language" aka "The C Bible" written by the developers of C. Haven't picked it up yet, not sure if I want to focus on that right now or something else.
__________________
I love physical keyboards... but there is two devices that would make me consider a slab, one is something running a full version of Open webOS. The other is an iPhone!!!! HA HA just kidding (about the iPhone that is)...
OldSkoolVWLover is offline   Reply With Quote
Old 01/17/2012, 04:43 PM   #11 (permalink)
Member
 
Posts: 1,623
The book you mentioned was highly recommended by one of the C programming sites I use. I didn't get it because it was almost $100. The one I bought was $15 on Kindle.

Sent from my PG86100 using Tapatalk
k4ever is offline   Reply With Quote
Old 01/17/2012, 05:01 PM   #12 (permalink)
*Moderator in Memorium*
 
OldSkoolVWLover's Avatar
 
Posts: 7,732
Oh I'm looking for hard copy, found it sub $40 a couple places.

I'm old skool when it comes to manuals, I like physical copies. I have a decent collection of VW hard copy repair manuals as well.

I keep digital copies of ECU scans and the CEL code database for the newer VW's. And a 4 gig digital collection of various data and pictures that can't readily be found in print form.
__________________
I love physical keyboards... but there is two devices that would make me consider a slab, one is something running a full version of Open webOS. The other is an iPhone!!!! HA HA just kidding (about the iPhone that is)...
OldSkoolVWLover is offline   Reply With Quote
Old 01/17/2012, 11:12 PM   #13 (permalink)
Member
 
Posts: 184
The C Programming Language is not a beginner book. I would classify it as a reference for programmers. I don't know what book you should use, but, essentially the difficult thing to understand in C would be pointers. Probably the easiest way that people get the concept is by learning about arrays->accessing arrays with pointers. Then they see how it applies to char arrays (ie. strings for lack of a better term)->using pointers to loop through words.

It begins to make sense.

Once you get it, you begin to understand the difference between memory variables and how to accelerate your code by accessing memory locations directly.

I don't really know how much programming you know but the basics of it is pretty simple: declaring variables, declaring/using functions, and programming statements which make up the logic of your code (there are very few but the main ones would be: for, if, while, do while, and switch).

Most of computer programs perform operations in iterations (while/do while/for) while using logical evaluations (if/switch) on some type of variable to perform other iterations. The process is so simplistic when you think about it because when you get down to it the CPU is really just a complex thing comprised of simple electrical switches (on/off, or 1/0).

The thing is that it performs millions of these per second, so my best advice to a novice who wishes to become a programmer is to understand the boolean nature of computers and how to reduce complex logic into simple boolean logic as quickly as possible. That is the nature of pretty much every programming language.

The simplest thing I can say that C and C++ give you is accelerated access to variables by referring directly to memory locations to retrieve them, that is what makes the language so much faster.

Once you learn the basics of C, I would skip to C++ so that you begin to understand object oriented programming as all windowed systems use classes (which are basically structures which encapsulate functions and variables within itself to define functionality). That is, unless you are going to be writing low level stuff like media streaming algorithms or drivers (which actually access hardware components by memory addresses).

I guess.

It is pretty difficult to explain.

Have fun.

Edited: I guess another interesting thing that people learn in C would be bitwise operations, though most people probably never use them, however, if you want to write games you will use them indefinitely.

I guess I'm not really much of a teacher.

Last edited by LizardWiz; 01/17/2012 at 11:17 PM.
LizardWiz is offline   Reply With Quote
Liked by hagster likes this.
Old 01/18/2012, 07:37 AM   #14 (permalink)
Member
 
mtiberio's Avatar
 
Posts: 307
Why do they call it C++?






It's a grade...

mtiberio is offline   Reply With Quote
Old 01/18/2012, 08:33 AM   #15 (permalink)
Member
 
Mutoidi's Avatar
 
Posts: 1,851
Well.. if anyone gets good enough at 'C'.. I believe there is a little project to kind of transpose 'MaptoolPro's' ability to read and respond to an External Bluetooth GPS to 'Navit'.. in order that it can also to this?
VERY useful for WiFi/Bluetooth-only TP owners who also want 'Navit' GPS Mapping ability!

Call for C-Developer to create the support for external BT Bluetooth receivers

Just a (serious) thought!


Last edited by Mutoidi; 01/18/2012 at 08:49 AM.
Mutoidi is offline   Reply With Quote
Old 01/29/2012, 10:14 AM   #16 (permalink)
Member
 
Posts: 7
C on the TP? Now your speaking my language =)
VintagePre is offline   Reply With Quote
Old 02/04/2012, 05:36 PM   #17 (permalink)
Member
 
Posts: 61
Quote:
Originally Posted by k4ever View Post
I just bought a book on programming in C. I need the ability to write, compile, and run a C program on my TouchPad. Is this possible and what do I need to install to get this working? Can I do it with the version of Ubuntu that is available for the TouchPad?

---Sent from my HP TouchPad using Communities (a great webOS app!)
I use my touchpad for c programming. Here is how I have it setup. I have ubuntu installed (see the install and easy autoconfig threads) then I created a directory in ubuntu, say /home/username/C_programs. then download Tide from preware (might need beta feeds enabled). For the default path set it to "/meda/ext3fs/ubuntu-natty-chroot/home/username/C_programs". That lets you edit your files/program easily from webos. To build them you can do that from ubuntu with gcc from the terminal. "gcc program.c". This lets me use the webos keyboard without having to jump through hoops to get it working perfectly in ubuntu. I would have rather stored the files on the webos side but svn from ubuntu wouldn't allow it, but this works great for me.
Using Tide is pretty optional too. You could do it all from ubuntu. For file editing gedit works well. vi has issues if your using the stock keyboard because of the difficulty in pressing esc. There might be an ide that works from ubuntu for c editing that is better than tide too, I didn't really look into that.
kyle3om is offline   Reply With Quote
Thanked by GreenHex, k4ever
Old 10/14/2012, 04:27 AM   #18 (permalink)
Member
 
Posts: 174
Kinda belated, I know... But the easiest way for c/c++ on board coding should be via optware. Just install the gcc package. Yout get the gnu c compiler environment on your webOS device. Working smoothly on my Pre 2. If you are able to install optware on your TouchPad, you don't need an ubuntu chroot.

code
ipkg-opt install gcc


The "gcc <filename> -o <output_filename>" command compiles c code, "g++ <filename> -o <output_filename>" swallows and digests c++ code.

File editing can be done via nano, internalz, or novaterm

HTH

Carsten
ZehHa is offline   Reply With Quote
Reply

 

Thread Tools
Display Modes



 


Content Relevant URLs by vBSEO 3.6.0