Why should developers blog?

If I make an statistical study out of my friends and colleges who are developers, I can barely can say 10% of them are blogging. Is blogging a nightmare, a time waster, a cheap-seat show where bloggers act like significant people for them? I don’t know. I have one prediction: They don’t like writing. These people are tech savvy, they are not like my mother who doesn’t know how to publish on Web. They have sufficient writing capabilities their readers won’t complain about. They have weekends off and most of them are single.

I started my Internet fanaticism with writing in 1996-97. But releasing my first personal took another 10 years to happen, just a few years ago in 2006. Since I started to blog technically in a more personal area, my life changed fast. I have met dozens of people regardless of geological distances, interchanged great amount of knowledge, made friends, found people who can challenge me and found jobs. Besides these benefits, I have other reasons to blog technically:

1. It’s natural: You have passion for technology

You don’t have to have a reason. This should be very natural. If you are passionate about technology, you are also passionate about the trends in tech. Blogging is the top of the game since 2002-2003. Regretting the fashions won’t make you a cooler person. Early adoption gives a better impression. Running a blog and not making money out of it gives me one obvious signal: I’m passionate about what I’m doing, this is not just a job to earn my life.

2. Self promotion

Isn’t it obvious? Nowadays if you are not on the Web, you are nowhere. You will at least have a personal space to introduce yourself to the world of networks. It’s good because you can find others who are interested in similar technologies and are passionate for similar concepts.

3. Self improvement

How could writing improve my own abilities? It’s usually being asked. Being socially active is the best thing to find more people who can challenge your existing capabilities. I understand you were the smartest of your family, you had great marks at high school, was a top student at college and now a superstar employee. But due to the existence of your blog, everyday you have replies back to you from smarter people around to remind you are still a beginner. This is a great opportunity to see there are no limits and you are never done.

On the other hand, your blog serves as a timeline which captures your interests, technical knowledge and other capabilities. You can easily review yourself by taking a look at your older posts.

4. Sharing Knowledge

And obviously, sharing knowledge has its factor. It’s common for others to struggle where you went down. You may like to share an exceptional bug, a trick to make things work, a newly released product, methodologies, stories, experiences and reviews.

Blogging makes you a better developer. More people you meet, the better person you will be. Physically there are many constraints but an online representation of yours will fasten things. And as a blogger, I want to get that as an RSS feed! Now there is one thing I’m curious about. Do you blog or not? Why or why not?

Maps Development on Android: Registering a Maps API key

Location based applications are  musts on mobile platforms. Android does not have maps natively but Google Maps team is providing an add-on that comes with Android SDK (at least 1.5). In this post, I’m not going to show you how to pop out maps on your little mobile screen, but underline the application signature details related with Maps API.

First of all in our to show map tiles properly, we need an API key. This is all because you are requesting from Google Data API and have to agree with the terms of service. I’m also sure that quote rules also apply.

Every Android application is signed with a signature of the publisher. While obtaining a key, you must provide the MD5 summary of your signature to Google, and Google activates possible transactions between Maps API and the application your signature signs. In order to complete these actions, you have to

  1. Obtain the MD5 summary of your signature. If you do not have a signature, you can use the default one.
  2. Sign up for an API key directly from Google by providing the hash of your signature.
  3. Use API key with map elements and generate a sample map view.

Obtaining an API key

You will have to use the keytool to obtain information about signatures. If you haven’t created one, Android SDK puts a default one in your ~/.android directory. In this tutorial, I’m going to show you how to register with this default signature. Open a terminal prompt and enter

$ keytool -list -keystore ~/.android/debug.keystore

It’s going to ask you the password of the keystore (debug.keystore). Default is “android”. If you receive a MalformedKeyringException, you are giving the wrong password. If everything works great, it will output a few lines of information including the hash. Please read the summary line and copy the hash.

Certificate fingerprint (MD5): E8:F4:F2:BF:03:F3:3A:3D:F3:52:19:9B:58:20:87:68

After obtaining the summary key, you can jump to the next level — signing up for an API key. Give the hash as input and register. Please note the API key Google has given to you.

Generating Maps on Android

Android SDK comes with two archives. First one is the android.jar which contains the standard platform libraries. And maps.jar which is a library dedicated to generation of maps. In the maps API, you will notice MapView. You can extend MapView to customize and add new features to show a custom map view. Or invoke the existing methods to perform simple operations like panning, zooming and adding overlays to show information on the default map. There are great tutorials about Android’s map view and controller on web, I simply didn’t want to copy-cat the existing. Google’s Hello, MapView is a place to start.

Multiple-Developer Cases

A signature can only be associated with a single API-key. What you are going to do if development is made across a team? You dont need to create different signatures for each developer and register them to use Data API one by one. Register a single signature and obtain a key. Then, distibute the signature among the developers – better add it to your version controlling system.

Redis: New Persistent Key-Value Store

Most recently, I’m working on Redis which is a key-value datastore with interesting characteristics. It’s ultra fast and has built in atomic operations to handle concurrent usage. Although everything lives in-memory, Redis syncs with hard disk time to time to serve as permanent storage. Most impressively, downloading Redis and making a working build doesn’t take more than a few minutes.

Redis explains itself as a non-volatile memcached with various in-built data structures. Instead of only key and string value pairs, you can have lists and sets as values. There are atomic pop/push operations to work on these structures and increment/decrement functionality to work on numeric values.

Several client libraries are available including Perl, Python, Erlang, C++, Ruby, Scala and PHP. To write a more meaningful post, I’d like to add lines from a simple Python script.

import redis

storage = redis.Redis()
storage.keys("a*")  # returns keys starting with a

storage.get("key1") # returns the value of "key1"
storage.set("key1", "hello world") # setting the value of "key1"
storage.delete("key1") # deletes the pair with key1.

# working on lists
storage.push('key2', 'This is the first value', tail=True)
storage.push('key2', 'This is the second value', tail=True)
print storage.pop('key2')

Most of these methods are ported to client libraries and are available in downloadable Redis archive.

Although Redis can not be distributed, it’s easy to set up a slave node to replicate the master. Since it syncs with hard-disk in certain intervals, there might be data-loss in possible system crashes. So, setting up a slave may decrease the risks. It’s also advised to use Redis on a central server and manage sharding in the application level.