Monday, August 24, 2015

UML Training...

I know , the almighty has been testing me all through my professional life... Now there is a new dilemma that is haunting me everyday. This is should i make all my training materials online for others to access free of cost or not... i believe in free flow of knowledge... hence i have made all my Google play apps open source.... For me, it does not look good to earn money by sharing knowledge... knowledge should be free... that is why i like Google because they have democratized knowledge.... however, i have not picked up any skill other than software to support my family... and not only that i like sharing knowledge with others... hence the dilemma... but i can't stop listening to my heart... hence here goes another training material and its source code...

  i believe whoever is able to follow it, does not have to come to me... however, who does not follow and can pay a little bit, will surely come to me and make it a win-win situation... the supportive source code can be cloned from

Monday, July 20, 2015

Memory layout in C++ vis-a-vis Polymorphism and Padding bits

Monday, July 13, 2015

Android Graphics & Animation - a Bouncing Ball Game with source code

Note: For my live lecture of the training on Android Graphics & Animation, please have a look at

https://youtu.be/kRqsoApOr9U

https://youtu.be/Ji84HJ85FIQ

https://youtu.be/U8igPoyrUf8

Last week while conducting the summer training on Android & Java, one guy requested me to help develop an Android game. I thought the bouncing ball would be the perfect example through which we can show about Android graphics and animation. However, i would strongly suggest to use professionals Game engines like cocos-2d to develop real life Game apps.

This app is  simple yet will be able to clarify many things related to android graphics to the students. I have made this game opensource and one can clone the source code from the following link.
https://gitlab.com/som.mukhopadhyay/BouncingBall

Here is a screen recording of this app.





If this helps the Android learners, i would probably be the happiest guy.

Sunday, June 21, 2015

Memory Layout of Java Objects vis-a-vis Inheritance...

These two diagrams describe the memory layout of Java objects. This is with respect to inheritance and not from padding bits or alignment's point of view. To make it simple, i have omitted the methods from the Object class (the root class) in the VTBLE (also called method table). They will obviously occupy the first few indexes in each VTBLE in Java as all the classes are naturally derived from the Object class.




Sunday, May 31, 2015

Concurrent Programming Model in Android...

Note : Here are my two tutorials on Android Concurrency Model. Please have a look at these:
  1. https://youtu.be/zWdVVI7kH4E
  2. https://youtu.be/1J6iqKJgvDU
When an Android application is launched, the Android system creates a thread of execution for the application. This is known as the main thread. This is also known as the UI thread because all the android widgets used for this application run in the context of this main thread. Every UI thread will have its own looper by default which in association with a Message Queue is responsible for dispatching the user interface events to the appropriate widgets. This has been depicted in the following diagram:



We need to arrange our application components so that the UI thread always remains responsive.

Hence we cannot do a long running task like connecting to a network server and downloading a big file or doing a CRUD operation on a remote database in the main UI thread. if we do it then the long running task will block the UI thread and it will freeze the UI. Moreover, if the duration of this freezing of the UI thread is more than 5 seconds, we will get an "Application Not Responding" message which is not desirable. Hence we should do the long running task in a background UI thread.

Another important fact about Android is that the UI toolkit is not thread safe. Hence we cannot manipulate the UI thread from a background worker thread.

Thus there are simply two rules in Android application model vis-a-vis concurrency framework:

1. We should not block the UI thread
2. We should not manipulate the UI thread from a background thread.

Keeping in mind all these factors, there are mainly two ways of doing concurrent programming in Android:

1. Asynctask
2. Handler, Message & Runnable

This has been depicted in the following diagram.



Here are three different applications which show how we can write a concurrent program in Android and communicate to the main thread from a background thread.

You can browse/download the source code of these apps from here:

1. https://gitlab.com/som.mukhopadhyay/AsynctaskDownloadImage

2. https://gitlab.com/som.mukhopadhyay/DownloadImageWithRunnable

3. https://gitlab.com/som.mukhopadhyay/DownloadImageWithMessageHandler

The first has used an Asynctask, the second has used the function Activity.runOnUIThread and the third has used Handler & Message to achieve the same purpose.

Hopefully this will help you to understand the concurrent framework of Android.

Tuesday, February 3, 2015

How to create your own background for Google Docs



As i was making documents to share with my students using Google Docs, i wanted to create a background for all these documents. Hence i had to do the necessary research to achieve this. I would like to share it with you which may help the Google docs user.

Step I:

Load the background image to the google drive.

Step II:

Create a URL for this image. To do that first go to the sharing option of that image in google docs and make it publicly available. Then open the website

http://www.gdurl.com/ and copy the sharable link to this site to create a permalink.

Step III:

Open the website https://chrome.google.com/webstore/category/apps in chrome browser and search for Stylish extension.



And install this extension. It will add an icon on the right side of the address bar.

Step IV:

  • Open any google docs and click on the stylish icon.
  • Click the first link Find more styles for this site
  • You may search for Linen Background for Google Docs and click the link
  • Now open your Google docs and you will see a nice background
  • Click on the Stylish icon on the right hand side of the address bar and this time click “Manage installed styles”
  • Then in the right pane click the button edit.
  • Replace the background url with the permlink that you have got in step II. It will look something like the following
#docs-editor {
background: url(http://gdurl.com/lQ3I) !important;
}
.docs-title-inner {font-family: Georgia !important;}
.docs-menubar {height:28px !important;}

Step V:

Refresh the open google docs and enjoy the background you have just created.

Monday, January 26, 2015

The Designing of a Software System from scratch with the help of OOAD & UML - A Restaurant System