findViewById in a fragment

Not quite as simple as it would seem. You can't use onCreate() method because it is called before onViewCreate(). However, you can used onViewCreate, because you inflate your view: hence you have access to it:

MVVM with Android

This is one of the best things I've seen about Android in a long time: MVVM architecture. Of course Android platfrom doesn't support it, but there is hope! RoboBinding. OK, the spec perhaps isn't the best, but the idea is great! Finally This is how simple it is with Android Studio:

Activity code:


OnClick in XML

This is a nice hack when it comes to Android code writing:

In the activity we can specify the method:

Logging information in Android Apps

Being a bit of a reliability freak, I really enjoy knowing what's going on in my app. How it moves from one line of code to the next. Verbose The word "verbose" literally means more words than necessary. This mode usually show how the program's flow control.

Debug Debugging has the next level in...

Adding Info Dialog to Android App

This is how simple adding a dialog is to Android:

Adding a background to a Drawing View

Hehehe, so yesterday I was trying to add a background to my DrawingView. It was ridiculous. I have no idea what the problem was. I was trying to various combinations of Bitmap, Drawable even ImageView. None worked. The goal was to add a background to a DrawingView. Although you can do it directly in the...

Sending data from Android to WCF with REST

As it turns out Android has no support for SOAP. There are some 3rd party libraries e.g. ksoap2-android, but in general Google hasn't shown any interest in supporting Microsoft's innovation. So for my back-end I was forced to use RESTful service. In Android there is a library called JSONObject which can be found in org.json.JSONObject....