==== Profiling within Eclipse ====
 
==== Profiling within Eclipse ====
   −
Seems as this option is available for Linux users. Windows users report they don't have this option. I don't know about Mac. You need to install Android ADT plugin. See: [http://developer.android.com/sdk/eclipse-adt.html insallation page]. You also need your device connected to your computer.
+
Seems as this option is available for Linux users. Windows users report they don't have this option. I don't know about Mac. You need to install Android ADT plugin. See: [http://developer.android.com/sdk/eclipse-adt.html insallation page]. You also need your device connected to your computer and ''debuggable'' flag is set in AndroidManifest file.
   −
In Eclipse, make sure Devices view is visible. Select Window|Show View|Other|Android|Devices. In Devices view, on upper right, among other buttons you will see "Start Method Profiling" button. Select your application among list and click "Start Method Profiling" button. The button's appearance and text changes. Use your application for some time and click button again to finish profiling. ADT plugin automatically pulls trace file from device and starts Traceview application to display results.
+
In Eclipse, make sure ''Devices'' view is visible. Select Window|Show View|Other|Android|Devices. In ''Devices'' view, on upper right, among other buttons you will see "Start Method Profiling" button. Select your application among list and click "Start Method Profiling" button. The button's appearance and text changes. Use your application for some time and click button again to finish profiling. ADT plugin automatically pulls trace file from device and starts Traceview application to display results.
    
[[File:Eclipse_ADT_Devices_view.png]]
 
[[File:Eclipse_ADT_Devices_view.png]]
 
You can also profile your application without Eclipse. Android command line tools are enough for this. All these commands are in ''tools'' folder in Android SDK.
 
You can also profile your application without Eclipse. Android command line tools are enough for this. All these commands are in ''tools'' folder in Android SDK.
   −
Make sure your device is connected to your computer and your application is running.
+
Make sure your device is connected to your computer and your application is running and ''debuggable'' flag is set in AndroidManifest file..
    
The command to start profiling is:
 
The command to start profiling is:
 
==== Troubleshooting ====
 
==== Troubleshooting ====
   Unexpected non-MediaWiki exception encountered, of type "Error"
[a5b855af] /wiki/index.php?title=Profiling_Android_Applications&diff=431&oldid=230 Exception from line 436 of /zstore/backups/cn10/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php: Call to undefined function each()
Backtrace:
#0 /zstore/backups/cn10/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php(546): DiffEngine->diag(integer, integer, integer, integer, integer)
#1 /zstore/backups/cn10/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php(347): DiffEngine->compareSeq(integer, integer, integer, integer)
#2 /zstore/backups/cn10/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php(228): DiffEngine->diffLocal(array, array)
#3 /zstore/backups/cn10/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php(725): DiffEngine->diff(array, array)
#4 /zstore/backups/cn10/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php(864): Diff->__construct(array, array)
#5 /zstore/backups/cn10/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php(987): MappedDiff->__construct(array, array, array, array)
#6 /zstore/backups/cn10/home/ws10522/public_html/wiki/includes/diff/TableDiffFormatter.php(193): WordLevelDiff->__construct(array, array)
#7 /zstore/backups/cn10/home/ws10522/public_html/wiki/includes/diff/DiffFormatter.php(143): TableDiffFormatter->changed(array, array)
#8 /zstore/backups/cn10/home/ws10522/public_html/wiki/includes/diff/DiffFormatter.php(112): DiffFormatter->block(integer, integer, integer, integer, array)
#9 /zstore/backups/cn10/home/ws10522/public_html/wiki/includes/diff/DifferenceEngine.php(939): DiffFormatter->format(Diff)
#10 /zstore/backups/cn10/home/ws10522/public_html/wiki/includes/diff/DifferenceEngine.php(844): DifferenceEngine->textDiff(string, string)
#11 /zstore/backups/cn10/home/ws10522/public_html/wiki/includes/diff/DifferenceEngine.php(860): DifferenceEngine->{closure}()
#12 /zstore/backups/cn10/home/ws10522/public_html/wiki/includes/diff/DifferenceEngine.php(813): DifferenceEngine->generateTextDiffBody(string, string)
#13 /zstore/backups/cn10/home/ws10522/public_html/wiki/includes/diff/DifferenceEngine.php(743): DifferenceEngine->generateContentDiffBody(WikitextContent, WikitextContent)
#14 /zstore/backups/cn10/home/ws10522/public_html/wiki/includes/diff/DifferenceEngine.php(665): DifferenceEngine->getDiffBody()
#15 /zstore/backups/cn10/home/ws10522/public_html/wiki/includes/diff/DifferenceEngine.php(635): DifferenceEngine->getDiff(string, string, string)
#16 /zstore/backups/cn10/home/ws10522/public_html/wiki/includes/diff/DifferenceEngine.php(443): DifferenceEngine->showDiff(string, string, string)
#17 /zstore/backups/cn10/home/ws10522/public_html/wiki/includes/Article.php(826): DifferenceEngine->showDiffPage(boolean)
#18 /zstore/backups/cn10/home/ws10522/public_html/wiki/includes/Article.php(549): Article->showDiffPage()
#19 /zstore/backups/cn10/home/ws10522/public_html/wiki/includes/actions/ViewAction.php(44): Article->view()
#20 /zstore/backups/cn10/home/ws10522/public_html/wiki/includes/Wiki.php(487): ViewAction->show()
#21 /zstore/backups/cn10/home/ws10522/public_html/wiki/includes/Wiki.php(285): MediaWiki->performAction(Article, Title)
#22 /zstore/backups/cn10/home/ws10522/public_html/wiki/includes/Wiki.php(647): MediaWiki->performRequest()
#23 /zstore/backups/cn10/home/ws10522/public_html/wiki/includes/Wiki.php(506): MediaWiki->main()
#24 /zstore/backups/cn10/home/ws10522/public_html/wiki/index.php(48): MediaWiki->run()
#25 {main}