Introduction to Android Development in Java Course

A few weeks ago I’ve published the specifications page of my latest additions to my training academy, the Android Development Course in Java. A 60+ hours of live-coding hands-on experience in the development of native applications on android using Java. The course will take you from the basics of the Android operating system and the architecture behind this brilliant piece of software to the level of a professional Android developer, while taking into consideration the best practices and tips-and-tricks of writing successful killer mobile applications, and publishing them on the Android market.

Android as the #1 operating system for smart handheld devices is being hacked by thousands around the world, over 350,000 applications are available today on the android market with around 35,000 new applications published monthly on the android market. You cannot miss such crazy market and stay behind the technology hype.

Training is available initially in Mansoura City and might be repeated again in several cities based on the requests received.

The course will cost you only EGP1000 and will start in mid-january 2012. If you are willing to register in this course, you must register in the registration form.

Impressions on Samsung Galaxy Tab 10.1 3G Edition

A few weeks ago, I purchased Samsung Galaxy Tab 10.1 3G edition from Vodafone Egypt for a relatively good price, the device is shipped with Android 3.1 Honeycomb with 16GB of storage and a very attractive white back.

There are many reviews on how the device looks and feels, so, I decided to wrap my opinion in a short note to everybody:

Pros:

  1. Lightweight, lighter and thinner than iPad2
  2. Very good battery life
  3. Vivid bright screen with superb resolution, far better than iPad2
  4. Smooth Operating system, much more attractive and flexible than iOS
  5. Supports Arabic (not sure if it’s a Samsung mod or stock feature)

Cons:

  1. Battery recharging issue through USB: You basically cannot charge the device through PC-connected USB, the travel adapter is needed to charge the device. Some claim that it charged through the USB but very slowly. Solved by replacing the kernel with Pershoot’s kerneland then do the following command from your computer
    adb shell echo 1 > /sys/class/power_supply/battery/force_usb_charging
  2. File transfer (MTP problem on Mac): File transfer is not smooth from PC/Mac to Android because the device doesn’t appear as a flash-disk as you might have expected. You need a special software that uses MTP (Media Transfer Protocol) to communicate with the tab’s internal storage and in my case I tried using (Android File Transfer) which never worked!
  3. Applications Quality on the android market: Well, that’s the main differentiation for Android, many applications exist for phones but only a few optimized for Honeycomb+, which makes it great for those interested in developing applications for Honeycomb, a lot of space still exist.
  4. Accessories availability in the market: I’ve been searching for any accessories for the tablet in the Egyptian market and in Dubai with complete failure, even the promised gifts (cover and USB adapter) from Vodafone never arrived
  5. A little bit slow sometimes: Solved by rooting and replacing the kernel with Pershoot’s kernel, Overclocked to 1.4GHz on-demand.

Conclusion

All in all, a great device and will definitely shine even more when more “useful” applications come up in the market. my 2 cents is that Google should allow non-free apps to be distributed in Egypt, it’s such a shame that a big company like Google is lagging years in respect to Apple in that particular area. Apple app store has been open in Egypt for years now for paid and free apps. Google, do you need an advice from Apple on how did they do that? ;)

Photo source

Introducing Redique

I’ve been working on a very simple project that allow processes or computers to communicate seamlessly using Redis as a backend. I love Redis because it’s very powerful, yet very simple to configure and use. Let’s first understand the motivation behind redique

The motivation is the need for a small, cool, json-based, super-fast RPC system between processes, that led me to build a tiny project on top of Redis database and I called it Redique

Redique is an implementation of a high-performance Async RPC/Task Queue system built on top of Redis datastructure store and JSON marshalling protocol.

You normally want to use redique when you need to publish tasks to a set of workers to process asynchronously and retrieve the result using a task_id, or when you want to distribute workload over multiple workers easily without going through the hassle of understanding how message buses work.

Getting Started

You need to install the package first using pip:

# pip install redique

Then you need to create a backend class that contains the actual logic you want implement over the transport

class Calculator(object):
    def add(self, x, y):
        return x + y
    def raiseError(self):
        raise Exception("An Error Happened!")

Then you need to create a queue consumer on your worker side:

import redique
calculator = Calculator()
queue = redique.RediQue("calculator")
queue.consume_loop(calculator)

The last statement will block forever consuming tasks as they arrive.

On the publisher machine you need to execute tasks remotely

import redique
queue = redique.RediQue("calculator")
task_id = queue.push_task("add", 1, 2)
print queue.get_task_state(task_id)
print queue.wait_task_result(task_id)

Another way to do that is to call execute_task that blocks till the result is returned

import redique
queue = redique.RediQue("calculator")
print queue.execute_task("add", 1, 2)

You can grab the source code from https://github.com/AhmedSoliman/redique

Use Virtualenv with IPython 0.11

If you are a Python hacker, most likely you will be using a virtualenv for your development environment, you are probably an iPython user. Unluckily, IPython doesn’t pick the virtualenv paths by default and you will have to tweak it a little bit to make it work. Basically, this a slightly tweaked version of this article but tailored for the recent version of IPython 0.11.

You simply need to drop this snippet of code into the iPython configuration directory as illustrated below so that IPython can add the virtualenv paths.

import site
from os import environ
from os.path import join
from sys import version_info

if 'VIRTUAL_ENV' in environ:
    virtual_env = join(environ.get('VIRTUAL_ENV'),
                       'lib',
                       'python%d.%d' % version_info[:2],
                       'site-packages')
    site.addsitedir(virtual_env)
    print 'Using Virtualenv =>', virtual_env
    del virtual_env
del site, environ, join, version_info

Drop that snippet into a file named “ipython_config.py” in the following path if you are using Mac OS X or Linux (tested on Ubuntu natty):

~/.ipython/profile_default/ipython_config.py

Happy Hacking!

My Startup Weekend Alex 2011 Experience

“An extraordinary experience with the top-notch geeks in the city and nearby cities” – That was my definition to this event “Startup Weekend” after participating a few months ago in SWCairo, I was pleased to launch Fakkarny and very excited to meet the top-notch geeks. That experience changed a lot in the way I think about startups, teamwork, rapid development, pitching ideas in front of investors, and managing geeks :) Continue reading →