07/12/2009, 01:33 PM
|
#1 (permalink) | ||||
|
Member
![]() ![]() Join Date: Nov 2007
Location: Rhode Island, USA
Posts: 1,739
Likes Received: 15
Thanks: 381
Thanked 398 Times in 217 Posts
|
*NOTE*
For a complete compilation of tutorials available please visit RickNeff's site here. ****Editted for the Official SDK Release July 16, 2009**** *NOTE*: Official documentation and information can be found from Palm's Developer site HERE. Hey Guys! I notice a lot of people on this forum have a lot of interest in developing for the Pre but they're not quite sure where to start. Personally, coming from absolutely NO background in HTML/CSS/Java, the route I followed is: 1. Pick up some basic skills from HTMLDog. 2. Download, install and set up the OFFICIAL SDK here. Please sign up for official WebOS Dev status. It makes Palm happy. <-----------------I'm not too sure if the following instructions still apply-------------------> 2a. If you have Vista 64 follow Blubble's instructions here. 2b. If you have a Mac, go here. <-----------------I'm not too sure if the previous instructions still apply-------------------> I STRONGLY suggest downloading directly to the C:/Palm directory as it makes everything a bit smoother (imho) 3. You may begin looking at the code with Notepad, but I personally suggest something a bit more powerful and accomodating. You will need something that autoformats (Notepad does not) as well has color-coded syntax is a huge plus. Try Notepad++. The download page from Notepad++ may look a little shady, but I guarantee its from their actual website. You can verify this by clicking on "Download Notepad++ executable files" from their actual website. 4. Navigate into: Code:
Palm/SDK/share/samplecode/tutorial .5. Launch the SDK and make sure it works. 6. To begin, launch the command prompt (Start-> run -> cmd) or on Vista (Start-> type "cmd", wait for the icon to show up, right click -> "Run as Admin") 7. The instructions (or explanations) are in parentheses do not include these when you type the following. Type: Code:
cd/ (Thank you Malefickus) cd Palm/SDK/share/samplecode/tutorial palm-package HelloWorld palm-install com.yourdomain.hello_1.0_all.ipk 9. Navigate (from your desktop explorer) into the Hello World app folder and go into: Code:
Palm/SDK/share/samplecode/tutorial/HelloWorld/app/assistants 10. Open up the other assistant (first-assistant.js) and you should see the guts of the app here. Play around with these and find out what each thing does. 11. To find the corresponding html file, go into: Code:
Palm/SDK/share/samplecode/tutorial/HelloWorld/app/views 12. Open up first-scene.html and look around, and play with some of the options here. Having fun yet? ![]() Now, to point you in the right direction: If you would like to start throwing widgets (and very simple basic interactive functionality) into your app, navigate to this folder: Code:
Palm\SDK\share\refcode\webos-framework\191.14\javascripts This folder has a list of .js files which are very well commented and teach you how to use the multiple features of Mojo. I strongly suggest going through the widget_*.js list and reading all (if not most) of them. It is good to know what Mojo/Widgets are capable of to build a library of tools you can include in your app. Personally, I havn't done this, as I only like to look up the information I need when I need it, it's good to know where it is, and whether it can be done easily or not. Now that you know how/where to change things, and where to pick up certain information on how to include things, you only have a few things left to learn: To begin, I strongly suggest packaging and installing the sample apps included in this folder: Code:
Palm\SDK\share\samplecode\samples Code:
palm-package UIWidgets palm-install com.palmdts.uiwidgets_1.0_all.ipk ![]() Finally, I have included my own app which I began with. It's basically a modified Hello World app with a bunch of Mojo Widgets and functionality built in. I have included buttons, sliders, intpickers, how to include more than one page, hidden lists/groups, as well as menu modifications. I tried adding some comments in to help future develops, but they are by no means complete instructions and do require some research and understanding on your part. Feel free to look around, steal code or the like. Final Note: PLEASE PLEASE PLEASE begin ASAP. I STRONGLY suggest anyone who's interested to hop right in. Reading instructionals is a good way to begin... but reading websites on how to code can take years and personally, gets a little boring. Jump right in, break a few apps, reinstall the SDK do it all over again. Get your hands dirty and have fun. You might just make a useful app out of the whole deal. ![]() Have Fun and Good Luck! *note* I would REALLY like to thank all the people on this forum who are SO incredibly helpful, and without whom, I would not be where I am today. People who I can think of right now are: roar, Blubble, PreGame, d2globalinc, rboatright... and MANY MANY more... Thank you! I have included the ipk of my file for instant access, as well as the zip so you can go in and have a look around. *edit* Quote:
I have modified the attachments to include the app passed through JSLint. *edit #2* Quote:
Quote:
Quote:
Last edited by SirataXero; 09/28/2009 at 01:20 PM. |
||||
07/12/2009, 03:20 PM
|
#3 (permalink) |
|
Member
![]() ![]() Join Date: Nov 2007
Location: Rhode Island, USA
Posts: 1,739
Likes Received: 15
Thanks: 381
Thanked 398 Times in 217 Posts
|
Right. Not entirely, but there should be enough widgets to make something fun and interesting... and get you started.
We can look into useful, functional apps when the SDK is properly released. *edit* Still waiting on the "useful, functional apps" part, Palm... Last edited by SirataXero; 07/19/2009 at 01:50 AM. |
07/12/2009, 05:35 PM
|
#4 (permalink) |
|
Member
![]() ![]() ![]() Join Date: Sep 2005
Location: http://palmdoc.net
Posts: 1,813
Likes Received: 20
Thanks: 295
Thanked 230 Times in 138 Posts
|
Thank you very much. This is the sort of thing which helps us noobs. I agree with you that actually doing it is far better than extensive reading. Sort of like "learn along the way". I think if we are going to develop apps, they will be for our specific needs and not all of us will need to know every bit of webos, JS coding unless we want to become professional coders.
Btw, I have been using HTML-kit since I already use that for basic HTML editing and it supports JS and CSS. Is Notepad++ a better option?
__________________
Check out my My Medical webOS Apps Featured free apps: DrugView | Eponyms | eMed | Dosecalcfree | Beeb News |
07/12/2009, 06:15 PM
|
#5 (permalink) |
|
Member
![]() ![]() Join Date: Nov 2007
Location: Rhode Island, USA
Posts: 1,739
Likes Received: 15
Thanks: 381
Thanked 398 Times in 217 Posts
|
You're welcome! I try my best to encourage noobs like myself to get up and start coding, trying to build the developer base is as important to and will ultimately lead to a strong and large application library.
I have heard a general consensus from these forums that in order to not have a very powerful software suite which you only use for coding, using Notepad++ provides you the basic functionality you need, with the power required to start and stay organized while coding. I have never personally heard of HTML-kit, but it sounds a bit like Firebug for Firefox. Have you looked into that at all? I started a thread asking about a good piece of Freeware that would help organize and maintain files while allowing for editing and programming. Last edited by SirataXero; 07/16/2009 at 10:38 PM. |
07/12/2009, 07:00 PM
|
#8 (permalink) |
|
Member
![]() ![]() Join Date: May 2009
Location: Oklahoma
Posts: 530
Likes Received: 13
Thanks: 68
Thanked 102 Times in 56 Posts
|
Um this is really helping me dive in. I've been wanting to know for days what does "this" mean. I keep seeing it everywhere and if I knew the purpose/function of it I think I could really start to make some headway.
__________________
frankos72 Simple Bible - Simple Bible Pro - Bits of God Website My Day Job: www.pigstands.com |
07/12/2009, 08:22 PM
|
#10 (permalink) | |
|
Member
![]() ![]() Join Date: Nov 2007
Location: Rhode Island, USA
Posts: 1,739
Likes Received: 15
Thanks: 381
Thanked 398 Times in 217 Posts
|
Quote:
Dude. That took me FOREVER. Honestly, I STILL don't know what "this.something" does since I have no official JS experience at all. I've just recently looked into it and you might want to read up on this. ![]() Notice the pun? As for everyone else, Your welcome! I honestly had been looking for something like this for a LONG time until I just said "i'm tired of waiting" and dove on in. I KNEW there HAD to be more of those kind of people out there so I decided to release my test app and let them get a head start. Good Luck! |
|
07/12/2009, 08:26 PM
|
#11 (permalink) |
|
Member
![]() ![]() Join Date: Jun 2009
Location: topeka, ks
Posts: 550
Likes Received: 0
Thanks: 4
Thanked 188 Times in 90 Posts
|
WONDERFUL JOB of handing the community a starter app that people can factor off of. Thank you!!!
I've attached a copy of the zip that I ran through JSLINT JSLint, The JavaScript Code Quality Tool I can not suggest strongly enough that you use jslint with the "Good Stuff" settings to ensure that your code is clean and error free. JSLINT is as close as you will come to the kind of review you get from a compiler in Java or C# or C++. Use it. SirataXero, in this case there was a couple of formatting errors that jumped out. Sometimes you did function () { //right and sometimes you did function () { //wrong javascript RUNS with the second formulation, but it's not safe. See Douglas Crawford's web site for examples of when it will bite you. Additionally, you had "rather a lot" of missing semi-colons. Javascript WILL put in semi-colons for you, but again, it's been known to do them in the wrong place. Better to not forget. Anyway, JSLINT'ed zip file attached. Rick_ |
07/12/2009, 08:33 PM
|
#12 (permalink) | ||
|
Member
![]() ![]() Join Date: Nov 2007
Location: Rhode Island, USA
Posts: 1,739
Likes Received: 15
Thanks: 381
Thanked 398 Times in 217 Posts
|
Quote:
Just trying to do my part.Quote:
function { was just my own personal preference. I guess i'll look a little bit further into JS rules and whatnot. Thank you VERY much for the "compiler". I'll include it in the OP. Appreciate the help! Last edited by SirataXero; 07/12/2009 at 10:07 PM. |
||
07/12/2009, 08:43 PM
|
#13 (permalink) |
|
Member
![]() ![]() Join Date: Jun 2009
Location: topeka, ks
Posts: 550
Likes Received: 0
Thanks: 4
Thanked 188 Times in 90 Posts
|
function
{ is perfectly appropriate java formatting. (Sun style isn't it?) but Javascript is NOT JAVA Boy is that true. Javascript is LISP in a C syntax. But Javascript was the first lambda language widely available. (yes, there is a lambda extension to C++ now.) Javascript has PROTOTYPICAL inheritance, not CLASSICAL inheritance. That is objects can inherit DIRECTLY FROM OTHER OBJECTS. There's no such thing as a class. Don't let the syntax fool you into thinking that you're creating classes. You aren't. Also, it's VERY IMPORTANT for programmers with experiance in the C dialects including Java to be very very aware that braces DO NOT INITIATE SCOPE in Javascript. Variables are scoped within FUNCTIONS... but only if you initialize them with a var call Family = function () { var fred = 'flintstone'; var barney = 'rubble'; }; leave the var off, and those variables are automagically global. Ooooops. Also, be very careful about == vs === Javascript trys hard to be nice when you test something with == So, it casts things hard to try to reduce everything to a string or a number (whichever comes first) and then tests equality. This leads to a weird failure of transitivity: 0 == '' //true '' == 0 //false ooops.... Much better to always use === :-) |
07/12/2009, 09:04 PM
|
#14 (permalink) | |
|
Member
![]() ![]() ![]() Join Date: Sep 2005
Location: http://palmdoc.net
Posts: 1,813
Likes Received: 20
Thanks: 295
Thanked 230 Times in 138 Posts
|
Quote:
![]() Btw Mods, should this be a sticky?
__________________
Check out my My Medical webOS Apps Featured free apps: DrugView | Eponyms | eMed | Dosecalcfree | Beeb News |
|
07/13/2009, 07:54 PM
|
#15 (permalink) |
|
Member
![]() Join Date: Oct 2007
Posts: 490
Likes Received: 7
Thanks: 9
Thanked 64 Times in 36 Posts
|
I'm having a small issue, I have the emulator running well and I created the ipk file, but when I do the palm-install, it does not show in my emulator. Am I missing something?
Nevermind, I found it out! ![]()
Last edited by groovdafied; 07/13/2009 at 08:18 PM. |
07/13/2009, 08:10 PM
|
#16 (permalink) | |
|
Member
![]() ![]() Join Date: Nov 2007
Location: Rhode Island, USA
Posts: 1,739
Likes Received: 15
Thanks: 381
Thanked 398 Times in 217 Posts
|
Quote:
Also make sure you are entering the correct ipk name when you type the palm-install command. Read the results that come up after you type to make sure there's no errors. If you can, try to post a screenshot (or type it if you feel brave) the results after you type palm-install. |
|
07/13/2009, 08:19 PM
|
#17 (permalink) | |
|
Member
![]() Join Date: Oct 2007
Posts: 490
Likes Received: 7
Thanks: 9
Thanked 64 Times in 36 Posts
|
Quote:
|
|
07/13/2009, 08:23 PM
|
#18 (permalink) | |
|
Member
![]() ![]() Join Date: Nov 2007
Location: Rhode Island, USA
Posts: 1,739
Likes Received: 15
Thanks: 381
Thanked 398 Times in 217 Posts
|
Quote:
AWESOME! I'm glad you figured it out, and I'm glad you jumped on board to have fun. Hope you make something soon and release it! ![]() Good Luck! |
|
07/13/2009, 09:14 PM
|
#20 (permalink) | ||
|
Member
![]() ![]() Join Date: Nov 2007
Location: Rhode Island, USA
Posts: 1,739
Likes Received: 15
Thanks: 381
Thanked 398 Times in 217 Posts
|
Quote:
Quote:
Good Luck! |
||
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|



