Wednesday, September 9, 2015

Android Code Coverage (Instrumentation)

1. Add Instrumentation File

2. Add Entry to AndroidManifest.xml

<instrumentation android:name=".EmmaInstrumentation" android:targetPackage=""></instrumentation>

This tag should be added above to the activity Tag.


3. Compile

  1. ant clean
  2. ant instrument

4. Install

  1. ant installi

5. Launch Instrumented Application

adb shell am instrument -e coverage true  -w <application_package>/.EmmaInstrumentation
Now execute the test scenarios and press back until you exit the app.

6. Generate HTML

  1. Make a new folder for test report generation say report.
  2. Open command prompt in this directory report.
  3. Copy coverage.em file from /bin to the current folder
  4. Pull the coverage.ec file from the device using command adb pull /mnt/sdcard/coverage.ec .
  5. Copy emma.jar from the location /tools/lib to the current location.
  6. To genarate the coverage report type the following commandjava -cp emma.jar emma report -r html -in coverage.ec -sp /src -in coverage.em
Note:
  1. Every time a new version of code is available, all the steps needs to be executed again, except for copying emma.jar from the sdk folder.
  2. for consecutive executions, first the old coverage.ec needs to be removed from /mnt/sdcard.

Monday, September 7, 2015

Pretty Simple Encryption/Decryption Tool

AES Tool(256 Bits) - Encrypt / Decrypt Text
    
Text to encrypt/decrypt:
Password:
Encrypted text:
Decrypted text: