To instantiate a dynamic counter and its counter elements that are not defined in an XML file, you need to use the default counter constructor. Following is an example:
Counter counter = new Counter(); counter.setIncreaseMaxLimit(1000f); counter.setTotalMaxLimit(10000f); counter.setIncreaseTimesMaxLimit(100);
You can also initiate the same counter as previous through the following constructor:
Counter counter=new Counter(1000f,10000f,100);