Mining Energy-Greedy API Usage Patterns in Android Apps: an Empirical Study - MSR 2014 Online Appendix

This web page is a companion to our MSR 2014 paper entitled "Mining Energy-Greedy API Usage Patterns in Android Apps: an Empirical Study".

1. Data

Android apps

The list is available here in html version or as a CSV file

Wifi Radar girsas.wifiradar TOOLS 1.06
AndRecorder Free com.andrconstruction.andrecord MUSIC_AND_AUDIO 3
Livo Recorder Lite com.mp1.livolite MEDIA_AND_VIDEO 3.7.0.a
news|swipe com.segvic.news_swipe NEWS_AND_MAGAZINES 1.0.0
SimpleNews com.prss.simplenews NEWS_AND_MAGAZINES 1.4
Android Music Player MUSIC_AND_AUDIO 4.0.4b3
AudioPlayer com.bytemystery.audioplayer MUSIC_AND_AUDIO 1.2
Meridian Media Player Revolute org.iii.romulus.meridian MEDIA_AND_VIDEO 2.4.5
10,000 Quotes DB (FREE!) com.hmobile.quotesmegacollection BOOKS_AND_REFERENCE 3.0.4
Inspiring Quotes com.xstudio.inspiringquotes LIFESTYLE 1.2
25000 Best Quotes ENTERTAINMENT 1.0.7
Anime Radio Online free.animeradioonline.gutisoft MUSIC_AND_AUDIO 1.06
Classical Music Radio Lite com.rslclasslite MUSIC_AND_AUDIO 1.0.3
Write Now Notepad com.aerodroid.writenow PRODUCTIVITY 1.1.5
Better Notepad org.strive.notes BUSINESS 0.0.5
Droid Notepad com.williamkingdom.droidnotepad PRODUCTIVITY 1.11
Battery Info Always TOOLS 1.2.0
Battery HD TOOLS 1.16
Battery Info com.zgame.batteryinfo TOOLS 1.6
Simple Weather NEWS_AND_MAGAZINES 1.1.3
Dr.Web Antivirus Light com.drweb TOOLS Varies with device
Android Antivirus com.lab4apps.antivirus TOOLS 2.0.1
Antivirus Free com.antivirus COMMUNICATION Varies with device
Better Browser com.browser.sogood.ui TOOLS 2.3
Opera Mini web browser COMMUNICATION 7.5.3
Easy Birthday Reminders com.tencentapps.bdays TOOLS 1.2.1
gReminders com.diegoyarza.greminders TOOLS 0.9.7
Droid Wifi Analyzer com.kastorsoft.wifidroid TOOLS 1.3
Battery Drainer com.batterydrainer TOOLS 1.4.0
Icey Slot com.jbiz.iceyslotz CARDS 2.9
Activity Express Task Manager com.sayhello2theworld.te TOOLS 1.22
Advanced Task Manager mobi.infolife.taskmanager PRODUCTIVITY 2.1.2
5001 Amazing Facts Free com.ximad.wff_lite BOOKS_AND_REFERENCE 3.2.0
Oxford AZ of English Usage com.mobisystems.msdict.embedded.wireless.oxford.azenglishusage BOOKS_AND_REFERENCE 4.3.059
Botanica me.botanica BOOKS_AND_REFERENCE 1
Sleep Sound Aid com.arcdroid.sleep HEALTH_AND_FITNESS 20121007
Anti Mosquito Sonic Repellent com.zodinplex.antimosquito HEALTH_AND_FITNESS
Anti dog mosquito whistle TOOLS 1.3
Punjab Radio MEDIA_AND_VIDEO 1.0.4
Galaxy Torch com.swijaya.galaxytorch TOOLS 1.4
World Travel Guide by Triposo TRAVEL_AND_LOCAL 2.1
Rome hu.pocketguide.bundle.Rome_lite TRAVEL_AND_LOCAL 10-Jul-13
Video Poker CARDS 1.2.1
8,500+ Drink Recipes com.webworks.drinkscocktails ENTERTAINMENT 1.0.6
MasterCard ATM Hunter com.orbiscom.ATMHunter FINANCE 1.4
AnEq Equalizer Free MUSIC_AND_AUDIO 1.0.9
aTimer com.r4ph4.timer TOOLS 1.3
Textgram codeadore.textgram PRODUCTIVITY 2.3.15
Bubble blast 2 BRAIN 1.0.34
Despicable me (minion rush) CASUAL 1.1.0
Star Wars Angry birds ARCADE 1.3.0
Map quest TRAVEL_AND_LOCAL 1.8.1
Sniper shooter ARCADE 1.6.0
Arcane legends ARCADE

Scenarios and Scripts:

The scenarios we defined for testing the apps are here, and the corresponding monkey-player scripts can be downloaded here. For more details about how to used monkey-recorder and monkey-player for Android apps visit this link

