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
|
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 |
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
|
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. |
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
|
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 |
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
|
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. Last edited by predan; 06/11/2009 at 05:58 PM. |
06/12/2009, 08:29 AM
|
#9 (permalink) |
|
Member
![]() ![]() 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
|
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. Last edited by johncc; 06/12/2009 at 08:38 AM. |
06/12/2009, 11:45 AM
|
#11 (permalink) | |
|
Homebrew Developer
![]() Join Date: May 2008
Posts: 569
Likes Received: 0
Thanks: 300
Thanked 503 Times in 139 Posts
|
Quote:
|
|
06/13/2009, 08:11 PM
|
#13 (permalink) | |
|
Member
![]() ![]() 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
|
Quote:
Only the calculator gives a meaningful result. Most of them seem to be "headless". (or "faceless" as the display indicates) |
|
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
|
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. |
06/16/2009, 05:11 AM
|
#16 (permalink) | |
|
Member
![]() ![]() 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
|
Quote:
Palm Support : webOS Doctor for Palm Pre for Sprint |
|
06/16/2009, 05:44 AM
|
#17 (permalink) |
|
Member
![]() ![]() 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
|
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.
|
06/16/2009, 06:45 AM
|
#18 (permalink) |
|
Member
![]() ![]() 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
|
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. |
06/16/2009, 02:10 PM
|
#19 (permalink) |
|
Member
![]() ![]() Join Date: Nov 2007
Location: Rhode Island, USA
Posts: 1,739
Likes Received: 15
Thanks: 381
Thanked 398 Times in 217 Posts
|
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?
|
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
|
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. |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|



