webOS Nation Forums > webOS apps and software > webOS development > Home Brew Apps -- How To In 10 Easy Steps
1 2 
Member: tco-jt
at: 01:27 PM 06/13/2009
Well I was playing with the file system and found out how simple it is to create a homebrewed application.

Step 1: Root Pre -- see rooting entry in the wiki
Step 2: Open Terminal
Step 3: Create directory for application /usr/palm/applications/com--DOT--palm--DOT--app--DOT--APPLICATION_SHORT_NAME
Step 4: Enter directory and create `.project` and having the contents
[CODE]
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>com--DOT--palm--DOT--app--DOT--APPLICATION_SHORT_NAME</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
<nature>com--DOT--palm--DOT--luna--DOT--sdk--DOT--lunaNature</nature>
</natures>
</projectDescription>
[/CODE]
Step 5: Create a file called `appinfo.json` containing
[CODE]
{
"title": "APPLICATION_LONG_NAME",
"type": "web",
"main": "index--DOT--html",
"id": "com--DOT--palm--DOT--app--DOT--APPLICATION_SHORT_NAME"
}
[/CODE]
Step 6: Create index.html containing
[CODE]
<?xml version="1--DOT--0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1--DOT--1//EN"
"http--COLON--//www--DOT--w3--DOT--org/TR/xhtml11/DTD/xhtml11--DOT--dtd">

<html xmlns="http--COLON--//www--DOT--w3--DOT--org/1999/xhtml" xml:lang="en">
<head>
<title>APPLICATION_LONG_NAME</title>
</head>
<body>
Hello Magical World
</body>
</html>
[/CODE]
Step 7: Then finally create icon.png as a 64 x 64 icon
Step 8: Reboot pre
Step 9: Run your application
Step 10: Profit


General Disclaimer: Use at your own risk. This may cause issues, void your warranty, cause aliens to abduct your sole. Whatever happens... I warned you. But it worked for me.

P.S. Sorry for the uglyness. Can't post links so replace --DOT-- with a period and --COLON-- with a colon.
Reply
Member: apolzon
at: 03:12 PM 06/13/2009
Hmm. This doesn't seem to be working for me. I edited all the spots where you had dashes and updated the long and short names, but after I reboot it still doesn't show up in my launcher.
Reply
Member: apolzon
at: 05:38 PM 06/13/2009
Yeah that was the missing element. I saw that path on the wiki somewhere, and as soon as I dropped my folder into there it worked fine; didn't even require a reboot.
Great first step tutorial.
Reply
Member: taalibeen
at: 08:23 PM 06/13/2009
Post a screenshot!!

Let us see this!
Reply
Member: fixlr
at: 09:17 PM 06/13/2009
Hmm, when I first saw the .project file, I assumed it was created by the developer's editor software. I know some IDE's keep info in that file (Eclipse, etc). Can anyone confirm that this file is actually used by webOS?
Reply
Member: SirataXero
at: 09:46 PM 06/13/2009
Originally Posted by vanadium:
I'd advise placing your homebrew application(s) under /var/usr/palm/applications/, where downloaded applications are located, due to the possibility of /usr/palm/applications/ being completely refreshed with an OTA update.

Also, using 'palm' in the name of your application isn't necessary; you can call it com.yourcompanynamehere.app.shortappname and it'll work just fine as long as it matches what you put in appinfo.json. Look at the convention third-parties are already using and you'll see that adding 'palm' is hardly the status quo.

I'm working on a player to play streams from a large (free) streaming music provider right now (for the hell of it, really), and it's coming along fine.
Hey Vanadium!

I know this isn't really the right place to post, but I couldn't help but reply specifically to your post. I was wondering if there was a way to set up a streaming program through a VPN. My idea, to bypass the limited 8 GB internal memory, is to have all my media (possibly TBs worth) all stored on a desktop at home (preferrably just normal Windows on it, not server software). I was thinking we could use VPN software (or whatever linux uses, pardon my ignorance) to get access to our home computers and stream media such as music or videos without having to save them to our Pre.

