Results 1 to 13 of 13
  1.    #1  
    As the subject says: Yesterday, I took a challenge raised by my brother, an extremely good coder: He showed me the huge arsenal of tools Microsoft puts in developer hands, proving that one can do a silly app for Windows Phone 7 in twenty minutes.

    The target app my brother did was a just a beach ball bouncing over a beach background. Indeed, it took twenty minutes, including getting two images from the net ("background.jpeg", 320x240 JPEG and "ball.png", 64x64 transparent PNG), preparing them, and "pasting" into Visual Studio 2010 + Expression blend, then over to emulator, and finally into device.

    Guess what? webOS is MORE efficient than Microsoft's environment. At least for something so simple. Given a webOS app is actually a web page (plus much more!), I started making a prototype for my desktop browser. In fact, it took me a very embarrasing long time to craft this shameful code:

    Code:
    <body style="background-image:URL(images/background.jpeg);background-repeat:no-repeat">
    		<img id="ball" src="images/ball.png" style="position:absolute;left:180px;top:160px">
    </body>
    </html>
    <script>
    	var direction = 1;
    	var energy = 0;
    	setInterval("Bounce();",40);
    	function Bounce() {
    		energy = energy + direction;
    		if(energy==20 || energy==0) {
    			direction = -direction;
    			energy = energy + direction;
    		}
    		ball.style.pixelTop += direction * energy;
    	}
    </script>
    What I wanted to do is put this HTML file inside my Pre, and then add a shortcut to it in the launcher. After a tiny bit of reverse engineering, that I'd love to accomplish one day, I fired up Ares, took out some things (!), and pasted the code inside "index.html". Guess what? It works! But the funniest thing is that the same code works both in webOS and Windows Internet Explorer. Go swallow that!
    Attached Files Attached Files
  2. #2  
    Quote Originally Posted by jcmarcos View Post
    Guess what? It works! But the funniest thing is that the same code works both in webOS and Windows Internet Explorer. Go swallow that!
    That's certainly more than what a standard Windows 7 app is capable of.

    You can start here if you want to learn more:
    http://developer.palm.com/index.php?...833&Itemid=321


    -- Sent from my Palm Pre using Forums
  3.    #3  
    Quote Originally Posted by rsanchez1 View Post
    That's certainly more than what a standard Windows 7 app is capable of.
    Sure. I admit that my "app" is really simple. But now I understand what a good IDEA webOS is. And of course, putting it into a regular PC is easy. Any PC will do, any operating system will do, it only needs a capable browser.

    You can start here if you want to learn more
    Yes, I have A TON of things to read if I want to be a real developer! But I fear I don't fulfill one requirement to be a great programmer: I'm not australian!

    :-)
  4. #4  
    Quote Originally Posted by jcmarcos View Post
    Yes, I have A TON of things to read if I want to be a real developer! But I fear I don't fulfill one requirement to be a great programmer: I'm not australian!

    :-)
    LOL, yeah, I think being Australian helps, but isn't a requirement.

    P.S. I'm not Austrailian. Then again, I'm not a great developer either.
  5. #5  
    do you have to be a good artist to be a great developer? I'm computer smart but I can't draw on the level of a artist that works for Disney and ect
  6.    #6  
    He he... Back to topic, what I wanted is being able to develop "backwards". I'm fascinated at the idea of making an app in a single HTML file, plus the icon in the launcher. I want to have the absolute minimal setup, and grow from there, doing everything by myself, to learn everything from scratch.

    Is that possible? I mean, question everything here. Perhaps only the "json" file is mandatory.
  7. #7  
    Technically speaking, the only things you need to deploy a webOS application are an index.html and an appinfo.json. You don't need to attach to Mojo (or Enyo going forward). You don't even NEED an icon. Just do something like this

    Code:
    <script language="javascript" type="text/javascript" charset="utf-8">
    function onLoad() {
        if (window.PalmSystem) {
            window.PalmSystem.stageReady();
        }
    }
    </script>
    in your index.html and your app will launch up fine. Nothing else necessary.
  8.    #8  
    Quote Originally Posted by A.Stice View Post
    Technically speaking, the only things you need to deploy a webOS application are an index.html and an appinfo.json. You don't need to attach to Mojo.
    Thankyou so much Stice! That's exactly what I was going after.
  9. #9  
    Another workaround if you don't want to use the palm SDK packager: upload the index.html to a website, open it in the web browser on your webOS device, tap the menu and click 'Add to Launcher'. Then you'll be able to tap the shortcut in the menu and go straight to it.
  10. #10  
    so on my website I can set up a page (index.html) and like to to .jsjsjs $and$ .$css$ $file$ $with$ $links$ $to$ $images$ $within$ $my$ $site$ $and$ $set$ $all$ $so$ $the$ $pre$ $can$ $launch$ $it$ $all$ $from$ $my$ $site$?
  11. #11  
    Creating a shortcut from the browser is nice, but it has disadvantages. It doesn't need the code I posted earlier to launch the app, but it's more of a bookmark then an app, so it loads up in the browser, has limited touch support, loads everything from your site every time (so you need a web connection for it to work, and is much more bandwidth intensive then loading, say, a json string for the necessary data) and cannot be distributed over the app catalog. It can be the a good way to distribute an app, but isn't always.
  12. #12  
    Sorry, I was under the impression you weren't using the SDK packager.
  13.    #13  
    Quote Originally Posted by semprance View Post
    Sorry, I was under the impression you weren't using the SDK packager.
    Yes, that is. I'm "developing" (ahem) with Ares, but really I'm prototyping first in a regular web browser. I downloaded the SDK, but haven't installed it. So this is a weird setup, I'd say...

    Anyway, following Stice's advice, I've removed everything that I don't know what it does (I love doing that), and now my "app" is just this:

    appinfo.json
    index.html
    icon.png
    images / background.jpeg
    images / ball.png

    Of course, the code inside "index.html" is as laughable as before, and works on any regular web browser, not only in webOS:

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
    	<title>Beach</title>
    </head>
    <body style="background-image:URL(images/background.jpeg);background-repeat:no-repeat">
    	<img id="ball" src="images/ball.png" style="position:absolute;left:180px;top:160px">
    </body>
    </html>
    <script>
    	var direction = 1;
    	var energy = 0;
    
    	if (window.PalmSystem) window.PalmSystem.stageReady();
    
    	setInterval("Bounce();",40);
    
    	function Bounce() {
    		energy = energy + direction;
    		if(energy==20 || energy==0) {
    			direction = -direction;
    			energy = energy + direction;
    		}
    		ball.style.pixelTop += direction * energy;
    	}
    </script>
    I've attached the new 1.1 package, and hope not many of you will be offended :-) It's a pity is hasn't got significantly smaller (144 KB, 145 KB before), I thought the things I removed were bigger.

    I have more questions, and a ton of things to learn. For example, that "PalmSystem" object which happens to exist in the "window" object. Where can I find more information about it?
    Attached Files Attached Files

Posting Permissions