Okt 19

Hi everyone,

I am happy to inform you about my new company I just founded.

I am now offering professional app development for Android and iOS, including cross-platform development using Titanium Mobile and HTML5 techniques and frameworks like Sencha Touch and jQuery mobile. By the way, I am still offering my RubyOnRails experiences for backend programming, etc.

So if you need support in some of these fields feel free to contact me on my website: www.racoonapps.de

Mai 16

Hi everyone,

today I had some time taking problems with the RSA implementation on Android. I was trying to do the following:

Encrypt a log file on my Android device with a RSA public key, copy the device to the server and on the server decrypt the log file with my RSA private key using a small Java-App.

So for testing I first encrypted and decrypted on my Android device using the generated key pair, then I encrypted and decrypted a String in my Java App using the same key pair. Worked nicely.
Then I tried to copy the encrypted file from the Android device and decrypt in on the server. Didn’t work. But why? I used the same key pair all the time, but always got an Exception:

javax.crypto.BadPaddingException: Blocktype mismatch: 0

Solution:

Afters some hours of trying, confirming that the key pairs are the same, using different options of saving the public key in the Android filesystem, etc. I finally found a post stating that Android is using the Bouncycastle Security provider. Bouncycastle’s default RSA implementation is: “RSA/None/NoPadding”, whereas Sun’s default security provider implementation is “RSA/None/PKCS1Padding”. So, no decryption possible when just using

Cipher.getInstance("RSA")

because of the different paddings used.

So for a solution I downloaded the bouncycastle Jar, added bounycastle as a Security provider to my Java App, and now use

Cipher.getInstance("RSA", "BC");

It works fine now.

Mrz 18

In part 2 of my tutorial (here is part 1) I’ll show you how to create offline maps using Mobile Atlas Creator and how to define min and max-zoom-levels in your app.

Mobile Atlas Creator is a cool open-source project, that allows you to use different map providers (OpenStreetMap, Google Maps, Bing Maps, Yahoo Maps, …), donwload these maps and export to different atlas formats. Have a look at their website (http://mobac.dnsalias.org/) and download the latest stable version.

Weiterlesen »

Mrz 17

In this and the following tutorials I will show you how to include a OpenStreetMap in your activity, create offline maps for OpenStreetMaps and how to define minimum and maximum Zoom Levels (because you surely don’t want to provide all zoom levels for offline mode).

Weiterlesen »

Mrz 16

Nachdem schon lange nichts mehr von mir zu hören war, hier endlich mal wieder ein Update.

Die Firma MEDLINQ GmbH in Hamburg-Bergedorf sucht einen Ruby & Rails-Entwickler für verschiedenste, interessante Projekte.

Bei Interesse könnt ihr euch gerne auf unserer Website www.medlinq.com -> Jobs (untere Anzeige) informieren und bewerben.

Viel Erfolg!

Dez 16

Bei einem Autocomplete Input-Feld mit JQuery (Autocomplete-Plugin von pengoworks.com), bei dem viele Elemente zurückgeliefert wurden, entstand eine Scrollbar in dem Resultate-Div. Das Problem: Ein Klick auf die Scrollbar im IE oder Opera klappte die gesamte Resultate-Liste zu, anscheinend auf Grund eines Javascript-Events blur() auf dem Input-Feld. Durch dieses Event wurde die Resultate-Liste geschlossen.

Mein Fix in jquery.autocomplete.js:

Weiterlesen »

Sep 29

Wir suchen zum 01.11. oder später für unsere schöne Wohnung in Paderborn-Wewer einen Nachmieter.
- 3Zi. Dachgeschoß-Wohnung, ca. 70qm, in Sackgasse gelegen
- Badezimmer mit Dusche u. Vollbad, Kellerraum, Autostellplatz
- großer überdachter Balkon über die ganze Hausbreite
- vor gerade 10 Monaten schön renoviert/tapeziert
- Laminat im Schlafzimmer/Büro, Parkett im Wohnzimmer, Fliesen in Flur und Bad

UPDATE:
Die Wohnung ist weg.

Jul 28

I’ve had a problem after the update of the nbandroid plugin for NetBeans. After updating the debugging mode neither in emulator, nor on real device, doesn’t work anymore.

To fix this, put the following lines in build-impl.xml in the debugging section. Just remove the old part and paste in the new:

<target depends="init,-debug-start-debuggee" if="netbeans.home" name="-debug-start-debugger">
      <androidproject1:nbjpdaconnect/>
  </target>
  <target depends="init,compile,-start-emulator,-wait-for-emulator,-install-app" name="-debug-start-debuggee">
      <exec executable="${adb}">
          <arg line="${android.target.device}"/>
          <arg value="shell"/>
          <arg value="am start -D -n ${main.component}/${main.class}"/>
      </exec>
      <getdebuggerport addressProperty="local.debug.port" app="${main.component}"/>
  </target>
  <target depends="init,compile,-debug-start-debuggee,-debug-start-debugger" description="Debug project in IDE." if="netbeans.home" name="debug"/>
  <target depends="init" if="netbeans.home" name="-debug-start-debugger-stepinto">
      <androidproject1:nbjpdastart stopclassname="${main.class}"/>
  </target>
  <target depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee" if="netbeans.home" name="debug-stepinto"/>
Jul 16

Unter den neuen Widgets die ich für die Vodafone Widget Runtime programmiert habe ist u.a. “Galaxy Lander”. Ein Spiel, das wahrscheinlich viele schon auf programmierbaren Taschenrechnern gespielt haben. Mehr Funktionaliät als damals gibt es auch nicht, nur etwas schönere Grafiken :-)

