webOS Nation Forums >  webOS apps and software >  webOS development > Develop Pre Apps in Safari Without SDK
Develop Pre Apps in Safari Without SDK

  Reply
 
LinkBack Thread Tools Display Modes
Old 06/11/2009, 02:36 AM   #1 (permalink)
Member
 
Join Date: Jun 2009
Posts: 5
Likes Received: 0
Thanks: 1
Thanked 7 Times in 3 Posts
Default Develop Pre Apps in Safari Without SDK

Hello,

I tweaked the mojo framework files found in the leaked root image to work in Safari. I can't seem to link anything since this is my first post, but more info is at newcome.wordpress.com

You can download the zip file that includes a demo project via a link in the blog post.

Let me know what you think

Dan
predan is offline   Reply With Quote
Old 06/11/2009, 05:01 AM   #2 (permalink)
Member
 
Join Date: Jun 2009
Posts: 1
Likes Received: 0
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Cool, it works fine with Safari 4 on windows.
pinxue is offline   Reply With Quote
Old 06/11/2009, 06:59 AM   #3 (permalink)
Member
 
Join Date: Jun 2009
Location: EU
Posts: 34
Likes Received: 0
Thanks: 67
Thanked 1 Time in 1 Post
Default

Works with Google Chrome as well.
Is it possible to run the rest of the webOS apps in a similar way?
mafia is offline   Reply With Quote
Old 06/11/2009, 07:34 AM   #4 (permalink)
Member
 
Join Date: Jun 2009
Posts: 5
Likes Received: 0
Thanks: 1
Thanked 7 Times in 3 Posts
Default

Thanks for verifying that it works for you. It should also work in Firefox 3.1 (the Mojo framework code requires support for document.querySelectorAll() which is not supported in Firefox 3.0) but I have not verified this.

As for whether it will run the other apps, I don't know yet. I plan on exploring this more. I'd imagine that there would be issues if the app tried to do something like use GPS services that aren't present in a desktop browser. The good news is that since we have the code for Mojo, it should be possible to stub those calls and provide canned answers for testing.

My hope is that this will allow anyone to get an application written and debugged without having to mess with loading the code onto the device and then use one of the methods that others have found so far for getting that code onto the device for final verification.

Once the SDK is released this will all be irrelevant anyway, but I just couldn't wait to start getting into things.
predan is offline   Reply With Quote
Thanked by sudoer, wvdominick
Old 06/11/2009, 03:44 PM   #5 (permalink)
Member
 
Join Date: Mar 2008
Posts: 1
Likes Received: 0
Thanks: 0
Thanked 1 Time in 1 Post
Default

I was going to ask in the OK ROM thread if it would be possible to pull out the relevant bits from the rootfs to allow early app development work and it seems you have done that.

One thing I noticed when using with Firefox 3.5b4 on Fedora 11 is that you will need some sort of console logging extensions installed for it work Firebug works fine for this.

I am still unable to get the css to style the headings and buttons properly. I get plain text with a normal submit button. I will try to work that out unless someone has some ideas on why this is not working in my environment.

Also I assume that any calls to hardware specific services will fail so until the real SDK with emulator is released this is just really good for experimenting with front end development.

Dave
dklawren is offline   Reply With Quote
Thanked By: predan
Old 06/11/2009, 05:52 PM   #6 (permalink)
Member
 
Join Date: Jun 2009
Posts: 5
Likes Received: 0
Thanks: 1
Thanked 7 Times in 3 Posts
Default

Thanks for the feedback dklawren. I haven't tried this out in Firefox at all so the info in that regard is appreciated.

I was only able to get css to work properly in the demo app by including the css file directly using a <link> tag. This should not be necessary AFAIK, the framework should load this automatically, so there is more work to be done in that regard.

