So you may have seen this thing called apkenv, which allows a very "small" set of Android apks to be run inside Harmattan.

If you follow me on Twitter, you would have seen I have been doing some experimental packaging, make these apks appear to be fully fledged apps (launcher icon, app mgr info, tap>hold>uninstall, etc).

NOTE:This method still requires you to install apkenv+libraries before you can use the apps you make. It also will work assuming you followed the original tutorial EXACTLY! I also assume you use linux (I use ubuntu VM ).

Obviously, I do not condone publishing apks for those you do not have the right to use, so I will simply post a tutorial using a skeleton archive (attached) to help.

First up, extract the archive to the desktop.

Rename the folder to whatever you wish to call the app. (Will call it foobar from here-in).

Inside foobar there is a debian folder, opt folder and foobar.desktop. First, we will modify the opt folder.

In the opt folder, you should have a sub directory foobar. This is where you store your .apk, icon.png (80x80), and execution script. The execution script isn't too important if you are confident at running command using the foobar.desktop file. However, I still suggest using this method, as it has greater control over tasks in my opinion.

Once you have opt/ all sorted, it is time to move on to the debian directory. Inside this we have postinst , changelog, control, foobar.install, mainfest.aegis, readme and rules. The only files you need to edit are postinst, changelog, control and foobar.install.

Open foobar.install in a text editor, changing the paths used to suit the /opt of your app. Same goes for postinst, simply adjust the paths to suit your package.

Finally, edit the foobar.desktop file. Here, we control what the user sees on the launcher page. The icon and exec fields simply need to have their paths altered. Change Name= to the name you want displayed.

P.S: I simply re-use the same structure for all my packaging (due to my app's being scripts and not QML/GUI based) so you may see out of place names eg. Harmoji, ABSapce etc. If so, I apologise, I have triple checked everything but I could have missed something. I trust if you're skilled enough to be doing this sort of thing, you will have the logic to change them accordingly.

This script will allow you to save/load game datas seperately. So you won't lose it after a reboot or after playing another game.

To run apk files with apkenvwrp script. Execute it like

Code:

cd /home/user/.apkenvwrp
sh apkenvwrp.sh /path/to/your/apk

Always use the above method to run an apk to avoid losing saved game datas. Here ends the apkenv part. Now lets move on to deb packaging on your N9/N900 if you are interested. You can forget the terminal for ever once you installed a game in this way. (Only a few changes from the apk to deb tutorial by MFaroTusino. Main focus is on deb packaging.) You can skip this deb packaging tutorial and read my next post on this thread to find an easy way to launch apks from launcher view with saved game datas.

TUTORIAL: Deb Packaging

Let's do some necessary things first. Hope you still have the downloaded scripts.zip file. Extract it and get make-deb.sh

As an example we are going to pack the foobar archive as deb. Download foobar.zip from attachments. You don't have to edit anything as of now in this example package. But You have to replace every foobar occurence with your name when you try another file. (replace folder name, file names, and edit the file inside folders using text editor. Just replace foobar with your name.)

Extract foobar.zip. You will get a foobar directory. Inside are 3 sub folders named DEBIAN, opt and usr. Inside DEBIAN you have a control file and postinst file. Inside opt there is a foobar folder and inside it you have an 80x80 icon file, and an apk file. Inside /usr/share/applications/ you will find foobar.desktop.

Steps for Deb Packaging

1) Copy the foobar directory to /home/user/

Code:

cp -r /path/to/foobar /home/user/

If you get error try without root access. If still having error try /usr/bin/ instead of /home/user/

4) Copy the created deb to desired location using filebox or terminal.

Code:

cp -r /home/user/foobar_0.1.deb /home/user/MyDocs/

Now you know how to make a deb in easy steps. Please note that the foobar.apk we have in /foobar/opt/foobar/ is just a dummy file. It won't work with apkenv in either way. Download an android game which is working with apkenv. Lets say Angry Birds Rio. Rename the file to AngryBirdsRio.apk and replace the foobar.apk with it. Now rename all folders and files named foobar to AngryBirdsRio. Using a text editor replace all occurrence of foobar with AngryBirdsRio in control, postinst, and AngryBirdsRio.desktop files. Save the changes. Then follow the deb packaging step. Install the deb you created. That's it. Now onwards tap icons and play the games right from launcher view without fearing data loss. Cheers!

If you have any confusion feel free to ask. All the informations are taken from various TMO threads. Credits go to the respective authors with my respect.

For you people who said Angry Birds Seasons is not working. Try it with apkenvwrp.sh script described above. It will work!

cd /home/user/.apkenvwrp

sh apkenvwrp.sh /path/to/angrybirdsseasons.apk

And for those who want an icon in launcher view but don't want to do deb packaging or don't want to lose some storage sapce just make a desktop file with path to icon and exec=sh /home/user/.apkenvwrp/apkenvwrp.sh /path/to/your/apk

EDIT: Incase of extreme laziness, I have attached a sample desktop file. Edit it and place it in /usr/share/applications to launch your apk.