Menu

Main Menu
Talk Get Daily Search

Member's Online

    User Name
    Password

    [BETA RELEASE] PhoneME Advanced (Java Mobile)

    Reply
    Page 23 of 85 | Prev | 13   21     22   23   24     25   33 | Next | Last
    DavyP | # 221 | 2012-02-14, 17:55 | Report

    Originally Posted by pvnhattoan View Post
    I have a java game. When i make a "file.sh" manual, then i can run that java game, but when i make "file.sh" by makejadsh, then I saw whitescreen. What do you think about this problem ?
    There is not much to go on without the content of both files. If you
    can show us both, we can have a look at how they and hopefully tell
    you what is wrong.

    Davy

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to DavyP For This Useful Post:
    pedsarjon

     
    DavyP | # 222 | 2012-02-14, 23:30 | Report

    Hi all,

    I am still having issues with the emulator not properly starting when applications with the shortcut/icon in the menu. I have the same problems with the template applications from madde, so it is a general problem and a bug in my application. However, it means I am not able to test the deb package I created:

    http://davy.preuveneers.be/phoneme/public/n900/deb/

    It installs phoneme in /opt and creates shortcuts to phoneME (which does nothing because it calls cvm without parameters), Opera Mini and microemu-demo.

    Could somebody install this (with dpkg -i xxx.deb) and test this and see if the shortcuts work?

    I think there might be an issue that the package will be installed as root, and that the midlets won't have write access to certain subdirectories in /opt/phoneme because they don't run with root privileges. The Opera Mini midlet would be a good test case for that.

    Thanks,
    Davy

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to DavyP For This Useful Post:
    pedsarjon

     
    munozferna | # 223 | 2012-02-14, 23:36 | Report

    Originally Posted by
    Nokia-N900:/home/user# dpkg --install cvm_mr2.b168\+svn20547-20120214_armel.deb
    Selecting previously deselected package cvm.
    (Reading database ... 46881 files and directories currently installed.)
    Unpacking cvm (from cvm_mr2.b168+svn20547-20120214_armel.deb) ...
    dpkg: error processing cvm_mr2.b168+svn20547-20120214_armel.deb (--install):
    trying to overwrite `/usr/share/applications/hildon/opera.desktop', which is also in package opera-mobile
    dpkg-deb: subprocess paste killed by signal (Broken pipe)
    Errors were encountered while processing:
    cvm_mr2.b168+svn20547-20120214_armel.deb
    I'm removing opera (native) to test it. and will update soon.

    Originally Posted by
    Nokia-N900:/home/user# dpkg --install cvm_mr2.b168\+svn20547-20120214_armel.deb
    (Reading database ... 46792 files and directories currently installed.)
    Unpacking cvm (from cvm_mr2.b168+svn20547-20120214_armel.deb) ...
    Setting up cvm (mr2.b168+svn20547-20120214) ...
    Nokia-N900:/home/user#
    And the Opera launcher works, but I get an error ' Cannot finish installation because of insufficient storage space'.

    Microemu-demo works though. where is it trying to install opera mini?

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by munozferna; 2012-02-14 at 23:42.
    The Following User Says Thank You to munozferna For This Useful Post:
    pedsarjon

     
    DavyP | # 224 | 2012-02-14, 23:39 | Report

    In my next deb I will rename the files to operamini to avoid the name clash.

    Edit: opera name clash fixed in latest build.

    Davy

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by DavyP; 2012-02-14 at 23:51.
    The Following User Says Thank You to DavyP For This Useful Post:
    pedsarjon

     
    DavyP | # 225 | 2012-02-14, 23:55 | Report

    Originally Posted by munozferna View Post
    I'm removing opera (native) to test it. and will update soon.

    And the Opera launcher works, but I get an error ' Cannot finish installation because of insufficient storage space'.

    Microemu-demo works though. where is it trying to install opera mini?
    Opera is trying to save some files in a record store. These files are created in /opt/phoneme/midp/midp_linux_fb_gcc/appdb.

    However, this folder is owned by root:root and the phoneME vm is executed under the account 'user' which does not have write permissions to this folder.

    See if you can do the following as root:

    chmod a+rwx /opt/phoneme/midp/midp_linux_fb_gcc/appdb

    and if that changes the problem. The reason why microemu does not have this issue, is because it does not write to this appdb folder.

    If I can then figure out how this folder can maintain its write permissions while creating the deb archive, then we are good to go.

    Davy

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to DavyP For This Useful Post:
    pedsarjon

     
    munozferna | # 226 | 2012-02-14, 23:58 | Report

    Originally Posted by DavyP View Post
    See if you can do the following as root:

    chmod a+rwx /opt/phoneme/midp/midp_linux_fb_gcc/appdb

    and if that changes the problem. The reason why microemu does not have this issue, is because it does not write to this appdb folder.

    If I can then figure out how this folder can maintain its write permissions while creating the deb archive, then we are good to go.

    Davy
    That worked Can you add the chmod on the post-install script or something like that?

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by munozferna; 2012-02-15 at 00:00.

     
    DavyP | # 227 | 2012-02-15, 00:08 | Report

    Jep, fixed in my last upload of 1 minute ago (same filename though).

    Davy

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 4 Users Say Thank You to DavyP For This Useful Post:
    Joseph9560, MaddogG, pedsarjon, santiago

     
    santiago | # 228 | 2012-02-15, 11:17 | Report

    i'll post a new script this evening i did it, but i didnt save it!

    then later i'll finish it

    edit:

    @DavyP

    The script name is excalibur, just becouse it's fast, and powerfull, also easy to remember.. I added more features like

    - use the right midlet name in the shortcut
    - use the right icon name for the shortcut
    - call to gtk-update-icon-cache to see immediately the icon on the shortcut (*** minor maybe fix at the end of this message)
    - possibility to remove all files after installation of the midlet, expecially:

    $SH file
    $JAD file
    $JAR file
    $DESKTOP shortcut

    After the installation, without closing the shell, the excalibur script (for newbies must be on /usr/bin/ with chmod +rwx or 775) will ask you to go on the menu, and to try the midlet.. (maybe you want an auto test that run it with final question about the result?) By now, if you will answer with Y, it will keep the midlet, else it will remove it..


    ####### Excalibur Script ########

    Code:
    #!/bin/sh
    
    run-standalone.sh dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteInfoprint string:"Welcome to Excalibur Script!"
    sleep 2
    JAR=$1
    if [ ! -f "${JAR}" ]; then
      run-standalone.sh dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteInfoprint string:"JAR file does not exist!" && sleep 3
      echo "Usage: excalibur JAR file";
      exit 1
    fi
    
    JAD="${JAR%.*}.jad"
    if [ -f "${JAD}" ]; then
      echo -n "${JAD} already exists, overwrite the file? (Y/N) "
      read midlet
      answer=$(echo "$midlet" | tr '[:upper:]' '[:lower:]')
      if [ "$answer" != "y" ] && [ "$answer" != "Y" ]; then
        echo "Not overwriting ${JAD} file!"
      else
        rm -f "${JAD}"
      fi
    fi
    
    if [ ! -f "${JAD}" ]; then
      unzip -aa -j -p ${JAR} "META-INF/MANIFEST.MF" | sed -e '/^[ \t]*$/d' > "${JAD}"
      echo "MIDlet-Jar-URL: ${JAR}" >> "${JAD}"
      echo "MIDlet-Info-URL: http://" >> "${JAD}"
    
      FILESIZE=$(stat "${JAR}")
      echo "MIDlet-Jar-Size: ${FILESIZE}" >> "${JAD}"
    
      echo "${JAD} file created!"
      # find png file
      MIDLET_ICON=`grep "MIDlet-Icon: " $JAD  | sed "s/\MIDlet-Icon://g" | sed 's/\///g' | sed 's/^[ \t]*//'`
      # use the correct name of the icon file
      MIDLET_NAME=`grep "MIDlet-Name: " $JAD | sed /MIDlet-Name:/s/// | sed  's/^[a \t]*//' | sed 's/ .*//'`
      # extract the icon
      UNZIP_ICON=`unzip "$JAR" "$MIDLET_ICON" -d /usr/share/icons/hicolor/scalable/hildon/`
      # rename the icon using the midlet name
      RENAME_ICON=`mv "/usr/share/icons/hicolor/scalable/hildon/$MIDLET_ICON" "/usr/share/icons/hicolor/scalable/hildon/$MIDLET_NAME.png"`
    fi
    
    SH="${JAR%.*}.sh"
    if [ -f "${SH}" ]; then
      echo -n "${SH} Already exists, overwrite the file? (Y/N) "
      read midlet
      answer=$(echo "$midlet" | tr '[:upper:]' '[:lower:]')
      if [ "$answer" != "y" ] && [ "$answer" != "Y" ]; then
        echo "Not overwriting ${SH} file!"
      else
        rm -f "${SH}"
      fi
    fi
    
    if [ ! -f "${SH}" ]; then
      MAINCLASS=`cat $JAD | grep 'MIDlet-1:' | cut -d ',' -f 3`
      READLINKJAR=`readlink -f $JAR`
      echo '#!/bin/sh' > $SH
      echo '' >> $SH
      echo '/opt/phoneme/bin/cvm -Xmx12m -Dmicroedition.profiles=MIDP-2.1 -Dsun.midp.library.name=midp -Dsun.midp.home.path=/opt/phoneme/midp/midp_linux_fb_gcc -Dcom.sun.midp.mainClass.name=com.sun.midp.main.CdcMIDletSuiteLoader sun.misc.MIDPLauncher -suitepath' $READLINKJAR '-jadpath' $JAD -1 $MAINCLASS >> $SH
      chmod a+x $SH
      echo "${SH} file created!"
      READLINK=`readlink -f $SH`
      MIDLET_NAME=`grep "MIDlet-Name: " $JAD | sed /MIDlet-Name:/s/// | sed  's/^[a \t]*//' | sed 's/ .*//'`
      MIDLET_VERSION=`grep "MIDlet-Version: " $JAD  | sed /MIDlet-Version:/s///` 
      echo -e "[Desktop Entry]
    Encoding=UTF-8
    Version=$MIDLET_VERSION
    Type=Application
    Name=$MIDLET_NAME
    Exec=.$READLINK
    Comment=`readlink -f $JAD`
    Comment=`readlink -f $JAR`
    X-Osso-Type=application/x-executable
    Terminal=true
    Icon=$MIDLET_NAME" | sudo tee /usr/share/applications/hildon/"$MIDLET_NAME".desktop
      sleep 6
      echo "$MIDLET_NAME added as a desktop shortcut"
      sleep 4
    fi
    
      echo "Does the midlet work fine? Run it and and come back here to say (Y/N)"
      read test
      ICONS_PATH=/usr/share/icons/hicolor/scalable/hildon/
      DESKTOP_PATH=/usr/share/applications/hildon
      answer0=$(echo "$test" | tr '[:upper:]' '[:lower:]')
      if [ "$answer0" != "n" ] && [ "$answer0" != "N" ]; then
      run-standalone.sh dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteInfoprint string:"Thanks for using Excalibur Script!" && sleep 3
      exit 1; else
      echo "Write the Midlet Name here: "
      read input_name
      DESKTOP_FILE=`grep "$input_name" $DESKTOP_PATH/* | sed -e 's/[^:]*$//g' | sed -e 's/[:^]//g'`
      SH_FILE=`cat $DESKTOP_FILE | grep "Exec=." | sed /Exec=./s///`
      JAR_FILE=`cat $DESKTOP_FILE | grep ".jar" | sed /Comment=/s///`
      JAD_FILE=`cat $DESKTOP_FILE | grep ".jad" | sed /Comment=/s///`
      ICON_FILE=`cat $DESKTOP_FILE | grep "MIDlet-Name: " | sed /MIDlet-Name:/s/// | sed 's/^[ \t]*//' | sed 's/ //g'`
      echo "Do you want to remove $input_name? (Y/N)"
      read answer
      if [ "$answer" != "y" ] && [ "$answer" != "Y" ]; then
        echo "$input_name not removed!"; else
        echo "Removing all $input_name files . ."
        echo "Remoing $SH_FILE . ."
        sudo rm -rf $SH_FILE
        echo "Removed!"
        echo "Removing $JAR_FILE . ."
        sudo rm -rf $JAR_FILE
        echo "Removed!"
        echo "Removing $JAD_FILE . ."
        sudo rm -rf $JAD_FILE
        echo "Removed!"
        echo "Removing $ICON_FILE . ."
        sudo rm -rf $ICONS_PATH$ICON_FILE*
        echo "Removed!"
        echo "Removing $DESKTOP_FILE . ."
        sudo rm -rf $DESKTOP_FILE
        echo "Removed!"
        echo "All files Removed! Midlet is removed!"
      run-standalone.sh dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteInfoprint string:"Thanks for using Excalibur Script!" && sleep 3  fi
      fi
    fi
    
    exec /usr/bin/gtk-update-icon-cache

    ***gtk-update-icon-cache fix***
    cause of some strange reason, my device is an example about it, the /usr/bin/gtk-update-icon-cache doesn't work as well, then i searched on this Amazing Talk foundig the Bug Report about /usr/bin/gtk-update-icon-cache. Seems to be that /usr/bin/gtk-update-icon-cache just has one line in:
    Code:
    #!/bin/sh -e
    nothing more, someone fixed it in

    Code:
    #!/bin/sh -e
    
         [ -d "$1" ] && touch "$1"
    then you just have to edit it and to save it to refresh the Maemo Icon Cache and to see immediately the icons without rebooting maemo. Excalibur script creates a desktop file but if you don't fix it with the method i found you will not see an icon on the created shortcut untill a device reboot

    Ciao you all,

    Cristian

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by santiago; 2012-02-15 at 21:41.
    The Following 2 Users Say Thank You to santiago For This Useful Post:
    DavyP, pedsarjon

     
    DavyP | # 229 | 2012-02-15, 22:24 | Report

    Hi Cristian,

    Thanks for all these script updates. At the moment I cannot test
    this on the emulator due to incompatibilities with a real device.

    There is one thing I wanted to point out: you do not need to
    generate the jad file if it does not exist. In such a case, you create
    the sh file without the '-jadpath midlet.jad' parameters.

    Also, you could argue if you create a desktop file, you can directly
    put the startup command in the desktop file rather than in a
    separate script.

    Then there are a few minor other issues I have come across with
    certain midlets (like wrong line endings and dangling spaces).

    I will see how I can fix these issues and embed the script in my
    next build. My plan was actually to build something directly within
    the phoneME application in native Qt4 code in a similar way like
    I did for my Android build, but for the time being I think you script
    will do.

    Cheers,
    Davy

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to DavyP For This Useful Post:
    santiago

     
    santiago | # 230 | 2012-02-15, 22:41 | Report

    Originally Posted by DavyP View Post
    Hi Cristian,

    Thanks for all these script updates. At the moment I cannot test
    this on the emulator due to incompatibilities with a real device.

    There is one thing I wanted to point out: you do not need to
    generate the jad file if it does not exist. In such a case, you create
    the sh file without the '-jadpath midlet.jad' parameters.

    Also, you could argue if you create a desktop file, you can directly
    put the startup command in the desktop file rather than in a
    separate script.

    Then there are a few minor other issues I have come across with
    certain midlets (like wrong line endings and dangling spaces).

    I will see how I can fix these issues and embed the script in my
    next build. My plan was actually to build something directly within
    the phoneME application in native Qt4 code in a similar way like
    I did for my Android build, but for the time being I think you script
    will do.

    Cheers,
    Davy
    Yes. I'm not a bash expert, i added the lines without comments, i was in panic! ahahahah, i'll fix it soon

    i can try with zenith for now, but first i remove $JAD and $SH variables, i made confusion! ahahhaah


    ** foe the lines, you say this or the other script? beccouse i changed sed lines here to use correct icon, names etc


    edit:

    Script is changed now, i fixed everything except it doesnt accept jar file names with spaces ( ex: ciao from the italy.jar )i'm tired, i go to sleep i see caracters everywhere..

    changes

    removed sh line
    removed jad line
    changed the echo >> to $MIDLET_NAME.desktop as u wrote

    down here is the zip file with gtk-update-icon-cache and excalibur script, they must be on /usr/bin/ with rwx permissions.

    Ciao dall'Italia

    Cristian

    Edit | Forward | Quote | Quick Reply | Thanks
    Attached Files
    File Type: zip files.zip (1.7 KB, 89 views)

    Last edited by santiago; 2012-02-16 at 02:24.
    The Following User Says Thank You to santiago For This Useful Post:
    pedsarjon

     
    Page 23 of 85 | Prev | 13   21     22   23   24     25   33 | Next | Last
vBulletin® Version 3.8.8
Normal Logout