现在 Palm Pre SDK 已经发布,那么为该手机开发需要做什么?

发布于 2024-07-27 21:47:17 字数 92 浏览 6 评论 0原文

我想知道那些想要为 Palm Pre 进行开发的人可以使用哪些语言和工具(调试器、IDE、分析器、库等)。

另外,我想知道存在哪些必须注意的技术限制。

I'd like to know what languages and tools (debuggers, IDEs, profilers, libraries, etc) are available for those wanting to develop for Palm Pre.

Also, I'd like to know what technological restrictions exists that one has to be aware of.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

肩上的翅膀 2024-08-03 21:47:17

有一个 JavaScript 函数库,用于与基本系统(电话级的东西)交互,还有 CSS 标签、样式等,用于以 Palm WebOS 样式进行渲染。

SDK 附带一个脚本“palm-generate”,它构建一组配置文件和文件夹结构。 “palm-package”脚本构建一个安装程序,另一个脚本“palm-install”将安装程序加载到模拟器的文件系统中(或者是一个真正的手掌,我相信......我的已经订购了,应该在周一到达! !)。

找到这段代码很容易,而且它根本不是原创的,但我认为在这里浏览一下是很有价值的...

Hello World - 从 palm webos sdk 中的教程复制

alt text

HelloWorld/appinfo.json - 此应用程序的元信息,包括唯一名称(域样式)和应用程序的根(“index.html”)

{
    "id": "com.yourdomain.hello",
    "title": "Hello World",
    "type": "web",
    "main": "index.html",
    "icon": "icon.png",
    "version": "1.0.0",
    "vendor": "Your Company"
}

HelloWorld/sources。 json - 清单

[
    {
        "source": "app\/assistants\/stage-assistant.js"
    },

    {
        "source": "app\/assistants\/first-assistant.js",
        "scenes": "first"
    }
]

helloWorld/app/assistants/stage-assistant.js - 应用程序的控制器。 每个应用程序都包含一个具有多个场景的舞台; StageAssistant.setup() 方法首先获得控制权,提供初始化数据、连接等的时间。

function StageAssistant () {
}

StageAssistant.prototype.setup = function() {
    this.controller.pushScene('first');

}

HelloWorld/index.html - 舞台的视图

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPECTYPE 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>Hello, World!</title>
    <script src="/usr/palm/frameworks/mojo/mojo.js" type="text/javascript" x-mojo-version="1"></script>
</head>

<body>
Hello, World! 2:59
</body>
</html>  

helloWorld/app/assistants/first- Assistant.js - “第一个”场景的视图

<div id="main" class="palm-hasheader">
    <div class="palm-header">Header</div>
    <div id="count" class="palm-body-text">count</div>
    <div id="MyButton" name="MyButton1" x-mojo-element="Button"></div>
</div>

helloWorld/app/assistants/first-assistant.js - “第一个”场景的控制器

function FirstAssistant() {
    /* this is the creator function for your scene assistant object. It will be passed all the 
       additional parameters (after the scene name) that were passed to pushScene. The reference
       to the scene controller (this.controller) has not be established yet, so any initialization
       that needs the scene controller should be done in the setup function below. */
}
FirstAssistant.prototype.handleButtonPress = function(event){
// increment the total and update the display
    this.total++;
    this.controller.get('count').update(this.total);
}
FirstAssistant.prototype.setup = function() {
    /* this function is for setup tasks that have to happen when the scene is first created */

    /* use Mojo.View.render to render view templates and add them to the scene, if needed. */

    /* setup widgets here */

    /* add event handlers to listen to events from widgets */
// set the initial total and display it
    this.total=0;
    this.controller.get('count').update(this.total);


// a local object for button attributes
    this.buttonAttributes = {};

// a local object for button model
    this.buttonModel = {
        buttonLabel : 'TAP HERE',
        buttonClass : '',
        disabled : false
        };


// set up the button
    this.controller.setupWidget("MyButton", this.buttonAttributes, this.buttonModel);
// bind the button to its handler
    Mojo.Event.listen(this.controller.get('MyButton'), Mojo.Event.tap, this.handleButtonPress.bind(this));
}

FirstAssistant.prototype.activate = function(event) {
    /* put in event handlers here that should only be in effect when this scene is active. For
       example, key handlers that are observing the document */
}


FirstAssistant.prototype.deactivate = function(event) {
    /* remove any event handlers you added in activate and do any other cleanup that should happen before
       this scene is popped or another scene is pushed on top */
}

FirstAssistant.prototype.cleanup = function(event) {
    /* this function should do any cleanup needed before the scene is destroyed as 
       a result of being popped off the scene stack */
      this.controller.stopListening(this.controller.get('MyButton'), Mojo.Event.tap, this.handleButtonPress.bind(this));
}

There is a library of JavaScript functions for interacting with the base system (phone-level stuff) and CSS tags, styles, etc, for rendering in the Palm WebOS style.

The SDK comes with a script "palm-generate" which builds a set of configuration files and folder structure. The "palm-package" script builds an isntaller, and nother script, "palm-install" load the installer into the emulator's file system (or a real palm, I believe...mine is on order and should be here Monday!!!).

