Shuhei Kagawa

How to set up and top up a prepaid SIM in Germany

Oct 3, 2016

I have moved to Berlin from Tokyo a week ago. I may or may not write about it later, but I'm going to share more practical stuff today.

Since I arrived in Germany, I bought two prepaid SIM cards and set up a SIM-free iPhone and a MiFi (mobile WiFi router). It was harder than I thought because I had never used a prepaid SIM before and most of official instructions were in German. I'd like to share what I did for people like me.

This post is a complement to Germany | Prepaid Data SIM Card Wiki | Fandom powered by Wikia. If you haven't read it yet, read it first.

Initial setup

After reading the wiki, I chose O2 as a network provider because of its rate and availability in Berlin's subway.

  1. Go to a large electronics store like Saturn.
  2. Find an O2 prepaid SIM.
  3. Bring it to an O2 representative in the store and ask her to activate it.
  4. Go to the casher and pay for the SIM card.
  5. Insert the SIM card into your phone/MiFi. You can ask shop staffs to open SIM card slot.
  6. Unlock the SIM card. PIN is on the white card that contains the SIM card. Also its phone number (Rufnummer) is on the same card.

Topping up

You can top up your SIM via a call, O2 mobile app or O2 website. I used O2 website because I couldn't make a call with my MiFi and I don't have German AppStore's account. The website is only in German. So it's convenient to use Google Chrome's translation feature.

  1. Go to a drug store chain like dm and buy one of O2 top-up cards like €20. They are usually put next to other prepaid cards like Apple, Google Play, Amazon, Zalando, etc. The actual top-up code is printed on your receipt. Or you can buy a top-up code online at Thanks, Yan Yankowski for letting me know!
  2. Sign up for O2 website.
  3. Enter your phone number (Mobilfunknummer), preliminary password (Vorläufiges Kennwort) and new password (Neues Kennwort). The preliminary password is notified via SMS. If it's for your MiFi, you can access to the MiFi's admin page and read SMS.
  4. Go to Recharge tab (Mein O2 -> Mein Prepaid -> Guthaben & Aufladen) and enter your top-up card's code.
  5. (Optional) Choose your favorite plan (Tarif & SIM-Karte).

Draw animated chart on React Native

Jul 18, 2016 - JavaScript, React

At #4 on June 21th, 2016, I talked about drawing animated chart on React Native. The talk was about the things I learned through developing an tiny app, Compare. It's a super simple app to compare temperatures.

Before creating it, I had no idea about what temperatures on weather forecast, like 15 degrees Celsius, were actually like. I remember what yesterday was like, but not the numbers. Typical weather forecast apps shows only future temperatures without past records. Thanks to The Dark Sky Forecast API, the app fetches both of past records and future forecasts, and show them together.

Compare app

The app's source code is on GitHub:


There might have been some charting libraries to draw similar charts, but I like to write things from scratch. I like to reinvent the wheel especially when it's a side project. Thanks to that, I found a way to animate smooth paths with the Animated library.

If I have to add something to the slides:


The Best Part of Angular 2 Offline Compiler

Jun 3, 2016 - JavaScript, Angular 2

A couple of weeks ago, I gave a short talk about Angular offline compiler at ng-sake #3, which is a cozy meetup where Tokyo's Angular developers hang out drinking beer.

I won't write much about it here because it's still in its early stage and I couldn't make @angular/compiler-cli work without modification.

The only thing I want to stress here is that it enables us to statically type-check our templates with TypeScript, which is awesome. Templates have been one of the places where mistakes are made since Angular 1. Even if we introduce TypeScript or lint tools, we couldn't be able to detect mistakes in templates until they are evaluated at the runtime.

The steps would be the following:

  1. Angular 2 offline compiler compiles templates into TypeScript files with .ngfactory.ts extension.
  2. You prepare another bootstrap script that imports the root .ngfactory.ts and bootstraps your app with it.
  3. TypeScript compiler compiles the bootstrap script, other TypeScript files and .ngfactory.ts files into JavaScript.

The step 3 type-checks .ngfactory.ts, and detects typo and type errors in your templates if any. It is a great benefit in addition to skipping the runtime compilation and smaller library size. Looking forward to Angular 2 offline compiler's official release!