maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   [BETA RELEASE] PhoneME Advanced (Java Mobile) (https://talk.maemo.org/showthread.php?t=81969)

DavyP 2012-02-14 14:53

Re: [TESTING] PhoneME Advanced (Java Mobile) prototype release
 
Quote:

Originally Posted by santiago (Post 1164566)
, but i missed something about unzip $JAR "specific file and parameters that i miss.." -destination $MIDLET_NAME.png, then i left it like this and i used "java" icon in my path then..

The unzip package is not available on the emulator

/home/developer $ devrootsh apt-get update
/home/developer $ devrootsh apt-get install unzip
...
E: Package unzip has no installation candidate

/home/developer $ devrootsh apt-cache search unzip
zlib-bin - compression library - sample programs
busybox-power - Tiny utilities for small and embedded systems - enhanced package

So I had to install the busybox-power package. However, the unzip implementation it provides does not support the -aa -j command line switches:

BusyBox v1.19.3 (Debian 1.19.3power1) multi-call binary.

Usage: unzip [-opts[modifiers]] FILE[.zip][LIST] [-x XLIST] [-d DIR]

Extract files from ZIP archives

-l List archive contents (with -q for short form)
-n Never overwrite files (default)
-o Overwrite
-p Send output to stdout
-q Quiet
-x XLST Exclude these files
-d DIR Extract files into DIR

Davy

DavyP 2012-02-14 16:45

Re: [TESTING] PhoneME Advanced (Java Mobile) prototype release
 
The modified script that also creates the icons does not seem to work.
The application is running in the background and all the paths are OK
but as soon as I tap on the icon, the whole interface becomes
unresponsive. I actually have to shut down the whole emulator and start
it up again.

Strangely enough, if start the X terminal application in the N900 menu,
and run the script from there, I have no problem, and neither when I
start a terminal from my Linux desktop via the "mad remote shell"
command.

Davy

santiago 2012-02-14 16:56

Re: [TESTING] PhoneME Advanced (Java Mobile) prototype release
 
Quote:

Originally Posted by DavyP (Post 1164996)
The modified script that also creates the icons does not seem to work.
The application is running in the background and all the paths are OK
but as soon as I tap on the icon, the whole interface becomes
unresponsive. I actually have to shut down the whole emulator and start
it up again.

Strangely enough, if start the X terminal application in the N900 menu,
and run the script from there, I have no problem, and neither when I
start a terminal from my Linux desktop via the "mad remote shell"
command.

Davy

Hi bro! try this script, now it uses Original icon on a Jar file and moves it like a copy into /usr/share/icons/hicolor/scalable/hildon/$MIDLET_NAME.png

edit: open the sh file you have (midletname.sh) and change the phoneme path there

remember? you told me you have a different path in you Madde emulator
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 MakeJadSHortcutter!"
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: makejadsh JAR file";
  exit 1
fi

JAD="${JAR%.*}.jad"
if [ -f "${JAD}" ]; then
  echo -n "${JAD} already exists, overwrite the file? (Y/N) "
  read tmpans
  answer=$(echo "$tmpans" | 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!"
  MIDLET_ICON=`grep "MIDlet-Icon: " $JAD  | sed "s/\MIDlet-Icon://g" | sed 's/\///g' | sed 's/^[ \t]*//'`
  MIDLET_NAME=`grep "MIDlet-Name: " $JAD  | sed /MIDlet-Name:/s///`
  UNZIP_ICON=`unzip "$JAR" "$MIDLET_ICON" -d /usr/share/icons/hicolor/scalable/hildon/`
  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 tmpans
  answer=$(echo "$tmpans" | 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 '/home/user/phoneme/bin/cvm -Xmx12m -Dmicroedition.profiles=MIDP-2.1 -Dsun.midp.library.name=midp -Dsun.midp.home.path=/home/user/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///`
  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
X-Osso-Type=application/x-executable
Terminal=true
Icon=$MIDLET_NAME" | sudo tee /usr/share/applications/hildon/"$MIDLET_NAME".desktop
  sleep 6
  run-standalone.sh dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteInfoprint string:"Created! The $MIDLET_NAME shortcut is now on the Menu"
  echo "$MIDLET_NAME added as a .desktop shortcut"
  sleep 4 ; else
  run-standalone.sh dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteInfoprint string:"Unable to create $MIDLET_NAME.desktop file, check the ownership and try again!"
  sleep 2
  echo "Unable to add $MIDLET_NAME added as a .desktop shortcut, check the ownership!"
fi

exit 0


pedsarjon 2012-02-14 17:00

Re: [TESTING] PhoneME Advanced (Java Mobile) prototype release
 
this is my menu item opera-mini

[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Name=OperaMini-Java
Exec=/opt/java2/bin/cvm -Xmx12m -Dmicroedition.profiles=MIDP-2.1 -Dsun.midp.library.name=midp -Dsun.midp.home.path=/opt/java2/midp/midp_linux_fb_gcc -Dcom.sun.midp.mainClass.name=com.sun.midp.main.Cdc MIDletSuiteLoader sun.misc.MIDPLauncher -suitepath /opt/java2/opera_mini_6.5_.jar -1 Browser
X-Osso-Type=application/x-executable
Icon=opera

DavyP 2012-02-14 17:04

Re: [TESTING] PhoneME Advanced (Java Mobile) prototype release
 
If I do "mad remote shell", I am logged in with username 'developer'. To
become root I have to run devrootsh [command].

I basically think that all these are issues with the emulator doing things
differently compared to a regular N900 device.

Also note that not all midlets ship with an icon.

Davy

santiago 2012-02-14 17:17

Re: [TESTING] PhoneME Advanced (Java Mobile) prototype release
 
Quote:

Originally Posted by DavyP (Post 1165007)
If I do "mad remote shell", I am logged in with username 'developer'. To
become root I have to run devrootsh [command].

I basically think that all these are issues with the emulator doing things
differently compared to a regular N900 device.

Also note that not all midlets ship with an icon.

Davy

umm.. strange, you moved the phoneme path.. then i change the script too, to have common paths, :D for the icon, i've got to quote the icon, give me one minute ;) i've not an emulator on my ubuntu pc, :'( i'm doing all from my device.. i'm back soon

pedsarjon 2012-02-14 17:23

Re: [TESTING] PhoneME Advanced (Java Mobile) prototype release
 
tanks santiago its worked in maemo but must delet "sudo" in
Icon=$MIDLET_NAME" | sudo tee /usr/share/applications/hildon/"$MIDLET_NAME".desktop
meaning
Icon=$MIDLET_NAME" | tee /usr/share/applications/hildon/"$MIDLET_NAME".desktop

DavyP 2012-02-14 17:35

Re: [TESTING] PhoneME Advanced (Java Mobile) prototype release
 
Santiago: I took care of correcting all the paths.

There is something else going on. The midlet is actually running, but
behind the hildon menu with all the icons. If I close the emulator, it kills
the application (including the hildon menu app) and then I see the
midlet very briefly before the emulator completely shuts down.

So it is probably not a problem with your script.

Davy

pvnhattoan 2012-02-14 17:51

Re: [TESTING] PhoneME Advanced (Java Mobile) prototype release
 
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 ?

santiago 2012-02-14 17:52

Re: [TESTING] PhoneME Advanced (Java Mobile) prototype release
 
Quote:

Originally Posted by pedsarjon (Post 1165024)
tanks santiago its worked in maemo but must delet "sudo" in
Icon=$MIDLET_NAME" | sudo tee /usr/share/applications/hildon/"$MIDLET_NAME".desktop
meaning
Icon=$MIDLET_NAME" | tee /usr/share/applications/hildon/"$MIDLET_NAME".desktop

Pedsarjon: The only way i found to pipe it to /usr/share/applications/hildon was just "sudo tee" becouse it creates a loop without the sudo.. By the way, now i corrected the iconame (if you restart you'll see the icon), and i moved the phoneme path to /opt/, so you can change phoneme path or edit this script to your own path..

Davy this is the corrected 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 MakeJadSHortcutter!"
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: makejadsh JAR file";
  exit 1
fi

JAD="${JAR%.*}.jad"
if [ -f "${JAD}" ]; then
  echo -n "${JAD} already exists, overwrite the file? (Y/N) "
  read tmpans
  answer=$(echo "$tmpans" | 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!"
  MIDLET_ICON=`grep "MIDlet-Icon: " $JAD  | sed "s/\MIDlet-Icon://g" | sed 's/\///g' | sed 's/^[ \t]*//'`
  MIDLET_NAME=`grep "MIDlet-Name: " $JAD  | sed /MIDlet-Name:/s///`
  ICON_NAME=`grep "MIDlet-Name: " $JAD  | sed /MIDlet-Name:/s/// | sed 's/^[ \t]*//' | sed 's/ //g'`
  UNZIP_ICON=`unzip "$JAR" "$MIDLET_ICON" -d /usr/share/icons/hicolor/scalable/hildon/`
  RENAME_ICON=`mv "/usr/share/icons/hicolor/scalable/hildon/$MIDLET_ICON" "/usr/share/icons/hicolor/scalable/hildon/$ICON_NAME.png"`
fi

SH="${JAR%.*}.sh"
if [ -f "${SH}" ]; then
  echo -n "${SH} Already exists, overwrite the file? (Y/N) "
  read tmpans
  answer=$(echo "$tmpans" | 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///`
  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
X-Osso-Type=application/x-executable
Terminal=true
Icon=$ICON_NAME" | sudo tee /usr/share/applications/hildon/"$MIDLET_NAME".desktop
  sleep 6
  run-standalone.sh dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteInfoprint string:"Created! The $MIDLET_NAME shortcut is now on the Menu"
  echo "$MIDLET_NAME added as a .desktop shortcut"
  sleep 4 ; else
  run-standalone.sh dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteInfoprint string:"Unable to create $MIDLET_NAME.desktop file, check the ownership and try again!"
  sleep 2
  echo "Unable to add $MIDLET_NAME added as a .desktop shortcut, check the ownership!"
fi

exit 0

pvnhattoan: does it run from xterm? not all the midlets are fully supported, run the script and poste here the output, DavyP will correct phoneme features to have more compatibility


All times are GMT. The time now is 12:14.

vBulletin® Version 3.8.8