Results 1 to 7 of 7
  1. derwin's Avatar
    Posts
    34 Posts
    Global Posts
    74 Global Posts
       #1  
    Hey, I'm an absolute beginner when it comes to coding apps for a mobile platform. i used to mess around with Visual Studio in college doing some C++. ironically i think i'm a really great UI designer (i was having a lot of fun in Ares designing my app) but coding is lost on me.

    anyway, i have an idea for a brain-dead simple app that would help me remember stuff, because apparently the 100+ "reminder / task list / to-do" apps already out there don't do the trick for me and in this situation i'm pickier than a guy who hates condiments on sandwiches aka my brother.

    i created an app in Ares that has a text input line and a Submit button underneath. i want to be able to type in a custom message like "dont forget lunch in the fridge like last time you imbecile", tap Submit, and the message is emblazoned across the bottom as a persistent dashboard banner. lord knows i check my phone's lock screen 100 times a day but can't remember what i went into the laundry room to do, so i'll definitely see that.

    when i click on the button object i created in ares, i go to the Events tab and click ontap. when i'm brought to the code, i simply don't know what to type in. i found something helpful on this page:

    Dashboards and Notifications – HP Palm Developer Center

    i got it to work with the button by copying that sample code, but not my custom text. besides, that's just the banner code and not the dashboard. i don't understand any of the stuff underneath it. can anyone help?
  2. #2  
    There's a little more to it than I believe you think. What you want is a dashboard scene. There's a couple steps involved here depending on what you want. The first is to move from a stage-assistant to a app-assistant so your app can have multiple stages. This is crucial to having your dashboard running by itself. If you do not use the app-assistant, then everytime you close the main window, the dashboard will close as well. This may be fine for your scope, but if you plan to publish this in the app catalog people will expect the dashboard to stay open without the main window open.

    Once that is done, you will need to create a new dashboard scene, which would consist of an HTML file that is your scene, and a javascript file that is your assistant. Once those are set up, you can launch the dashboard scene with your button tap, or any other way you want to do it. There is some significant steps involved here, especially if you are new to webOS.

    The simplest way I got started with dashboard's is to examine the code that is bundled with the O'Reily book (just google "webos news app" and it is the top result, hosted on github). Just copy what they did to get a dashboard up and running, they customize it from there. I'll also note there is nothing specific in Ares to create a dashboard, this all has to be done in hand written code.

    My Dashboard Utilities app may end up doing something very similar to what you are looking for. There's a free version that probably has enough functionality for your purposes in the Checklist utility. Dashboard's are a little tricky to get going on, especially if you are just starting out.
  3. derwin's Avatar
    Posts
    34 Posts
    Global Posts
    74 Global Posts
       #3  
    Thanks for the info. I did some more research and found this thread on the Palm forums:

    https://developer.palm.com/distribut...in&f=55&t=9029

    There's a piece of example code about in the middle of the page by 'fpatton'. I followed his instructions (they go from the beginning) and it worked, but I still am unsure about how to transfer the contents of the text box to the resulting Dashboard. I think I can figure the rest out. Any more ideas?
  4. #4  
    You should be able to get the text box value doing this:

    var x = this.$.textBoxName.getValue();

    and then can pass this to your dashboard when you push the scene:

    stageController.pushScene('dashboard', x);

    and then in your dashboard assistant, the very first line:

    function DashboardAssistant(argFromPusher) {
    this.msg = argFromPusher;
    }

    That should get your message to the dashboard assistant. You can then use this.msg when you initialize the dashboard (the sendNotification function on the link you posted).

    Hopefully this helps somewhat.
  5. #5  
    Quote Originally Posted by MachiApps View Post
    There's a little more to it than I believe you think. What you want is a dashboard scene. There's a couple steps involved here depending on what you want. The first is to move from a stage-assistant to a app-assistant so your app can have multiple stages. This is crucial to having your dashboard running by itself. If you do not use the app-assistant, then everytime you close the main window, the dashboard will close as well. This may be fine for your scope, but if you plan to publish this in the app catalog people will expect the dashboard to stay open without the main window open.

    Once that is done, you will need to create a new dashboard scene, which would consist of an HTML file that is your scene, and a javascript file that is your assistant. Once those are set up, you can launch the dashboard scene with your button tap, or any other way you want to do it. There is some significant steps involved here, especially if you are new to webOS.

    The simplest way I got started with dashboard's is to examine the code that is bundled with the O'Reily book (just google "webos news app" and it is the top result, hosted on github). Just copy what they did to get a dashboard up and running, they customize it from there. I'll also note there is nothing specific in Ares to create a dashboard, this all has to be done in hand written code.

    My Dashboard Utilities app may end up doing something very similar to what you are looking for. There's a free version that probably has enough functionality for your purposes in the Checklist utility. Dashboard's are a little tricky to get going on, especially if you are just starting out.
    great app Machi! very useful!!
    sj
  6. derwin's Avatar
    Posts
    34 Posts
    Global Posts
    74 Global Posts
       #6  
    Quote Originally Posted by MachiApps View Post
    You should be able to get the text box value doing this:

    var x = this.$.textBoxName.getValue();

    and then can pass this to your dashboard when you push the scene:

    stageController.pushScene('dashboard', x);

    and then in your dashboard assistant, the very first line:

    function DashboardAssistant(argFromPusher) {
    this.msg = argFromPusher;
    }

    That should get your message to the dashboard assistant. You can then use this.msg when you initialize the dashboard (the sendNotification function on the link you posted).

    Hopefully this helps somewhat.
    very useful, i'm making a little bit of progress. however, i have two questions:

    1. where would the var x = this.$.textBoxName.getValue(); line go, and
    2. when is the this.msg function used?

    i appreciate all the help.
  7. #7  
    it would go in the function that is run as soon as the button is tapped (in Ares on the events page of the button, goto the onTap function). Be sure the replace the "TextBoxName" with your own textboxes name. After that line you would then run the code to launch the dashboard.

    this.msg is the same as x, except in your dashboard assistant. I put the "this." in front of the variable so you can use it in any function in the dashboard assistant.

    if your having issues maybe post some of your code and I'll take a look.

Posting Permissions