I. Directory structure
Second, new App-xiang folder
1. manifest.json file
{ "package_id":"Com.modou.xiang", "name":"App-xiang", "Display_name":"Electronic Photo Frame", "author":"Tingpan", "Author_mail":"[email protected]", "Homepage":"modouwifi.cn", "version":"0.0.1", "os_version":"1.3.01", "release_date":"2015.06.22", " Location":"Internal", "Description":"This is an electronic photo frame", "instruction":"This is the first version of", "autostart":false, "Start_on_boot":false}
2. Init
#!/bin/SHCurDir=$ (CD $ (dirname$0) &&pwd) PWD="$ (CD $ (dirname $) && pwd)"TITLE="Electronic Photo Frame"program_name="App-xiang"ICON="Res/icon.png"Pressed_icon="Res/icon_p.png"Apps_config_dir="/data/conf"Launcher_config_dir="$APPS _CONFIG_DIR/LAUNCHER/CONF.D"Launcher_config_file="$LAUNCHER _config_dir/$PROGRAM _name.conf"Install_bin="/usr/bin/install"REMOVE="/bin/rm-f"usage () {Echo "error:action Missing" Echo "Syntax: <start|stop|restart|status|config|install|uninstall>"}Install() { Echo "{">"$PROGRAM _name.conf" Echo "\ "name\": \ "$TITLE \",">>"$PROGRAM _name.conf" Echo "\ "icon\": \ "$PWD/$ICON \",">>"$PROGRAM _name.conf" Echo "\ "iconpressed\": \ "$PWD/$PRESSED _icon\",">>"$PROGRAM _name.conf" Echo "\ "exec\": \ "$PWD/init run\",">>"$PROGRAM _name.conf" Echo "\ "msgnum\": 4">>"$PROGRAM _name.conf" Echo "}">>"$PROGRAM _name.conf"$INSTALL _bin-d $LAUNCHER _config_dir $INSTALL _bin"$PROGRAM _name.conf" "$LAUNCHER _config_file"}uninstall () {$REMOVE"$LAUNCHER _config_file"}run () {#textview2-T"Hello"-M"Hello World"#textview2-T"Hello"-m ${curdir} imageview ${curdir}/res/qi_224_240.png224 -&Sleep 5 Killallimageview ImageView ${curdir}/res/sheng_320_240.png the -} Case " $" inch "Start") start;; "Stop") stop;; "Run") run;; "Restart") start stop;; "Install" ) Install;; "Uninstall") uninstall;; "Set_config") Set_config;; *) usage;;Esac
3, the Res folder into the following PNG image,
Note: Icon.png and icon_p.png pixels are 111x111
MPK Package and source code download:
Http://pan.baidu.com/s/1eQniLRc
Reference:
Https://gitcafe.com/Modou/app-framework
https://gitcafe.com/hdcola/ModouAppDevTutorial/tree/master/app-helloworld0.0.1
Magic Bean Electronic Photo frame