Tuesday, December 16, 2014

Java Performance - List adding and element in ArrayList and Linkedist

hi,
Today i will be sharing performance result for adding element in ArrayList and LinkedList.

Code:
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

public class ListPerformance {
static int size = 1000000;

public static void main(String[] args) {
long startTime = System.currentTimeMillis();
List<String> arrList = new ArrayList<String>();
for (int i = 0; i < size; i++) {
arrList.add("" + i);
}
long endTime = System.currentTimeMillis();
System.out
.println("Total Time Taken to insert element in ArrayList is "
+ (endTime - startTime) + " ms");

startTime = System.currentTimeMillis();
List<String> linkedList = new LinkedList<String>();
for (int i = 0; i < size; i++) {
linkedList.add("" + i);
}
endTime = System.currentTimeMillis();
System.out
.println("Total Time Taken to insert element in LinkedList is"
+ (endTime - startTime) + " ms");
}

}


Output:
Total Time Taken to insert element in ArrayList is 186 ms

Total Time Taken to insert element in LinkedList is 621 ms

Note: Test was conducted in 1000K element with default Heap

So it is clear ArrayList is faster in adding element.







Saturday, September 6, 2014

How to earn revenue from android app

hi folks,
i will share my suggestion , how you can revenue from android app. There are 2 ways to earn revenue from android app
1) Paid App
2) Free App with Advertisement.

if you are newbie in android market and you publish  and android app as paid it will be difficult that people will buy it, so it will not be easy to start in paid, you need to first create your user base,later on you can go for paids app.

as a newbie,i suggest you should go for apps with advertisement, quality app will rise faster in download in will give revenue from ads.

in my next blogs, i will suggest with ads network to integrate with your app for revenue.