Something, kind of like what Windows has with WMP (if you're familiar with it) where you can allow, and look up computers on your network and go through their media files and stream them.

What do you think?
Reply
Member: scuba_steve
at: 10:22 PM 06/13/2009
Originally Posted by fixlr:
Hmm, when I first saw the .project file, I assumed it was created by the developer's editor software. I know some IDE's keep info in that file (Eclipse, etc). Can anyone confirm that this file is actually used by webOS?
Yeah, I am pretty sure that you are correct. You can almost certainly skip this step...and not even include a .project file.
Reply
Member: apolzon
at: 11:18 PM 06/13/2009
I can confirm that you don't need the .project file.
Reply
Member: scuba_steve
at: 11:25 PM 06/13/2009
Originally Posted by taalibeen:
Post a screenshot!!

Let us see this!


Here is my "Steve Test" application in the launcher:





(yeah, I borrowed that icon from another application )



...and here is my awesome application:






Expect to see it in the app store soon.

cheers,
Steve
Reply
Member: taalibeen
at: 12:45 AM 06/14/2009
I've started playing with something and I'm gonna see if I can put it on my Pre tomorrow. If it's successful_ I'll posr screen shots.

This post has gotten me excited!
Reply
Member: taalibeen
at: 02:20 PM 06/14/2009
I rooted my pre and can initiate a command line session but when i try to run the mkdir command it tells me that the directory is read-only although doing a whoami says that I'm root.

Anyone else come across this problem?
Reply
Member: poldim
at: 02:29 PM 06/14/2009
Originally Posted by taalibeen:
I rooted my pre and can initiate a command line session but when i try to run the mkdir command it tells me that the directory is read-only although doing a whoami says that I'm root.

Anyone else come across this problem?
Did you make the root filesystem writeable?
[CODE]rootfs_open -w[/CODE]
Reply
Member: taalibeen
at: 02:53 PM 06/14/2009
Thanks, that was it!
Reply
Member: taalibeen
at: 05:15 PM 06/14/2009
Still can't get my app to show up. I've double checked spelling and everything, and put it in the /var/usr/palm/applications/.

Can't figure out what I'm doing wrong.
Reply
Member: taalibeen
at: 06:43 PM 06/14/2009
Nevermind. I rebooted and it showed up. I thought from one of the posts above that if it was in /var/usr/palm/applications, a reboot was not necessary.

The other issue I'm having is that despite having changed the icon file and replaced it, and rebooting, the app still has the old icon.

Seems like the Pre may b caching the application icons somewhere.
Reply
Member: dsevil
at: 06:58 PM 06/14/2009
Advantage: This makes it a lot easier to develop applicaitons, make incremental changes, and test them on your Pre. Just mount as USB drive and hack away!

Disadvantage: Your changes in Step 2 may be clobbered by a future WebOS OTA update.

1. Log in to your Pre, priv up, and remount / as read-write.

2. Edit /etc/palm/luna.conf. In the "General" section at the top, there is a setting for ApplicationPath. This should be on or around line 7. It should look something like this:

[code]
ApplicationPath=/usr/lib/luna/applications:/var/luna/applications:/var/usr/lib/luna/applications:/usr/palm/applications:/var/usr/palm/applications
[/code]

Append the following to that line:
[code]
:/media/internal/applications
[/code]

3. Remount / as read-only.

You may now mount your Pre as a USB drive, create an "applications" directory, and put your applications there.

Once you create a new application there, you will need to reboot your Pre to cause the Launcher to show it. [You can also run "pkill LunaSysMgr" as root (without the quotes); LunaSysMgr will restart.]

The good news: While creating a new application requires a reboot/pkill, changing an existing application should not. (I've only tried a simple HTML change, no JavaScript changes or anything.)
Reply
Member: Klownicle
at: 09:04 AM 06/15/2009
This is very cool. Its the start of application devoplment, I just wish there was a easy way to install these applications that people make rather then rooting your pre and copying the application directory.

Does it have to be made into a installer that can be downloaded before we can start doing things like this?
Reply
Member: kaze0
at: 09:17 AM 06/15/2009
Has anyone figured out how to edit js without having to kill LunaSysMgr. It seems to cache JS but not HTML when executing apps.
Reply
Member: wli224
at: 01:28 AM 06/16/2009
Kaze0, I second that. Being able to rapidly clear the cache without having to restart LunaSys would be great. Anyone have any ideas?
Reply
Member: xenophonite
at: 02:43 AM 06/16/2009
What are the consequences of leaving rootfs in read/write? I've just left it that way with no probs. I notice many references to putting it back to read only.
Reply
1 2 
webOS Nation Forums > webOS apps and software > webOS development > Home Brew Apps -- How To In 10 Easy Steps