Where are the Windows registry files located in Windows 7 / 8 ?

The Windows Registry is the centralized configuration database for Windows NT and Windows 2000, as well as for applications. The Registry stores information about tuning parameters, device configuration, and user preferences.
On disk, the Windows Registry isn’t simply one large file but a set of discrete files called hives. Each hive contains a Registry tree, which has a key that serves as the root (i.e., starting point) of the tree. Subkeys and their values reside beneath the root.

Location of Windows registry files

The location of these registry hives are as follows:
HKEY_LOCAL_MACHINE \SYSTEM : \system32\config\system
HKEY_LOCAL_MACHINE \SAM : \system32\config\sam
HKEY_LOCAL_MACHINE \SECURITY : \system32\config\security
HKEY_LOCAL_MACHINE \SOFTWARE : \system32\config\software
HKEY_USERS \UserProfile :  \winnt\profiles\username
HKEY_USERS.DEFAULT : \system32\config\default
Some hives are volatile and don’t have associated files. The system creates and manages these hives entirely in memory; the hives are therefore temporary in nature. The system creates volatile hives every time the system boots. Examples are:
HKEY_LOCAL_MACHINE \HARDWARE : Volatile hive
HKEY_LOCAL_MACHINE \SYSTEM \Clone : Volatile hive
These files are database files, and only RegEdit, Regedit32 and the Kernel32 can read them. The primary tool in Windows 7 for working directly with the registry is Registry Editor. To access it, simply type Regedit in Start Menu Search Bar and hit Enter !

adb shell input keyevent

usage:  input [text|keyevent]
          input text <string>
          input keyevent <event_code>



Some possible values for event_code are:
--------------------------------------------------------------------------------------------------------------------------
0 -->  "KEYCODE_0"
1 -->  "KEYCODE_SOFT_LEFT"
2 -->  "KEYCODE_SOFT_RIGHT"
3 -->  "KEYCODE_HOME"
4 -->  "KEYCODE_BACK"
5 -->  "KEYCODE_CALL"
6 -->  "KEYCODE_ENDCALL"
7 -->  "KEYCODE_0"
8 -->  "KEYCODE_1"
9 -->  "KEYCODE_2"
10 -->  "KEYCODE_3"
11 -->  "KEYCODE_4"
12 -->  "KEYCODE_5"
13 -->  "KEYCODE_6"
14 -->  "KEYCODE_7"
15 -->  "KEYCODE_8"
16 -->  "KEYCODE_9"
17 -->  "KEYCODE_STAR"
18 -->  "KEYCODE_POUND"
19 -->  "KEYCODE_DPAD_UP"
20 -->  "KEYCODE_DPAD_DOWN"
21 -->  "KEYCODE_DPAD_LEFT"
22 -->  "KEYCODE_DPAD_RIGHT"
23 -->  "KEYCODE_DPAD_CENTER"
24 -->  "KEYCODE_VOLUME_UP"
25 -->  "KEYCODE_VOLUME_DOWN"
26 -->  "KEYCODE_POWER"
27 -->  "KEYCODE_CAMERA"
28 -->  "KEYCODE_CLEAR"
29 -->  "KEYCODE_A"
30 -->  "KEYCODE_B"
31 -->  "KEYCODE_C"
32 -->  "KEYCODE_D"
33 -->  "KEYCODE_E"
34 -->  "KEYCODE_F"
35 -->  "KEYCODE_G"
36 -->  "KEYCODE_H"
37 -->  "KEYCODE_I"
38 -->  "KEYCODE_J"
39 -->  "KEYCODE_K"
40 -->  "KEYCODE_L"
41 -->  "KEYCODE_M"
42 -->  "KEYCODE_N"
43 -->  "KEYCODE_O"
44 -->  "KEYCODE_P"
45 -->  "KEYCODE_Q"
46 -->  "KEYCODE_R"
47 -->  "KEYCODE_S"
48 -->  "KEYCODE_T"
49 -->  "KEYCODE_U"
50 -->  "KEYCODE_V"
51 -->  "KEYCODE_W"
52 -->  "KEYCODE_X"
53 -->  "KEYCODE_Y"
54 -->  "KEYCODE_Z"
55 -->  "KEYCODE_COMMA"
56 -->  "KEYCODE_PERIOD"
57 -->  "KEYCODE_ALT_LEFT"
58 -->  "KEYCODE_ALT_RIGHT"
59 -->  "KEYCODE_SHIFT_LEFT"
60 -->  "KEYCODE_SHIFT_RIGHT"
61 -->  "KEYCODE_TAB"
62 -->  "KEYCODE_SPACE"
63 -->  "KEYCODE_SYM"
64 -->  "KEYCODE_EXPLORER"
65 -->  "KEYCODE_ENVELOPE"
66 -->  "KEYCODE_ENTER"
67 -->  "KEYCODE_DEL"
68 -->  "KEYCODE_GRAVE"
69 -->  "KEYCODE_MINUS"
70 -->  "KEYCODE_EQUALS"
71 -->  "KEYCODE_LEFT_BRACKET"
72 -->  "KEYCODE_RIGHT_BRACKET"
73 -->  "KEYCODE_BACKSLASH"
74 -->  "KEYCODE_SEMICOLON"
75 -->  "KEYCODE_APOSTROPHE"
76 -->  "KEYCODE_SLASH"
77 -->  "KEYCODE_AT"
78 -->  "KEYCODE_NUM"
79 -->  "KEYCODE_HEADSETHOOK"
80 -->  "KEYCODE_FOCUS"
81 -->  "KEYCODE_PLUS"
82 -->  "KEYCODE_MENU"
83 -->  "KEYCODE_NOTIFICATION"
84 -->  "KEYCODE_SEARCH"
85 -->  "KEYCODE_MEDIA_PLAY_PAUSE"
86 -->  "KEYCODE_MEDIA_STOP"
87 -->  "KEYCODE_MEDIA_NEXT"
88 -->  "KEYCODE_MEDIA_PREVIOUS"
89 -->  "KEYCODE_MEDIA_REWIND"
90 -->  "KEYCODE_MEDIA_FAST_FORWARD"
91 -->  "KEYCODE_MUTE"
92 -->  "KEYCODE_PAGE_UP"
93 -->  "KEYCODE_PAGE_DOWN"
94 -->  "KEYCODE_PICTSYMBOLS"
...
122 -->  "KEYCODE_MOVE_HOME"
123 -->  "KEYCODE_MOVE_END"

