JBot wars

537 days ago

I spirit of CRobots I decided to do a little javascript robot combat arena. Enjoy the JBot wars

All the code is in the index.html, but I also uploaded it to github

Kalle Kuismanen

Random, Current Projects

Comment

---

Taxi app

667 days ago

Just finished a cross platform Taxi App. There is a big taxi company in Finland called Lähitaksi and they have nice textmessage based ordering system. I pitched about two years ago, that I could make them a geolocation based cross platform app to help users so that they don’t have to type in long road names. Application was published by Fairspectrum.

Platforms were Windows Phone, Android, iOS and Symbian. I decided to use PhoneGap or Cordova

Coding the original application took about two days. Goal was to use Cordova wrapper and quickly adapt the Javascript to different platforms.

Initially all went very well. All platforms except Symbian had Cordova implementation. Original estimation that it would take two days / platform to do the adaptation was quite close. Main problem was that our original design didn’t work quite seamlessly across the different platforms and had to be tuned a bit.

Then we ran into problems. We had hoped to use Openlayers and Open Streetmap for mapping and Nominatim for reverse geocoding. Unfortunately Open Streetmaps in Helsinki region weren’t quite upto date and we had to adapt. So for iOS we used Mapkit, for Symbian and Android Google maps and for Windows Bing maps. This increased work load about ten fold. First problem was that it was first time we were coding a “real” app for Windows so little bit of studying was needed. Our Javascript codebase needed some branching. On iPhone and Windows Phone we used the native map widget, but on Symbian and Android Openlayers.

Biggest problem was Windows Phone. Cordova fought back the whole way home, but finally we succeeded. Main problem was, that when we wanted to send events to the Javascript from C# code, the events arrived multiple times. We ran out of time and just redesigned the code to ignore multiple events.

Cordova project doesn’t include Symbian wrapper so we had to use QWebView to do it. It worked out very nicely though Symbian Web Runtime was also a viable alternative. Main problem was the poor quality of Symbian tools. We couldn’t debug on the device – phone rebooted when debugger connected etc. But application works really well.

Beautiful graphical design was created by Mainostuli

Android version: Google Play
iOS version: iTunes
Windows Phone: Window Phone Store
Symbian Version: Submission pending

Kalle Kuismanen

Current Projects, Mobile

Comment

---

Stackoverflow answers / we salute you

670 days ago

Best things are done by people for people just because. One of the best examples of this is the http://stackoverflow.com questions.

I’ve been stuck many times and found salvation from this website! I salute you all.

I decided that I should also make a contribution so here it is…

How to make dialogs in phonegap

Here is my solution

Kalle Kuismanen

Mobile, Random

Comment

---

How do people find this page

692 days ago

Statistics are fun. Here are search terms that have been used recently to find this page. I guess I should publish something more than the stopwatch.

creabros.fi
kalle kuismanen
title
http //www.creabros.fi/index.php?id=46
www.creabros.fi
creabros oy
nokia 5800 magic tricks
prettier inurl /index.php?option=com_guestbook site .fi
http //www.creabros.fi/?id=20
creabros
touchy feely stopwatch for nokia 5800
download stop watch for nokia 5800 xpress music
stopwatch for symbian anna
dice throwing nokia 5230
n8 için opengl drıver indir
of /php-fusion/ site .fi
bullet for symbian
ip 216.172.188.219 id
revenues in finland 2011
i see numbers on screen while operating menu in nokia 5235
stopwatch from ovistore
dice box sisx
symbian anna stopwatch
jogos nokia sensor 5800
http //www.creabros.fi/?id=29
nokia c5-03 stop watch
rolling dice download for nokia 5800
mathe aplication for nokia 5800
countries distribution of top 10 market
nokia 5800 magic trick
touchy feely stopwatch download
gun apps nokia 5233
touchy feely stopky
sales finland
menu inurl /index.php?option=com_k2 site .fi
stopwatch nokia 5800 applications
symbian belle egroupware sync
a box of dice nokia
stopwatch nokia 5530
http //www.creabros.fi/?id=61
dice box belle symbian
symbian publisher id
stopwatch 2.0 symbian
physics of a voodoo doll
touchy feely symbian
http //www.hedelmatmajat.fi/index.php?section=12
ฟรีroll dice.sisx
mikä nokia n8 wrapper
magic effects for nokia 5800
magic trick nokia 5800 download
nokia 5800 dice
lbchron1.01 download
stopwatch symbian anna
touchy feely stopwatch nokia 5230
stopwatch application for nokia 5800
real beer app motion sensors для nokia x6
dice throwing for nokia download
stopwatch for n8
nokia express music stop watch
timer stopwatch.sisx
dicegame two with bullet physics creabros source
скачать touchy feely 5230
games 5800 music
download stopwatch for xpressmusic 5800
setting stopwatch in nokia 5800 xpress music
stopwatch for nokia 5800 xpress
creabos
stopwatch 1.02.sisx certificate
touchy feely 5800
timer for nokia 5800 xpress
nokia 5800 stopwatch signed download
dice throwing nokia 5800
crea bros.
what does uikon mean in polish
touchy feely stopwatch 1.05
a box of dice 3d
stopwatch for nokia c7-00
kuismanen kalle
is there stop watch in xpress music 5800
5800 sensors
php id site .fi
dice throwing game for nokia 5800
touchy feely stopwatch free download
الخدع السحرية للموبايل 5800
symbian anna stop watch
the nokia 5800 magic trick
Скачать бесплатно open gl на нокиа 5228
nokia belle stopwatch
nokia x6-00 processor
symbian dice 3d
bullet physics dice
тест сенсора на нокиа 5800
http //www.creabros.fi/?id=29
touchy feely stopwatch 2.0 rar
stopwatch symbian
lbchron1 02 sisx
bazi baraye nokia 5800
creabors
stop watch on a nokia express music
beli casio di solo jawa
bug 5800 xpress
site fi inurl .php?id= paypal
games for nokia 5800 musicxpress
site .fi inurl php?id=
nokia c6-01 stopwatch
touchy feely stopwatch
creabros oy settings
ip 216.172.188.219 id=
ovi stopwatch
download stopwatch nokia anna
nokia express music 5800 stopwatch app download
stop watch for symbian anna
nokia x7 sensortest
stopwatch download for nokia 5800
touchy feely cronometro symbian
скачать touchy feely stopwatch
nokia 5800 xpress stoper
ovi/stopwatch
bullet physics symbian
nokia 5800 touchy feely stopwatch
download stopwatch nokia xpress
inurl ?id=59
creabros oy настройки
download stop watch for c7
game dice roll n8
nokia 500 ibeer free
egroupware nokia 5800
bullet physics for symbian
nokia 5800 dice game download
touchy feely stopwatch 2.0
free download of stop watch for nokia 5800 xpressmusic xpressm
stopwatch from ovi
a box of dice 3
symbian belle stopwatch
touchy feely stopwatch nokia n8 belle signed
nokia xpress 5800 roll dice game
nokia 5800 sensor
stopwatch 1.02 for nokia 5800 xpress music
unable to execute file on 5800
www.skiroller.fi/index.php?id=44
touchy feely stopwatch symbian
box of dice 3d symbian
ip 216.172.188.219 php?id
touchy feely stopwatch 2.0 free

