Thursday, 22 December 2011

Save out put of cmd


dir /on /b >list.txt
The /on orders the lists by alphabetical name, the /b makes it only list the filename, and the /s includes subdirectories files in the list.

> card
can be used with any command which gives out put

Wednesday, 23 November 2011

how to install apk on emulator from cmd

Step 1. go to  location
Step 2. use command adb install.apk
Result :
C:\android-sdk_r12-windows\android-sdk-windows\platform-tools>adb install d:\ESF
ileExplorer.apk
79 KB/s (2246869 bytes in 27.734s)
        pkg: /data/local/tmp/ESFileExplorer.apk
Success

C:\android-sdk_r12-windows\android-sdk-windows\platform-tools>

Saturday, 22 October 2011

how to fire key event without keybord ( simulate keyboard using Robot)

Suppose you want to create a Virtual key board or want to fire key events Virtually from hard coding,This will heal you.
first of all focus that object for winch you want to fire key event.
eg you want to focus notepad,open it.

Runtime.getRuntime().exec("notepad");
Now create instance of Robot class.
Robot robot = new Robot();
now object of this class will help you to simulate keys.
see this example



import java.awt.AWTException;
import java.awt.Robot;
import java.awt.event.KeyEvent;


import java.io.IOException;

public class Robot1
{ 
    static int keyInput[] = 
    {
    KeyEvent.VK_H,
    KeyEvent.VK_I,
    KeyEvent.VK_SPACE,
    KeyEvent.VK_K,KeyEvent.VK_H ,KeyEvent.VK_A,KeyEvent.VK_L,KeyEvent.VK_I,KeyEvent.VK_D,
    KeyEvent.VK_ENTER,
      KeyEvent.VK_J, 
      KeyEvent.VK_A, 
      KeyEvent.VK_V, 
      KeyEvent.VK_A, 
      KeyEvent.VK_SPACE,
      KeyEvent.VK_P, 
      KeyEvent.VK_R, 
      KeyEvent.VK_O, 
      KeyEvent.VK_G, 
      KeyEvent.VK_R,
      KeyEvent.VK_A, 
      KeyEvent.VK_M,       
      KeyEvent.VK_SPACE, 
      KeyEvent.VK_F, 
      KeyEvent.VK_O, 
      KeyEvent.VK_R,
      KeyEvent.VK_M,      
      KeyEvent.VK_U, 
      KeyEvent.VK_L, 
      KeyEvent.VK_T,
      KeyEvent.VK_I,
      KeyEvent.VK_V,
      KeyEvent.VK_I,
      KeyEvent.VK_R,
      KeyEvent.VK_T,
      KeyEvent.VK_SPACE,  
      KeyEvent.VK_PERIOD,
      
    };


    public static void main(String[] args) throws AWTException,IOException 
    { 
    Runtime.getRuntime().exec("notepad");    
    Robot robot = new Robot(); 
    for (int i = 0; i < keyInput.length; i++)
   
    robot.keyPress(keyInput[i]);
    robot.delay(100); 
    }
    }
}