How do I see gradle tasks run by Android Studio? - android

I'm following the course "Developing Android Apps" on udacity.
I have a problem on Lesson4A with the test suite (TestUtilities) complaining "Task 'cleanTest' not found in root project 'Sunshine'.
And then it points me to run with --stacktrace option.
But I don't know how I can run the command on the terminal in the first place.
How can I see what gradle-tasks that android studio is running?
Thanks :)

At the bottom right corner of Android Studio you have different views:
Gradle console
Event Log
Additionally, if your Gradle is running, will appear a 3rd one where you can see a progress bar with some information about the process. But if you want a full details use the 2 first views.

I believe you have not do the configuration at first, as the default configuration is not appropriate for this project.
Select Edit Configurations next to Run button on toolbar
Make a testing configuration, by click the + button and select Android Test.
Make sure you choose "Show Chooser dialog" in target device section if you are using Virtual devise like Genymotion
Hit OK and press the run button.
PS. Make sure your have this configuration under Android Test, and nothing under JUnit dropdown.
I was confused at first, but not anymore after I tried above steps from Udacity notes.

Related

Android Profiler not appeared in Android Studio

I want to analyze memory consumption in my device but I didn't find Android profiler tab in Android Studio as seen below :
Please who could help me to show up this tab.
If you take a look at top menu you will see a profile icon click it and it will start your app with profile attached. See the below screenshot to get the idea.
The perfect tip for Android Studio:
When you need to find something, write it in the help tab, like this:
If you know what you're looking for, you will find it there :)
I have faced this problem too. Here is the solution. You have to enable Android Facet for specific project. Go to File → Project Structure and the select 'Facets'. Click on the + button and Add 'Android'. In Choose Module pop up select your project and Click 'OK' and then click 'Apply'
You can now find Profiler tab in bottom menu and also from View -> Tool Windows
The Profile option won't show up in tab until we build and run latest code of our branch.
Just run again and Profile option would show up.

I have downloaded a android project. I want to run project in android studio, seeing followng screen

When I click on run
when I click run, it can't run
To run the project, you have to create a virtual device. As you are new to this, I recommend you to use a real device connected via USB cable. Refer this for help. Feel free to comment if you are getting troubles.
Update
Click the plus button in the second screenshot you have provided.
Select "Android App"
Type "app" in Name box.
Apply

Debugging API in browser and Android app in emulator same time on one Visual Studio

I have Xamarin project based on ASP.NET Web API which is my 2nd sub-project in the same solution. I couldnt find similar problem anywhere so I think that sadly I have to run two Visual Studios which would like to to avoid.
What I want to accomplish is to debug API and android app in same time in one Visual Studio window. Is it even possible?
Example of manual test:
1. Android button click sends request to api.
2. API business logic has break point to check it.
3. Android app gets data from the API.
You can have multiple startup projects in Visual Studio. Here's how to do it in Visual Studio 2015 (from MSDN):
In the Solution Explorer, select the solution (the very top node). Right-click the node to get the context menu.
Select Properties. The Solution Property Pages dialog box opens.
Expand the Common Properties node, and click Startup Project.
Click Multiple Startup Projects and set the appropriate actions. For more information, see NIB How to: Modify Project Properties and Configuration Settings.
You can also start debugging the Android app normally and launch the Web API project later on by right clicking it on the Solution Explorer and clicking Debug > Start New Instance.

How to make Android Studio automatically suggest code fixes

When using Android Studio, I want to be able to just put the mouse cursor on top of a code word with a compiler error and get a drop down list with fix suggestions. Right now in order to open that list, I must press ALT + ENTER. How can I make Android Studio to open the list automatically when the coursor is above the error line?
In your Android Studio go to:
Settings > Editor > Code Completion and check in 'Autopopup code completion'
You might check as well the other options in the tab - e.g. delay in ms.
It seems that there was an update to the Android Studio and this feature was added. You need to play with the error line a bit (sometimes there's a need to press it a few times) and then you'll get the option to view code fixes.

Intellij "Run as Android application" missing

The emulator android is really running slowy, and I found Genymotion and runs really fast! And when I tried to use with Intellij, after I followed every step from this doc https://cloud.genymotion.com/page/doc/, I got stuck in this item:
In your application project, right click and chose "Run as Android
application" The "Android Devices Chooser" opens Click on the
Genymotion virtual device you started/created
I really can't find "Run as Android application" whenever I click on my folder project, where I'm missing?
Look at this image, I really don't know why.
http://i42.tinypic.com/2ia76rl.png
In IntelliJ inside the Run/Debug Configuration dialog (available under Edit configurations...) you have to select radiobutton "Show chooser dialog" instead of Emulator.
Then you just press Run and you get the list of running devices.
If you select "Use same device for future launches" in the configuration dialog, you won't have to select the device again next time.
Check the toolbar of Intellij. There is a drop down menu (next to it are the "play" button and the "bug" button to start the debugger). You need to setup an Android configuration for your project first.
Check this site
http://www.jetbrains.com/idea/webhelp/creating-and-editing-run-debug-configurations.html.
Although I have a configuration for my project, like you I can't see it in the menu your screenshot is showing. But I can use the mentioned run button to run my project without any problem.
Good luck.
On your screenshot you have a "Run" item on the options. Look at what appears when you let your mouse over it ;-)

Categories

Resources