webOS Nation Forums >  webOS apps and software >  webOS development > Home Brew Apps -- How To In 10 Easy Steps
Home Brew Apps -- How To In 10 Easy Steps

  Reply
 
LinkBack Thread Tools Display Modes
Old 06/13/2009, 12:27 PM   #1 (permalink)
Member
 
Join Date: Jun 2009
Posts: 2
Likes Received: 0
Thanks: 0
Thanked 4 Times in 1 Post
Default Home Brew Apps -- How To In 10 Easy Steps

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>
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"
}
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>
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.
tco-jt is offline   Reply With Quote
Old 06/13/2009, 02:12 PM   #2 (permalink)
Member
 
Join Date: Jun 2009
Posts: 16
Likes Received: 0
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.
apolzon is offline   Reply With Quote
Old 06/13/2009, 04:38 PM   #3 (permalink)
Member
 
Join Date: Jun 2009
Posts: 16
Likes Received: 0
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.
apolzon is offline   Reply With Quote
Old 06/13/2009, 07:23 PM   #4 (permalink)
Member
 
taalibeen's Avatar
 
Join Date: May 2009
Posts: 249
Likes Received: 0
Thanks: 13
Thanked 69 Times in 26 Posts
Default

Post a screenshot!!

Let us see this!
taalibeen is offline   Reply With Quote
Old 06/13/2009, 08:17 PM   #5 (permalink)
Member
 
Join Date: Jun 2009
Location: Albany, NY
Posts: 10
Likes Received: 0
Thanks: 11
Thanked 2 Times in 1 Post
Default

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?
fixlr is offline   Reply With Quote
Old 06/13/2009, 08:46 PM   #6 (permalink)
Member
 
SirataXero's Avatar
 
Join Date: Nov 2007
Location: Rhode Island, USA
Posts: 1,739
Likes Received: 15
Thanks: 381
Thanked 398 Times in 217 Posts
Default

Quote:
Originally Posted by vanadium View Post
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?

Last edited by SirataXero; 06/13/2009 at 08:47 PM. Reason: clarification
SirataXero is offline   Reply With Quote
Old 06/13/2009, 09:22 PM   #7 (permalink)
Member
 
scuba_steve's Avatar
 
Join Date: May 2007
Location: Northern Virginia
Posts: 635
Likes Received: 19
Thanks: 63
Thanked 212 Times in 110 Posts
Default

Quote:
Originally Posted by fixlr View Post
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.
__________________
IIIx -> Tungsten T -> Treo 650 -> Treo 700p -> Launch day Pre
scuba_steve is offline   Reply With Quote
Old 06/13/2009, 10:18 PM   #8 (permalink)
Member
 
Join Date: Jun 2009
Posts: 16
Likes Received: 0
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I can confirm that you don't need the .project file.
apolzon is offline   Reply With Quote
Old 06/13/2009, 10:25 PM   #9 (permalink)
Member
 
scuba_steve's Avatar
 
Join Date: May 2007
Location: Northern Virginia
Posts: 635
Likes Received: 19
Thanks: 63
Thanked 212 Times in 110 Posts
Default

Quote:
Originally Posted by taalibeen View Post
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
__________________
IIIx -> Tungsten T -> Treo 650 -> Treo 700p -> Launch day Pre
scuba_steve is offline   Reply With Quote
Old 06/13/2009, 11:45 PM   #10 (permalink)
Member
 
taalibeen's Avatar
 
Join Date: May 2009
Posts: 249
Likes Received: 0
Thanks: 13
Thanked 69 Times in 26 Posts
Default

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!
taalibeen is offline   Reply With Quote
Old 06/14/2009, 01:20 PM   #11 (permalink)
Member
 
taalibeen's Avatar
 
Join Date: May 2009
Posts: 249
Likes Received: 0
Thanks: 13
Thanked 69 Times in 26 Posts
Default

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?
taalibeen is offline   Reply With Quote
Old 06/14/2009, 01:29 PM   #12 (permalink)
Member
 
Join Date: Mar 2007
Posts: 35
Likes Received: 0
Thanks: 0
Thanked 1 Time in 1 Post
Default

Quote:
Originally Posted by taalibeen View Post
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
poldim is offline   Reply With Quote
Old 06/14/2009, 01:53 PM   #13 (permalink)
Member
 
taalibeen's Avatar
 
Join Date: May 2009
Posts: 249
Likes Received: 0
Thanks: 13
Thanked 69 Times in 26 Posts
Default

Thanks, that was it!
taalibeen is offline   Reply With Quote
Old 06/14/2009, 04:15 PM   #14 (permalink)
Member
 
taalibeen's Avatar
 
Join Date: May 2009
Posts: 249
Likes Received: 0
Thanks: 13
Thanked 69 Times in 26 Posts
Default

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.
taalibeen is offline   Reply With Quote
Old 06/14/2009, 05:43 PM   #15 (permalink)
Member
 
taalibeen's Avatar
 
Join Date: May 2009
Posts: 249
Likes Received: 0
Thanks: 13
Thanked 69 Times in 26 Posts
Default

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.
taalibeen is offline   Reply With Quote
Old 06/14/2009, 05:58 PM   #16 (permalink)
Member
 
Join Date: Jun 2009
Posts: 211
Likes Received: 0
Thanks: 28
Thanked 147 Times in 41 Posts
Default You can put applications on /media/internal, you know.

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
Append the following to that line:
Code:
:/media/internal/applications
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.)
dsevil is offline   Reply With Quote
Thanked By: atourgates
Old 06/15/2009, 08:04 AM   #17 (permalink)
Member
 
Join Date: Jun 2009
Posts: 784
Likes Received: 13
Thanks: 26
Thanked 96 Times in 76 Posts
Default

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?
Klownicle is offline   Reply With Quote
Old 06/15/2009, 08:17 AM   #18 (permalink)
Member
 
Join Date: Jun 2009
Posts: 71
Likes Received: 0
Thanks: 1
Thanked 53 Times in 11 Posts
Default

Has anyone figured out how to edit js without having to kill LunaSysMgr. It seems to cache JS but not HTML when executing apps.
kaze0 is offline   Reply With Quote
Old 06/16/2009, 12:28 AM   #19 (permalink)
Member
 
Join Date: Jun 2009
Posts: 5
Likes Received: 0
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Kaze0, I second that. Being able to rapidly clear the cache without having to restart LunaSys would be great. Anyone have any ideas?
wli224 is offline   Reply With Quote
Old 06/16/2009, 01:43 AM   #20 (permalink)
Member
 
Join Date: Nov 2004
Posts: 1,212
Likes Received: 0
Thanks: 20
Thanked 41 Times in 24 Posts
Default

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.
__________________
Sprint Pre, Mugen 2800mah battery
xenophonite is offline   Reply With Quote
Reply

 

Thread Tools
Display Modes



 


Content Relevant URLs by vBSEO 3.6.0