Pages

Friday, September 26, 2014

Note(s) to SELF


My Random Thoughts























Wisdom of Work

I was going to write about technical topic. I was half way through and suddenly something touched my mind and I hold backspace till I get complete white background again. The topic I want to discuss here is about business acumen. More specifically work we are doing every day. The 8 hours which we are spending to make our next 16 hours bright and pleasurable. Let’s think about what you did yesterday. What has exactly it added to one’s life for whom you worked?

It’s very important to know what we are going to give to the end user from our daily struggling 8 hours or may vary positively typically in IT field. You know, engineers always like to come up with formula for any topic. And as being one of them, let me derive a formula on this:

Successful Work = Value added to End User / Effort spent

It’s very important to understand the formulae. The success of any work is proportional to the value it has added to the end user.  Some people usually do their work just for shake of completing it. Very few realize why they are spending their valuable time for output that no one wants. Many times, it’s attitude that changes human mind. And this attitude depends on many factors. Let’s take an example. You have been assigned the work and you know from the beginning that it won’t be finished within the time assigned. Actually that makes our mind to complete the stuff anyhow. At that time, we don’t care what we are doing. Our aim is just to complete what has been asked for. My point of taking this example is to prove that it’s not just the one who is doing the work, is responsible for bad work but there is hierarchy. The supervisor is also responsible who has assigned the work which is not at all feasible in the time line. The manager is also equally responsible who has promised to the client. And same thing applies to client also, in turn left him with what he never wanted. Actually this is everyone’s responsibility and should be taken care from top to bottom level.

Think through your heart once!!! :)

Thursday, January 5, 2012

Intercept HOME Key: Android


How to Intercept HOME Key in Android?


The solution is:

The prevailing wisdom says it cannot be done

public static final int KEYCODE_HOME
Key code constant: Home key. This key is handled by the framework and is never delivered to applications.
Maybe the below code would work the way we want it to. But I don't think you can trap the Home key absolutely.


Below method works for me. Hope this will work for you also....

Override below method in your activity.

    @Override
    public void onAttachedToWindow() {
        super.onAttachedToWindow();
        this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD);           
    }



After overriding above method, now you can easily listen HOME Key press in your activity using onKeyDown() method.

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {     

        if(keyCode == KeyEvent.KEYCODE_HOME)
        {
           //The Code Want to Perform. 
        }
    });
 
 
 
 
Cheers....... 

Tuesday, December 27, 2011

QT: Connect to SOAP Webservice

Hello Friends,

Here, I hereby trying to show an example for How to send SOAP Post request through QT?.
To create a Qt client application that connects to a SOAP/WSDL web service, I have used QT 4.7


XML packet:


<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <GetFullDetails xmlns="http://core-1.doubleu.mobi/MecaniqueWS">
    </GetFullDetails>
  </soap:Body>
</soap:Envelope>
 
QString XMLData = <Your XML Packet> 
MyClass obj; 
QString returnData =  obj.httpcall(XMLData);
 

Tuesday, December 20, 2011

Android: Apply Image Share on your own app

Here I am representing the code, through which user can send image which is stored in File storage or taken from camera to any remote server. To do that I wanted to add the application to the list of the choices which appear when an user click on the “share” button when view an image using the default Gallery application.

I had added couple of tags to Androidmanifest.xml and it was done....


< ?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
   package="com.fipl.app.unlock" android:versionCode="1"
   android:versionName="1.0">
   <application android:icon="@drawable/icon" android:label="@string/app_name"
      android:debuggable="true">
      <activity android:name=".MainActivity" android:label="@string/app_name"
         android:theme="@android:style/Theme.NoTitleBar"
         android:screenOrientation="landscape">
         <intent -filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
         </intent>
      </activity>

      <activity android:name=".MainActivity" android:label="@string/app_name"
         android:theme="@android:style/Theme.NoTitleBar"
         android:screenOrientation="landscape" android:icon="@drawable/icon">
         <intent -filter>
            <action android:name="android.intent.action.SEND" />
            <category android:name="android.intent.category.DEFAULT" />
            <data android:mimeType="image/*" />
         </intent>
      </activity>

      <activity android:name=".MainActivity" android:label="@string/app_name"
         android:theme="@android:style/Theme.NoTitleBar"
         android:screenOrientation="landscape" android:icon="@drawable/icon">
         <intent -filter>
            <action android:name="android.intent.action.CHOOSER" />
            <category android:name="android.intent.category.DEFAULT" />
            <data android:mimeType="image/*" />
         </intent>
      </activity>
   </application>
   <uses -sdk android:minSdkVersion="8" />
   <uses -permission android:name="android.permission.CAMERA" />
   <uses -permission android:name="android.permission.INTERNET" />
   <uses -permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
</manifest>
Main functionality performed by two actions 1.android.intent.action.SEND and 2. android.intent.action.CHOOSER.In application when user will select sharing list a new activity will be launched and intent has been sent to get the image which has to be shared.

intent.getAction().equals( Intent.ACTION_SEND )
Below is the screenshot when user select "share" button