Android Monitor- Monitors not working - android-studio

I have a problem with android monitors (CPU,GPU, ... )
I use Genymotion and no run. Monitors do nothing.
I have enabled adb integration.
But not run.
why?

I finded the problem.
in the second "menu" I need find your pacage. for scanning cpu/gpu..
on the screen upper I have red title No debbugable. and here i need find pacage my running app.

Related

Can't find stop button in Android Studio to stop the emulator

I don't know how to stop the emulator. Apparently, there's supposed to be a stop button but it's not there?
You can close the running Emulator by clicking the x button at the top of the Emulator tab (see image below)
Print a list of your devices:
adb devices
Kill it using emu
adb -s emulator-5432 emu kill
You can close the Emulator by clicking the X button at the top of emulator window. I found this answer on another stack overflow thread. There they've provided a complete explanation along with the original documentation. If you want you can check out that answer here
I know of no other way than the command line, as #Tian said. Closing the emulator window has no effect as far as I know...
To add more explanation:
open a terminal window (either the AS one or any other, as long as adb commands are available)
list the running connected devices with: adb devices
identify your emulator in the resulting list (usually in the form of: emulator-5556 device)
now kill the emulator with: adb -s emulator-5556 emu kill (replace the name of your own emulator in the command of course)
You'll see a confirmation message like OK: killing emulator, bye bye
enter code here
no stop button in bumblebee I also failed to find a way to stop it pressing the power button for long shows options lockdown poweroff and restart which in my case didnt work checked avd location lock file was created so finally killed it through taskmanager by ending qemu task

Android Studio emulator rotates weird

I've just begun (today) learning how to code for Android. I have my first basic app up and running, but when I rotate the emulator, it goes into this really weird view. I don't know how to explain it, so I'll just attach a screenshot:
As you can see, half of the screen is rotated one direction, and half of the screen is rotated another direction. Only one side of the screen can be interacted with -- the other side is "dead" and doesn't respond to anything.
Looks like it's a bug with Android Studio 4.1 + Big Sur:
https://developer.android.com/studio/known-issues
The suggested fixes both work (copying here for posterity):
Go to the Apple Menu, select System Preferences > General. In the
Prefer tabs when opening documents option, select "never". Then
restart Android Studio.
Upgrade to Android Studio 4.2, currently available in the Beta channel.

GestureDetector OnTap Delay on Android Studio / Flutter / Nexus 6 API 30

Think about extremly simple flutter application that contains one Container widget on the screen and GestureDetector on it.
main goes to myApp, main and myApp widgets are in the same dart file.
myApp goes to HomePage which is a different dart file.
HomePage has one Container and GestureDetector widgets.
GestureDetector's onTap function is : print('pressed');
"pressed" appears for the first time when container tapped. The problem is when I tapped for several times on this container. "pressed" appears after a delay. Sometimes I see it after compilers' message.
uid=10153(com.example.vocabulary_master_8) 1.ui identical 4 lines
Here is my flutter doctor -v finding.
[!] Android Studio (version 4.1.0)
• Android Studio at C:\Program Files\Android\Android Studio
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
After I upgrade Android Studio to 4.1.2 and Nexus 6 API 30, I started to get this error and delay.
Could you please somebody help?
Best regards.
Try printing with an integer variable that gets incremented every time you press the icon. Prints the way you want.
GestureDetector(
child: Icon(Icons.person,color: Colors.black54,),
onTap: (){
i = i+1;
print("clicked person:$i");},
behavior: HitTestBehavior.translucent
),
Firstly you should install the Dart plugin as dectected by flutter doctor.
Coming to your issue, there can be many reasons for the delay :
I guess you are running it in debug mode on an emulator, the performance in debug mode will be slow and laggy compared to release mode. To test the app in release mode, use a real device instead of an emulator and instead of flutter run, use flutter run --release.
print statement might sometimes get delayed. Instead of trying to print something try updating your UI on tap. And as seen in the above scenario, as you are tapping several times, you are forcing the debugger to print the same statement multiple times, hence in case of flutter, it check if the print statements are same or not, if they are same, it will combine all of them and print an output like this :
uid=10153(com.example.vocabulary_master_8) 1.ui identical 4 lines
after a certian delay.
So in short you code is working fine, the delay is caused because flutter takes some time to recognize and combine the similar print statements.
Yes, I also had GestureDetector is little slower in my emmulator.. I am not sure why... If you need just a Tap function then try with InkWell or Listener for better performance...

Hide taskbar on then second monitor when using fullscreen in Android Studio

As I said in the title, when I enter full-screen mode in Android Studio (or other JetBrains IDEs) the taskbar on the second monitor will be shown while in the main monitor it will hide.
How can I get the same behavior on the second monitor? I'm using Windows 10.
If I'm getting you correctly .. and after checking linked tickets on JetBrains Issue Tracker ... it's not possible:
IDEA-129034 and perhaps IDEA-164559-- watch these tickets (star/vote/comment) to get notified on any progress. Right now it does not look like these tickets are on devs "to do soon" list.

How can I change the default preview device in Android Studio?

When I'm creating a new project, the default preview device appears as Nexus 4. Is there a way to change it to some other device?
Recently I had the same issue.
It seems that you cannot use a device from the "virtual device" category. That way only the selected layout will be shown inside the chosen device.
In order to change the default device for all layouts you have to choose from some of the other categories (the ones inside the red rectangle):
I have chosen "6.0 1440 x 2560" from "Phone" and all my other layouts changed to this device (before I was selecting "Nexus6_API_29_Android" which was my virtual device, and I had to change it on every layout manually)
Same issue was appearing for me, when I was selecting device for preview from 'Virtual Device'.
To select device which will be default for preview when opening activities choose from these in picture, which are marked in red rectangles.
Change the preview device>>for example: nexus5x or others.
File--Export Setting, then choose a dictionary to save it. For example, I save it on my desktop, next you will see a settings.jar on your desktop.
File-Import Setting, choose the settings.jar.
Android Studio will want to restart itself, click OK
My English is very poor. I'm so sorry.
Maybe it works well. I'm not sure. You can try it.
The top answer covers most cases.
But if you want to use a custom made device you can also click on the Generic Phones and Tablets option, and choose your device from there.
You just need to follow few steps to do this
Step One
Open Any layout file from
App >> res >> layout directory
Step Two
go to the above red marking option
Then you will find the available devices for change
N.B. I am using Android Studio 3.6.2
Go to Run -> Edit Configurations. "Under Deployment Target Options", de-select "Use same device for future launches."
To prevent the same device from being used on subsequent previews, when you create a new project and run it in the AVD, do not select "use the same device."

Resources