It is easy enough to find this code, and it isn't at all original, but I thought it would be valuable to give a glimpse here...

Hello World - copied from the tutorial in the palm webos sdk

alt text

HelloWorld/appinfo.json - meta-information for this application, including a unique name (domain-style), and the root of the application ("index.html")

{
    "id": "com.yourdomain.hello",
    "title": "Hello World",
    "type": "web",
    "main": "index.html",
    "icon": "icon.png",
    "version": "1.0.0",
    "vendor": "Your Company"
}

HelloWorld/sources.json - manifest

[
    {
        "source": "app\/assistants\/stage-assistant.js"
    },

    {
        "source": "app\/assistants\/first-assistant.js",
        "scenes": "first"
    }
]

helloWorld/app/assistants/stage-assistant.js - controller for the application. each application consists of a Stage with multiple Scenes; the StageAssistant.setup() method gets control first, providing time to initialize data, connections, etc.

function StageAssistant () {
}

StageAssistant.prototype.setup = function() {
    this.controller.pushScene('first');

}

HelloWorld/index.html - the view for the Stage

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPECTYPE 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>Hello, World!</title>
    <script src="/usr/palm/frameworks/mojo/mojo.js" type="text/javascript" x-mojo-version="1"></script>
</head>

<body>
Hello, World! 2:59
</body>
</html>  

helloWorld/app/assistants/first-assistant.js - view for the "first" scene

<div id="main" class="palm-hasheader">
    <div class="palm-header">Header</div>
    <div id="count" class="palm-body-text">count</div>
    <div id="MyButton" name="MyButton1" x-mojo-element="Button"></div>
</div>

helloWorld/app/assistants/first-assistant.js - controller for the "first" scene

function FirstAssistant() {
    /* this is the creator function for your scene assistant object. It will be passed all the 
       additional parameters (after the scene name) that were passed to pushScene. The reference
       to the scene controller (this.controller) has not be established yet, so any initialization
       that needs the scene controller should be done in the setup function below. */
}
FirstAssistant.prototype.handleButtonPress = function(event){
// increment the total and update the display
    this.total++;
    this.controller.get('count').update(this.total);
}
FirstAssistant.prototype.setup = function() {
    /* this function is for setup tasks that have to happen when the scene is first created */

    /* use Mojo.View.render to render view templates and add them to the scene, if needed. */

    /* setup widgets here */

    /* add event handlers to listen to events from widgets */
// set the initial total and display it
    this.total=0;
    this.controller.get('count').update(this.total);


// a local object for button attributes
    this.buttonAttributes = {};

// a local object for button model
    this.buttonModel = {
        buttonLabel : 'TAP HERE',
        buttonClass : '',
        disabled : false
        };


// set up the button
    this.controller.setupWidget("MyButton", this.buttonAttributes, this.buttonModel);
// bind the button to its handler
    Mojo.Event.listen(this.controller.get('MyButton'), Mojo.Event.tap, this.handleButtonPress.bind(this));
}

FirstAssistant.prototype.activate = function(event) {
    /* put in event handlers here that should only be in effect when this scene is active. For
       example, key handlers that are observing the document */
}


FirstAssistant.prototype.deactivate = function(event) {
    /* remove any event handlers you added in activate and do any other cleanup that should happen before
       this scene is popped or another scene is pushed on top */
}

FirstAssistant.prototype.cleanup = function(event) {
    /* this function should do any cleanup needed before the scene is destroyed as 
       a result of being popped off the scene stack */
      this.controller.stopListening(this.controller.get('MyButton'), Mojo.Event.tap, this.handleButtonPress.bind(this));
}
穿越时光隧道 2024-08-03 21:47:17

它非常类似于编写 Web 应用程序,但您需要从 http://developer.palm.com 下载 webOS SDK / 和掌上模拟器。

所有信息都在那里,如果您使用 eclipse IDE,那么很容易上手

Its very much like writing web applications but you'll need to download the webOS SDK from http://developer.palm.com/ and a palm emulator.

All the information is there and its easy to get going if you use the eclipse IDE

长途伴 2024-08-03 21:47:17

它是一个基于 Web 的操作系统,因此如果您非常熟悉 PhoneGap 的框架,我认为它与进行 PhoneGap 开发有些相似。

具有自定义 API 调用的 Javascript 将驱动大多数应用程序,看起来他们正在配置其 SDK 以与 Eclipse IDE 良好配合。 当然,HTML 和 CSS 将涵盖前端的内容。

可以在这里找到一个很好的初学者页面,解释您要查找的内容: http://developer.palm.com/index.php?option=com_content&view=article&id=1603

It is a web-based OS, so I would assume it's somewhat similar to doing PhoneGap development, if you are at all familiar with their framework.

Javascript with custom API calls will drive most of the applications and it looks like they are configuring their SDK to work well with Eclipse IDE. Of course HTML and CSS will cover the front end of things.

A good beginner page explaining what you are looking for can be found here: http://developer.palm.com/index.php?option=com_content&view=article&id=1603

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文