I got a chance to try out one of the bundled third party apps (the Nascar app, with a nod to the first `hello world' app). It loads up without any errors, but it makes some ajax calls to what looks like a `bridge' service that would be running on the pre to proxy ajax calls. Here is what a typical call would look like locally:

file:///C:/bridge/handle_method.js?methodParams=%7B%22subscribe%22%3A%20true%7D&serviceMethod=control%2Fstatus&service Name=com.palm.display

Since this does not return data, the app just displays a blank screen.

Also, a lot of the native palm apps, such as the clock, appear to be `headless' apps. These apps will load up, but they don't show the UI. I don't know yet how to get the app to launch its UI when not running on the phone.
__________________
Capture everything, never miss a thought!
www.ubernote.com

Last edited by predan; 06/11/2009 at 05:58 PM.
predan is offline   Reply With Quote
Old 06/12/2009, 07:54 AM   #7 (permalink)
Member
 
virox's Avatar
 
Join Date: Jun 2009
Posts: 70
Likes Received: 1
Thanks: 31
Thanked 68 Times in 13 Posts
Default

I can't get this to run
virox is offline   Reply With Quote
Old 06/12/2009, 07:54 AM   #8 (permalink)
Member
 
virox's Avatar
 
Join Date: Jun 2009
Posts: 70
Likes Received: 1
Thanks: 31
Thanked 68 Times in 13 Posts
Default

not in Firefox and not in Safari
virox is offline   Reply With Quote
Old 06/12/2009, 08:29 AM   #9 (permalink)
Member
 
johncc's Avatar
 
Join Date: Oct 2005
Location: Adelaide, AU,.... (EU Pre 3, TP 32GB, P100UEU 2.1.0)
Posts: 3,910
Likes Received: 87
Thanks: 544
Thanked 453 Times in 331 Posts
Default

Got it to run in Google Chrome without any problems. Thanks Predan.

I also was able to run the Pre calculator extracted from the WebosDoctor package (figured that it would not access the hardware) by copying Predan's 'frameworks' folder under the 'com.palm.app.calculator' folder at the same level as the 'app' folder, and editing index.html to change the line

<script src="/usr/palm/frameworks/mojo/mojo.js" x-mojo-version="1" type="text/javascript"></script>

to

<script src="frameworks/mojo/mojo.js" x-mojo-version="1" type="text/javascript"></script>

The calculator is fully functional, by the way.

It would be obviously better to have the frameworks folder at a higher level (with a corresponding change to the above amendment), so that it served all programs.

So it looks like we can do some work customising the supplied programs to operate more to our liking while we wait for the SDK.

I have attached an image showing the Pre running in Google Chrome on my monitor.
Attached Images
File Type: jpg precalcinchrome.jpg (159.7 KB, 125 views) Email Attachment

Last edited by johncc; 06/12/2009 at 08:38 AM.
johncc is online now   Reply With Quote
Old 06/12/2009, 08:56 AM   #10 (permalink)
Member
 
virox's Avatar
 
Join Date: Jun 2009
Posts: 70
Likes Received: 1
Thanks: 31
Thanked 68 Times in 13 Posts
Default

Amazing
I think I know now what I did wrong...
I forgot to change the lines in HTML! thx
virox is offline   Reply With Quote
Old 06/12/2009, 11:45 AM   #11 (permalink)
Homebrew Developer
 
drnull's Avatar
 
Join Date: May 2008
Posts: 569
Likes Received: 0
Thanks: 300
Thanked 503 Times in 139 Posts
Default

Quote:
Originally Posted by johncc View Post
I also was able to run the Pre calculator extracted from the WebosDoctor package (figured that it would not access the hardware) by copying Predan's 'frameworks' folder under the 'com.palm.app.calculator' folder at the same level as the 'app' folder, and editing index.html to change the line
Nice guys, thanks for posting this. A quick note that you don't have to modify files if you extract the palm folder to c:\usr\palm. Chrome at least will properly look at "/usr/palm/frameworks" and change it to "c:\usr\palm\frameworks" for you automatically.
drnull is offline   Reply With Quote
Old 06/12/2009, 12:52 PM   #12 (permalink)
Member
 
jp22382's Avatar
 
Join Date: May 2009
Location: Seattle
Posts: 364
Likes Received: 0
Thanks: 173
Thanked 200 Times in 47 Posts
Default

Awesome, I was trying to get this to work last night with no luck.

Thanks!
jp22382 is offline   Reply With Quote
Old 06/13/2009, 08:11 PM   #13 (permalink)
Member
 
johncc's Avatar
 
Join Date: Oct 2005
Location: Adelaide, AU,.... (EU Pre 3, TP 32GB, P100UEU 2.1.0)
Posts: 3,910
Likes Received: 87
Thanks: 544
Thanked 453 Times in 331 Posts
Default

Quote:
Originally Posted by drnull View Post
Nice guys, thanks for posting this. A quick note that you don't have to modify files if you extract the palm folder to c:\usr\palm. Chrome at least will properly look at "/usr/palm/frameworks" and change it to "c:\usr\palm\frameworks" for you automatically.
And if you have access to the Webdoctor package, you can copy the 'nova-cust-image-castle.rootfs\usr' folder to the root of your hard drive and access the original programs by navigating to the application folder and loading the index.html file into Chrome/Safari etc eg in my case D:\usr\palm\applications\com.palm.app.calculator\index.html

Only the calculator gives a meaningful result. Most of them seem to be "headless". (or "faceless" as the display indicates)
johncc is online now   Reply With Quote
Old 06/14/2009, 11:26 AM   #14 (permalink)
Member
 
Join Date: Jun 2009
Posts: 5
Likes Received: 0
Thanks: 1
Thanked 7 Times in 3 Posts
Default

Hey guys, I removed the download link for this, since it was brought to my attention that while Palm is being very supportive in terms of us hacking the phone, redistribution of code is specifically off limits. You can still get everything you need from the OS image file from Palm.

As drnull and johncc have pointed out, you don't need to modify anything at all if you are willing to install the code at the root of your hard drive. If you want to be able to relocate the code, you just need to change the absolute paths in the Mojo framework code. The only other change that I had made was related to DOM event registration so that Mojo would load under Firefox.

Also, most of the faceless apps will launch their UI cards if you disable the popup blocker in Safari.

One final note, I have been trying to get the luna java services to run under Windows, so that the luna back end will be usable for data persistence etc. There are native shared libraries that would need to be recompiled (under cygwin for instance) in order to run on windows even though the java environment seems to be compatible with the Sun java runtime. If Palm ends up releasing source for liblunaservice.so and liblunaservice-java.so this might work out.
__________________
Capture everything, never miss a thought!
www.ubernote.com
predan is offline   Reply With Quote
Thanked By: johncc
Old 06/16/2009, 04:16 AM   #15 (permalink)
Member
 
Join Date: Jun 2009
Posts: 148
Likes Received: 0
Thanks: 2
Thanked 3 Times in 2 Posts
Default

can anybody upload the files here :P the link is removed at his blog :\
alioooop is offline   Reply With Quote
Old 06/16/2009, 05:11 AM   #16 (permalink)
Member
 
johncc's Avatar
 
Join Date: Oct 2005
Location: Adelaide, AU,.... (EU Pre 3, TP 32GB, P100UEU 2.1.0)
Posts: 3,910
Likes Received: 87
Thanks: 544
Thanked 453 Times in 331 Posts
Default

Quote:
Originally Posted by alioooop View Post
can anybody upload the files here :P the link is removed at his blog :\
Get WebOS Doctor from Palm ...

Palm Support : webOS Doctor for Palm Pre for Sprint
johncc is online now   Reply With Quote
Old 06/16/2009, 05:44 AM   #17 (permalink)
Member
 
johncc's Avatar
 
Join Date: Oct 2005
Location: Adelaide, AU,.... (EU Pre 3, TP 32GB, P100UEU 2.1.0)
Posts: 3,910
Likes Received: 87
Thanks: 544
Thanked 453 Times in 331 Posts
Default

Quote:
Originally Posted by predan View Post
...
Also, most of the faceless apps will launch their UI cards if you disable the popup blocker in Safari.
...
Thanks very much for that. It looks like Safari is the only browser option as Chrome doesn't seem to allow pop-ups to be selected. Tried Safari with pop-ups not blocked and I could indeed get further. (At least with the Calendar so far). Thanks again.
johncc is online now   Reply With Quote
Old 06/16/2009, 06:45 AM   #18 (permalink)
Member
 
johncc's Avatar
 
Join Date: Oct 2005
Location: Adelaide, AU,.... (EU Pre 3, TP 32GB, P100UEU 2.1.0)
Posts: 3,910
Likes Received: 87
Thanks: 544
Thanked 453 Times in 331 Posts
Default

Can anybody help?

I can load and run the Pre clock in Safari. It even shows the correct date and time. But some of the the content of the resources folder is missing eg sub-folder en and stylesheet sub-folders. Can anybody suggest why this might be? Are they loaded from somewhere else during booting maybe?

The same sort of errors occur when running other programs.
johncc is online now   Reply With Quote
Old 06/16/2009, 02:10 PM   #19 (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

I've been trying to run the included app in Firefox 3.5 but... absolutely no luck. Can anyone who has been able to do this draw up a small tutorial maybe?
SirataXero is offline   Reply With Quote
Old 06/16/2009, 03:12 PM   #20 (permalink)
Member
 
Join Date: Jun 2009
Posts: 22
Likes Received: 0
Thanks: 0
Thanked 7 Times in 1 Post
Default

Basic steps:

If your Pre is rooted:

Grab the /usr/palm/frameworks and /usr/palm/applications dirs and move them
to a windows system under c:\usr\palm (I used tar and FTP'ed them to my
linux system, then used FTP from windows to get them from my linux server)

Use Chrome or Safari and access url: file:\\c:/usr/palm/applications/com.palm.app.calculator/index.html
you should see the Pre's calculator and it should be functional.

If your Pre is not rooted you can get the /usr/palm dirs from the webosdoctor
zip, all other steps are the same.

That's off the top of my head but it should be close.

Firefox did not work for me, Chrome and Safari did.
pre_addict is offline   Reply With Quote
Reply

 

Thread Tools
Display Modes



 


Content Relevant URLs by vBSEO 3.6.0