In 3 Levels kann der Spieler Versuchen seine Landefähre auf dem Mond, dem Mars oder dem Jupiter zu landen. Natürlich ist der Jupiter das schwerste Level, aber es ist möglich heile anzukommen! Mit der “Hoch”-Taste des Handys kann der Spieler die Raketen zünden und damit den Fall abbremsen, aber Achtung: Man hat keinen unendlichen Kerosinvorrat!
Viel Spaß macht auch der umgekehrte Spielmodus: “Wer macht den tiefsten Krater?”. Probiert’s mal aus!

Also viel Spaß beim Spielen, hier mal der Link auf die deutsche Version:
Galaxy Lander downloaden

Jun 24

This is part 2 of my Android mobile game series. I want to develop a game just like my Widget game for the Vodafone Widget Runtime: Space Janitor.

So, in the last part we created some parts of the UI the user sees when he starts the game.

Today we want to create a small part of the real “Game View”!
First, lets change the standard layout of the Android App. The layout file can be found in res/layout/main.xml.
The standard is a simple LinearLayout with a TextView, that currently just displays “Hello…” when you start the game.
Let’s remove this part and change it to:

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
 
    <GameView
    	android:id="@+id/game"
    	android:layout_width="fill_parent"
    	android:layout_height="fill_parent" />
 
    <RelativeLayout
	android:layout_width="fill_parent"
	android:layout_height="fill_parent">
	<TextView
		android:id="@+id/text"
		android:text="@string/space_janitor_info_text"
		android:visibility="visible"
		android:layout_height="wrap_content"
		android:layout_width="wrap_content"
		android:layout_centerInParent="true"
		android:gravity="center_horizontal"
		android:textColor="#88ffffff"
		android:textSize="24sp" />
    </RelativeLayout>
</FrameLayout>

First, we define a Game View that we can use later on to hold the game graphics. Second we defined a RelativeLayout that holds a TextView, we need this to display some infos later on.

Now let’s extend the code to use this views.

Create a new class called GameView in your App. The GameView extends SurfaceView and has to implement the SufaceHolder.Callback interface. Add the yet unimplemented methods and a constructor to fulfill the interface’s requirements.

public class GameView extends SurfaceView implements SurfaceHolder.Callback {
 
	public GameView(Context context, AttributeSet attrs) {
		super(context, attrs);
		// TODO Auto-generated constructor stub
	}
 
	public void surfaceChanged(SurfaceHolder holder, int format, int width,
			int height) {
		// TODO Auto-generated method stub
 
	}
 
	public void surfaceCreated(SurfaceHolder holder) {
		// TODO Auto-generated method stub
 
	}
 
	public void surfaceDestroyed(SurfaceHolder holder) {
		// TODO Auto-generated method stub
 
	}
}

The SurfaceView is designated to hold the game graphics. Via the SurfaceHolder.Callback we are informed about dimension changes, i.e. when the user switches to landscape mode.

In the Main View we now have to code a connection to the Game View, we’ll do this via an instance variable of GameView. Add a variable of the type “GameView” to your Activity.

public class SpaceJanitor extends Activity {
	private static final int MENU_START = 1;
	private GameView myGameView;
        ...
}

In our “onCreate”-method we have to initialize this variable and we would like to give the GameView the ability to display some info in the TextView we recently defined in our layout file, like “Game Over”, etc. So:

public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
 
   requestWindowFeature(Window.FEATURE_NO_TITLE);
   setContentView(R.layout.main);
   myGameView = (GameView) findViewById(R.id.game);
   myGameView.setTextView = (TextView) findViewById(R.id.text);
}

This implies that we have to add a method “setTextView” in the GameView class to save a reference on this TextView locally.

public void setTextView(TextView findViewById) {
		// TODO Auto-generated method stub	
	}

In the next part we will add a thread to handle graphic updates, user actions, etc. etc.