Kalle Kuismanen

Random,

Comment

---

Window Phone Coding

706 days ago

I’ve been coding using Cordova to create a cross platform app for ordering Taxis. I’m currently porting to WP7. This was the first time I coded for Microsofts Silverlight. It is funny how difficult simple tasks can become when you don’t know your way around the basics.

Problem was rather simple. Two classes the MainPage and a custom Plugin needed to communicate. Reason for this was that I had to add a native map and native buttons, because my Openlayer based solution didn’t give a nice user experience.

Adding the map and buttons to xaml file were easy, but how can I communicate with the map and buttons from my plugin? As an after thought it was quite easy, but it took a long time to figure it out.

So two classes MainPage and MyPlugin. MainPage had three buttons, which raised click events. These events needed to be relayed to the Javascript functions. Javascript needed to attach buttons to specific functions after it loaded.

It turned out that nothing needed to be done for the MainPage, but it took some figuring out.

Implementation

Steps were:

  1. find control from the xaml.
  2. manipulate or attach event handler to the control
  3. listen to events from control

First problem how to find the control? After many tries and reading documentation it become obvious that the way to go was to access the App instance and work my way current ApplicationPage. Then use FindName to find the control I wanted to manipulate or listen. Easy enough.

var mypage = App.Current.RootVisual.Content; – wrong
var button = mypage.FindName("mybutton") as System.Windows.Controls.Button; – ok

problems

  1. App is not defined – fix: namespace of the App needed to be used
  2. Need to do some casting to get my page
  3. At run time I get exeption, because UI is in different thread than the Plugin

fixes

so to get mypage
var mypage = ((PhoneApplicationFrame)MyApp.App.Current.RootVisual).Content as MyApp.MainPage;

next line:
var button = mypage.FindName("mybutton") as System.Windows.Controls.Button;

is ok. But there is a big problem. At run time there is the exception mentioned earlier. We can’t call the methods on MainPage directly. To by pass this we need to use Dispatcher, which will invoke the call in the correct thread.

Call becomes
Deployment.Current.Dispatcher.BeginInvoke(() => {
var mypage = ((PhoneApplicationFrame)MyApp.App.Current.RootVisual).Content as MyApp.MainPage;
var button = mypage.FindName("mybutton") as System.Windows.Controls.Button;
button.Click += new RoutedEventHandler(this.fireEvent);
});

or we can use a delegate

add a member to our plugin

public delegate void ButtonEventDelegate(string str);

Now it is possible do the previous bit more neatly

Deployment.Current.Dispatcher.BeginInvoke(new ButtonEventDelegate(HandleButtonClick), argument_array);

HandleButtonClick is simple function that executes same stuff that is inside brackets in the first BeginInvoke command.

fireEvent function needs to be something like this
public void fireEvent(object sender, EventArgs e)
{
var button = sender as System.Windows.Controls.Button;
// sending message to Cordova i.e. Javascript
string[] strs = new string[1];
strs[0] = button.Name;
var args = new ScriptCallback("testFunction",strs);
InvokeCustomScript(args)
}

And that is pretty much all there is to it.

Kalle Kuismanen

Mobile, Random

Comment

---

« Older