Results 1 to 4 of 4
  1.    #1  
    okay ive searched everywhere here and on webos internals and still have not found any directions or standards for calling services from within a webos app that you created.

    here is what i know so far.....

    You typically need to files to do this:
    Code:
    my.company.app.ipk
    my.company.app.service.ipk
    for installation the app.ipk and the service.app.ipk needs to be installed in this folder:
    Code:
    /media/cryptofs/apps
    in the webos app.ipk that you created it needs to use this command to call the service that you want:
    Code:
    this.controller.serviceRequest(this.serviceName,{method:"service",parameters:{service:"your_service".......blah blah
    the app.service.ipk needs to have three files:
    Code:
    my.company.app.jar
    my.company.app.service
    my.company.app
    those files go in these folders respectively (use cp command to cp from /media/cryptofs/apps to the appropriate folders below):
    Code:
    /usr/lib/luna/java/
    /usr/share/dbus-1/system-services/
    /etc/event.d/
    now that you have files in the java folder i think you need to restart java or something with this command:
    Code:
    /sbin/initctl stop java-serviceboot
    /sbin/initctl start java-serviceboot
    to corectly uninstall these files you can not use orage+tap you need to use WOQIS or preware so they can run scripts like these to remove the services. Put this script in the root directory of your app.service.ipk and call it prerm:
    Code:
    #!/bin/sh
    
    /sbin/stop my.company.app
    
    rm -f /usr/lib/luna/java/my.company.app.jar
    rm -f /usr/share/dbus-1/system-services/my.company.app.service
    rm -f /etc/event.d/my.company.app
    
    if [ -z /media/cryptofs/apps ]
    then
    	/sbin/initctl stop java-serviceboot
    	/sbin/initctl start java-serviceboot
    fi
    exit 0
    It looks like most people are using a slick installation script for installing both .ipk files mentioned above...moving the services to the correct folders....then restarting java and rescanning for newly installed apps. Here is one i put together for my app:
    Code:
    cd /tmp/
    
    wget http://random.website.com/my.company.app.ipk
    wget http://random.website.com/my.company.app.service.ipk
    
    ipkg -o /media/cryptofs/apps install my.company.app.ipk
    rm my.company.app.ipk
    
    /usr/bin/luna-send palm://com.palm.applicationManager/rescan {}
    
    ipkg -o /media/cryptofs/apps install my.company.app.services.ipk
    
    cp /media/cryptofs/apps/usr/lib/luna/java/my.company.app.jar /usr/lib/luna/java/my.company.app.jar
    
    cp /media/cryptofs/apps/usr/share/dbus-1/system-services/my.company.app.service /usr/share/dbus-1/system-services/my.company.app.service
    
    cp /media/cryptofs/apps/etc/event.d/my.company.app /etc/event.d/my.company.app
    
    /sbin/initctl stop java-serviceboot
    /sbin/initctl start java-serviceboot
    
    rm my.company.app.services.ipk
    so it appears like i have the basics down on how to get it to work. My main problems are....

    what do these files do and how are they connected:
    Code:
    my.company.app.jar
    my.company.app.service
    my.company.app
    how are people making their jar file? Are they using eclipse or are they writing simple scripts and zipping the folder they were in and changing .zip to .jar

    what does the .jar file need in to to get your service running?


    i just would like to see a standard for this so people dont have services running everywhere and everyone can be on the same page. And for noob webos programmers like myself we need some direction on utilizing services to run scripts from within our webos app.

    thanks for the help
  2. #2  
    I could be mistaken, but I don't even think the service needs to be Java. wIRC uses a service written in some form of C, I think. (I could be misremembering what I was told though).
  3. #3  
    The best way to get help on this is to join the #webos-internals IRC channel and introduce yourself and your application. We can help you host the source code and build and distribute the packages.

    -- Rod
    WebOS Internals and Preware Founder and Developer
    You may wish to donate by Paypal to donations @ webos-internals.org if you find our work useful.
    All donations go back into development.
    www.webos-internals.org twitter.com/webosinternals facebook.com/webosinternals
  4. #4  
    Quote Originally Posted by jhoff80 View Post
    I could be mistaken, but I don't even think the service needs to be Java. wIRC uses a service written in some form of C, I think. (I could be misremembering what I was told though).
    That's correct, our latest services from webos-internals are now C services, cause you don't need to restart Java (which causes the phone to go offline temporarily) to install them.

    -- Rod
    WebOS Internals and Preware Founder and Developer
    You may wish to donate by Paypal to donations @ webos-internals.org if you find our work useful.
    All donations go back into development.
    www.webos-internals.org twitter.com/webosinternals facebook.com/webosinternals

Posting Permissions