I want to coe covergae of my test case which used SingleLaunchActivity in android

public class MyActivityTest extends SingleLauncgActivtiy<MyMainProjectClassName> {

public MyActivityTest () {
super("com.hilti.android.plt.measure_and_record", MainMeasureAndRecordActivity.class);


2 answers

1 accepted

1 vote
Answer accepted

Hi, here's some tutorial describing how to turn on experimental code coverage for Android platform. However keep in mind that Android OS is not officially supported.

Hi Grzegorz, the link you have provided is not understandable. Can you please share any example android code or example working script? 

Please help me out on this below questions..

How to generate instrumented Java classes of Android app from code? 

How it will generate the Clover.db file? and how to built the apk with the instrumented classes? 

Please help me out on this, Thank you!! Really appreciate your efforts !! 


Hello, here you have example code and tutorial how to integrate Ant or Maven with Clover. Regarding Java instrumentation, you can read about it in any of the following tutorials (depending which integration you'd like to use):

Proper source code instrumentation will generate clover.db which you can use. In order to build apk archive from instrumented sources, you need to follow any other typical build procedure. The only difference will be that you need to use instrumented sources, not the original ones.

Hi @Grzegorz Lewandowski, I am looking for specific android example code?

If you have such code, can you please paste the link for the code? 

Thank you so much!!

I am trying through command promt

C:\Temp>java -Dclover.license.path=C:\Path\clover.license -cp C:\Temp\clover-run
time.jar com.cenqua.clover.CloverInstr ...
Error: Could not find or load main class com.cenqua.clover.CloverInstr

getting highlight error ..

I have db as well as their content.

Now from the command line i have to genrate report.

Can you please tell me the process.

I have clover.db + some file generated their.



Hi, you're trying to invoke CloverInstr main class but most probably it's not in the classpath. Please, make sure clover.jar is in the classpath of that java invocation. Please take a look at this Oracle tutorial how to achieve it. 


My claspath of jave is 

C:\Program Files\Java\jdk1.7.0_45

so inside their is lib folder

I paste my colver .jar their 

After that i ran my command prompt

C:\Temp>java -Dclover.license.path=C:\Path\clover.license -cp C:\Temp\clover-run

Usage: java [-options] class [args...]
(to execute a class)
or java [-options] -jar jarfile [args...]
(to execute a jar file)
where options include:
-d32 use a 32-bit data model if available
-d64 use a 64-bit data model if available
-server to select the "server" VM
The default VM is server.

-cp <class search path of directories and zip/jar files>
-classpath <class search path of directories and zip/jar files>
A ; separated list of directories, JAR archives,
and ZIP archives to search for class files.
set a system property
enable verbose output
-version print product version and exit
Warning: this feature is deprecated and will be removed
in a future release.
require the specified version to run
-showversion print product version and continue
-jre-restrict-search | -no-jre-restrict-search
Warning: this feature is deprecated and will be removed
in a future release.
include/exclude user private JREs in the version search
-? -help print this help message
-X print help on non-standard options
enable assertions with specified granularity
disable assertions with specified granularity
-esa | -enablesystemassertions
enable system assertions
-dsa | -disablesystemassertions
disable system assertions
load native agent library <libname>, e.g. -agentlib:hprof
see also, -agentlib:jdwp=help and -agentlib:hprof=help
load native agent library by full pathname
load Java programming language agent, see java.lang.instrument

show splash screen with specified image
See http://www.oracle.com/technetwork/java/javase/documentation/index.html for m
ore details.

C:\Temp>time.jar com.cenqua.clover.CloverInstr ...


I am getting above error.


Can u please elaborate in step by step


Thanks u so much for guding

It not working at all .

I have a android project in eclipse which have a test class like below

public class MainMeasureAndRecordActivityTest extends SingleLaunchActivityTestCase<MainMeasureAndRecordActivity> {

private static MainMeasureAndRecordActivity activity;
private long projectId;
private ContentResolver contentResolver;
private long jobId;
private long projectUUID;
private Station station;
private long stationId;
MainMeasureAndRecordActivity activity2=new MainMeasureAndRecordActivity();

public MainMeasureAndRecordActivityTest() {
super("com.hilti.android.plt.measure_and_record", MainMeasureAndRecordActivity.class);


Error I am geeting SingleLaunchActivityTestCase not defined.I have to show my client at any cost.


Can you please help me out.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Wednesday in Opsgenie

Getting the Most out of Atlassian and Opsgenie Together

We’re excited to invite you to this action-packed webinar where we will demonstrate how to integrate Opsgenie’s powerful alerting and on-call management tools with your entire Atlassian stack. Mar...

48 views 0 0
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you