2. Patterns Identification

Patterns extraction

The format of the files and the way to execute each one of the programs is detailed as in the following. All the files have a header. Also we considered the methods in the execution traces at the first two nesting levels.

Files and formats

  • Aligned traces (.call): Each line is for an API call extracted from the execution traces. The call are ordered by entry time and then by thread id. The format is <method qualified name>,<thread id>,<entry time(usecs)>,<exit time(usecs)>,< energy(J)>. A zip file containing the aligned traces for each app execution can be downloaded here
  • Patterns: Each line is for a sequence of API calls with a specific size. The format is <APIs sequence>,<# instances of the sequence>,<average (energy consumption)>,<median (energy consumption)>,<max (energy consumption)>,<min (energy consumption)>. A zip file containing sequences with length 1, 2, and 3 can be downloaded here
  • Signatures (.sig): Each file represents a class in an application, and each line in a file is the fingerprint (More details on the paper) of each method declared in the class. The file format is <method qualified name>,< method fingerprint> *
  • Patterns location (.loc): Each file contains the links from the patterns to the source code. The file format is the following: <pattern>,<app_path_folder>,<class_qualified_name>,<method_name>*

* We do not provide those files because the apps are not open source.


  • PatternsIdentifier.jar: PatternsLocator.jar: A zip containing the jar and the libs can be downloaded here. The command line for executing the program is:

    java -Xmx20G -jar PatternsIdentifier.jar <path_to_aligned_traces_folder> <initial_length> <final_length>

  • SignaturesGenerator.jar: It requires a set if libs for generating the AST from methods. A zip containing the jar and the libs can be downloaded here. The command line for executing the program is:

    java -Xmx20G -cp SignaturesGenerator.jar:<path_to_libs_folder>/* edu.wm.cs.semeru.apicex_fprint.Main <path_to_folder_with_apps_source_code> <path_to_libs> <output_folder>

  • PatternsLocator.jar: A zip containing the jar and the libs can be downloaded here. The command line for executing the program is:

    java -Xmx20G -jar PatternsLocator.jar <path_to_patterns_folder> <path_to_fingerprints_folder> <output_folder> 1

  • *We used the -Xmx20G argument to avoid heap-memory exceptions.

3. Results

  • RQ1-Which are the most energy-greedy Android API methods? Individual API calls and categorization according to the grounded theory process: CSV
  • RQ2-Which sequences of Android API calls are the most energy-greedy? Patterns with length 2 and 3, and categorization according to the grounded theory process: CSV

4. Interesting patterns

1. Usage example of the pattern <Activity.setContentView(int); Activity.findViewById(int); View.setVisibility(int)> in a Tools app.

2. Example of Activity.findViewById(int) misuse in a birthday reminder app.

3. Multiple uses of SQLiteDatabase.execSQL(String) in an Education app.

4. Usage example of the pattern <SQLiteOpenHelper.getWritableDatabase(); SQLiteOpenHelper.getReadableDatabase()> in a Productivity app.

5. Usage example of <ConnectivityManager.getNetworkInfo(int); ConnectivityManager.getNetworkInfo(int);NetworkInfo.isConnected()> in a News and Magazines app.

6.Usage example of the pattern <ProgressBar.setProgress(int); ProgressBar.setProgress(int)> in a Casual app.

7. Usage example of the pattern <Toast.makeText(Context,CharSequence,int);> in a web browser.

5. Additional tools

  • Android SDK: contains the Activity Manager Profiler, Android Debugger Bridge, and dmtracedump tools
  • Monsoon Power monitor: for measuring energy consumption of battery-based devices. To disable the USB charging in the Nexus 4 during the energy measurement we modified the following file /sys/module/pm8921_charger/parameters/disabled, which is on the Nexus 4 filesystem.
  • Apktool: required for modifying manifest files in APK files. We followed the procedure explained here
  • Money recorder: for recording and executing test scripts
  • Dex2jar: for getting jar files from APK files
  • Procyon Java decompiler: for getting source code from JAR files


  • Mario Linares-Vásquez - The College of William and Mary, VA, USA.
    E-mail: mlinarev at cs dot wm dot edu
  • Gabriele Bavota - University of Sannio, Benevento, Italy.
    Email: gbavota at unisannio dot it
  • Carlos Bernal-Cárdenas - Universidad Nacional de Colombia, Bogotá, Colombia
    Email: cebernalc at unal dot edu dot co
  • Rocco Oliveto - University of Molise, Pesche (IS), Italy.
    E-mail: rocco.oliveto at unimol dot it
  • Massimiliano Di Penta - University of Sannio, Benevento, Italy.
    Email: dipenta at unisannio dot it
  • Denys Poshyvanyk - The College of William and Mary.
    E-mail: denys at cs dot wm dot edu