Convert From APK to readable java source code in 3 easy steps

Android applications are packed inside a APK file, which is just a ZIP file containing among other things a compact Dalvik Executable (.dex) file.

First step is to extract the “classes.dex” file from the APK:
$ unzip program.apk classes.dex
Archive:  program.apk
  inflating: classes.dex

Now, we use the tool dex2jar to convert the classes.dex file to Java .class files:
$ bash dex2jar/dex2jar.sh ./classes.dex
version:0.0.7.8-SNAPSHOT
2 [main] INFO pxb.android.dex2jar.v3.Main - dex2jar ./classes.dex -> ./classes.dex.dex2jar.jar
Done.

From here we obtain the file “classes.dex.dex2jar.jar”, now we can use the java decompiler JD-GUI to extract the source code:
$ ./jd-gui classes.dex.dex2jar.jar
Now just go to “File -> Save all sources” and it will generate the zip file “classes.dex.dex2jar.src.zip” containing all the decompiled Java source code :)

How to Change Device Name / Bluetooth Device for Android devices.


Method : 1


we can change your device name using setName(String name) of BluetoothAdapter type.Following is the sample code:
private BluetoothAdapter bluetoothAdapter = null;
bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();

void ChangeDeviceName(){
 Log.i(LOG, "localdevicename : "+bluetoothAdapter.getName()+" localdeviceAddress : "+bluetoothAdapter.getAddress());
 bluetoothAdapter.setName("NewDeviceName");
 Log.i(LOG, "localdevicename : "+bluetoothAdapter.getName()+" localdeviceAddress : "+bluetoothAdapter.getAddress());
}


Method : 2

For some devices Method:1 won't work.  use system settings.
Settings.System.putString(context.getContentResolver(), “device_name”, “user name”);
 

What's dumpsys and what are its benefit

dumpsys is an android tool that runs on the device and dumps interesting information about the status of system services.
Obvious benefits:
  1. Possibility to easily get system information in a simple string representation.
  2. Possibility to use dumped CPU, RAM, Battery, storage stats for a pretty charts, which will allow you to check how your application affects the overall device!
What information can we retrieve from dumpsys shell command and how we can use it
If you run dumpsys you would see a ton of system information. But you can use only separate parts of this big dump.

To see all of the "subcommands" of dumpsys do:
$ adb shell dumpsys | grep "DUMP OF SERVICE"

DUMP OF SERVICE ABTPersistenceService:
DUMP OF SERVICE AtCmdFwd:
DUMP OF SERVICE CustomFrequencyManagerService:
DUMP OF SERVICE DirEncryptService:
DUMP OF SERVICE SEAMService:
DUMP OF SERVICE SecExternalDisplayService:
DUMP OF SERVICE SurfaceFlinger:
DUMP OF SERVICE TvoutService_C:
DUMP OF SERVICE accessibility:
DUMP OF SERVICE account:
DUMP OF SERVICE activity:
DUMP OF SERVICE alarm:
DUMP OF SERVICE android.security.keystore:  ... etc




Some Dumping example and output
1) Getting all possible battery statistic:
$~ adb shell dumpsys battery
You will get output:
Current Battery Service state:
AC powered: false
AC capacity: 500000
USB powered: true
status: 5
health: 2
present: true

How to get IMEI from adb shell

adb shell dumpsys iphonesubinfo

EX

$ adb shell dumpsys iphonesubinfo
Phone Subscriber Info:
   Phone Type = CDMA
   Device ID = 990000249631260

Adding a library/JAR to an Eclipse Android project

Adding third-party libraries via the "User Library" mechanism in Build Path.




However, for Android, whose Dalvik "JVM" cannot handle an ordinary Java-compiled class, but must have it converted to a special format. This does not happen when you add a library in the way to do it.This will not work.

Instead, follow the (widely available) instructions for importing the third-party library, then adding it using Build Path (which makes it known to Eclipse for compilation purposes). Here is the step-by-step:
  1. Download the library to your host development system.
  2. Create a new folder, usr_libs, in your Eclipse/Android project.
  3. Right-click usr_libs and choose Import -> General -> File System, then Next, Browse in the filesystem to find the library's parent directory (i.e.: where you downloaded it to).
  4. Click OK, then click the directory name (not the checkbox) in the left pane, then check the relevant JAR in the right pane. This puts the library into your project (physically).
  5. Right-click on your project, choose Build Path -> Configure Build Path, then click the Libraries tab, then Add JARs..., navigate to your new JAR in the usr_libs directory and add it. (This, incidentally, is the moment at which your new JAR is converted for use on Android.)

What you've done here accomplishes two things:

  1. Includes a Dalvik-converted JAR in your Android project.
  2. Makes Java definitions available to Eclipse in order to find the third-party classes when developing (that is, compiling) your project's source code.