9.07.14 Install Phonegap on Ubuntu 14.04 (Trusty Tahr)

I’ve started a Phonegap project at work and it was a bit more hassle then what I had hoped and thought. So I just wanted to post a little step-by-step guide on how I installed and solved the problems.

Let me know if it works for you, or if you have any questions.

Start of by installing NodeJS, NPM (Node Package Modules) and of course Phonegap.

sudo apt-get install nodejs
sudo apt-get install npm
sudo npm install -g phonegap

When you then try to create a project using the command

phonegap create test

You will get the error

The program ‘node’ can be found in the following packages:

That is because there are an older package in the Debian repository called node, so you need to remove it, and add a symlink for node to point to the nodejs folder.

sudo ln -s /usr/bin/nodejs /usr/bin/node

After that you can try to create a project again

phonegap create test

Finally we can try to run our newly created project with

phonegap run android

Which gave me two more errors I had to fix

Error: An error occurred while listing Android targets
Error: ERROR : executing command ‘ant’, make sure you have ant installed and added to your path.

So to fix these, I had to first add Android SDK to my path (know that using export only sets it for this session/terminal/shell, add it to your bashrc/profile to permanently fix it. After that I install ANT using apt-get

export PATH=${PATH}:/home/kyreri/bin/adt-bundle-linux-x86_64-20131030/sdk/platform-tools:/home/kyreri/bin/adt-bundle-linux-x86_64-20131030/sdk/tools

sudo apt-get install ant

Finally I thought I could run the emulator, but no. I had forgotten to install any emulator imges, so I got this message

phonegap run android -> ERROR : No emulator images (avds) found

And to solve this I did this, you can of course call it what ever you like, and use a different target (use the command “android list targets” to see what targets you have installed)

android create avd –name TestDevice-19 –target android-19

Finally I could run this command

phonegap run android

And get this image!

phonegap-emulator

24.06.14 Heroclix-apps

I got into Android development while I was playing a lot of Heroclix and was tired off dragging a rule book with me all the time. Heroclix Rules which is my main app with more then 30 000 downloads, is a collection of most of the rules, and I’ve updated the design once since the release back in December 2010. My second Heroclix app was the Heroclix Tournament Pairing app. That didn’t go that well, as I wasn’t a very experienced developer at that time, so I made  a lot of mistake and it all ended up being one big patchwork to get it to work. So now it’s been abandon, but I’m still thinking about ways to make a new one, as I think there is a marked for a tablet app for tournament pairing.

My last Heroclix app is Heroclix ‘em All (do you get the pun?), which is also my only paid app (for now). I put it out first at $1, and had it there for nearly a year before I upped it up to $2 to see how that would sell. I think the sales declined, so I tried something between, $1.5 which I feel works. Heroclix ‘em All is far from complete, but I feel that the monthly updates that I need to make steals all the fun of updating the app. As new figures are always coming out, and if I wait to long there are too many figures to update. So that is why I’ve started working on a synchronization system, where a user with the phone can upload a figure, and next time a user opens the app it will be synchronized. So hopefully the app will be user sustained. I will also make a web-site where you can log in with your Google account and edit figures.

23.06.14 Tag Story

As most of you know, I work now as a developer, but I still work on my own project when I get home from work. Either for Android or other platforms. So in this post I’m going to tell you a little bit about my current project.

Tag Story

Tag Story has been listed on the sideboard for quiet some time, but nothing have been written about it. I’m not going into details about the project (as you can read more about it here or here), but in short it is a framework and an app to help people get out and interact with the world. When they start the app they chose one of hopefully many stories that will take them on a journey in their neighbourhood or a place they have never been before. Each story is composed of many tags, that the user has to visit to complete the story. When a user finds a tag it can either be a part of a story, where the user has to make a choice of where to go next, or it can be a fun quiz about the area the tag was found in.

There are several ways of informing the user of where to go, the author can choose between a map with an arrow, or a sound, image, or just plain, depending on the need of secrecy or challenge.

Each of these stories are saved in large JSON files with a lot of links to all the different tags in each story, so for a novice author it can be pretty hard to navigate and create new stories. So that is why I’m now working on a web site for creating stories. You can either follow a simplified form with just the necessary fields, or you can open the advanced mode with all the fields possible for a story. As it is still a work in progress, you can even call it a beta, there is no save function.

For the app Tag Story I’m using vanilla Android together with Google Maps, and Google Play service. The Story Creator site is build using Ruby and Sinatra, plus Google Maps, Cloudant and CouchDB as the database, which I feel works really well. So if you haven’t tried a NoSQL database before, I can really recommend Cloudant and CouchDB. I’m thinking about writing a little post about how to get going with it, just to make it easier, as it was a bit of googling to get going. I’m also thinking about using Amazon Web Service for hosting images, videos, and sounds necessary for a story.

For now the site is hosted on Heroku, which is really simple to use. Just make a run script, and push your repo to Heroku.

I had planned to write about my other projects too, but I feel like saving the other projects till tomorrow.

14.10.13 Prompt User Input with an AlertDialog

Found this little snippet of code over at Androidsnippets.com, though I should share it with you. You never know when you need some user input from a dialog.

AlertDialog.Builder alert = new AlertDialog.Builder(this);

alert.setTitle("Title");
alert.setMessage("Message");

// Set an EditText view to get user input 
final EditText input = new EditText(this);
alert.setView(input);

alert.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
  String value = input.getText();
  // Do something with value!
  }
});

alert.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
  public void onClick(DialogInterface dialog, int whichButton) {
    // Canceled.
  }
});

alert.show();
// see http://androidsnippets.com/prompt-user-input-with-an-alertdialog

26.09.13 What I’m working on

There has been a while since last big update of my Heroclix apps (I’m looking at you sneak peek). And there is two reason for that;

  1. I don’t code all the time, plus I’ve got myself a job, so I’m no student with plenty of time anymore.
  2. I’ve been busy with two other app-projects.

One of the project is Tag Story. I’ve refactored the Tag Story project from the bottom and added more functionality. This was done partially because I wanted to be done with the project, and because I had some friends of mine that wanted to use it. I even made TagStory an own website so other people can try to use the project. So if you are curios about the project you can go to TagStory.no and read more. The documentation is not complete yet, but hopefully this I’ll be done this fall. I’m also going to post a bit about it on this site.

The other project is EyeCatch which I’m working on now. This is in co-operation with Lars Klintwall and HIOA. The Eyecatch app aims to learn kids to follow eye direction by clicking on boxes that the face in the middle looks at. It’s not done yet, but it is open-source so you can take a look at my github-profile.

11.09.13 New update for Clix ‘em All

Just wanted to let everyone know that I’m still alive and updating my apps. Hopefully I’ll soon have time to add the rest of the missing clix (always coming more).

2.07.13 Amazon Appstore

Amazon had a summer campaing where they would pay for the developer account the first year (normally it is $99). So I though I should see if people using Kindle Fire and similar where interested in my app. As long as the sales are higher then $99 I’m probably going to continue.

For now only Heroclix ‘em All is available, but I think Heroclix Rules is coming out tomorrow.