Android Studio USB Debugging Phone Display Error - android

I started using the USB debugging mode on Android Studio and when i run my project the display on the phone is completely wrong. The ide displays the correct way i want it to look but when i open the app on the phone the app's displayed contents are all thrown into the top of the screen. Why is it doing this? Sorry for huge picture btw.

It seems that you are using ConstraintLayout, but you haven't set any vertical constraints for your views. Therefore, when you run the app, all the views are jumping to the top. Click on the red exclamation mark, it will show you the same thing. Go to the code view, it will also show you the same error.

You should use minimum 2 constraints from top or bottom nd start or end
It will help you views to attach each other

Related

How to disable this feature in Android Studio 4.1

I tried turning off Code lens but this wont turn off, How do i get rid of this feature its
quite annoying.
steps to reproduce
Press the combination Alt+Shift+R on any code block to refactor it and create a method
This window appears on top or bottom based on scrolling position
*note that the class was approx 1000 lines
Restarting Android Studio gets rid of this for once but it appears again next time I run above steps.
attaching screenshot for ref (check the top area)
Please uncheck the code lens. it might be helpful for you.

Drag/Drop feature in Android is really snappy

I am having trouble using android studio's drag and drop feature. I have no problem getting the items onto the preview mode of the android phone, but when I want to move the palettes, I can't seem to be able to place them where I want. A lot of times I will place let's say a TextView, and it will snap to a different location an inch away. Anyone know if any solutions?
Unless you know a way to un-snappy the editor, it's time to get to know the XML Text Editor, next tab over in Android Studio.
The way I get round the snappy side is in there: use the "android:layout_below="#+id/example" and it's brethren. Unless you have a massive amount of elements, this is very doable.

Android Studio Android DDMS display issue

I'm using Android Studio 0.7 and while i normally find it quite pleasant to work with, its logcat support is intermittent at best. Now i've somehow gotten myself into a bit of an interface conundrum. Something i did inadvertently with the Android DDMS window at the bottom has meant that "Devices" and "logcat", which are normally in a two-paned window together (e.g. "Devices | logcat"), have become separate. As a result i can no longer view the filter box and the logcat output without switching panes, which as you can imagine is a real PAIN! (pun unintended but welcomed)
Here are some screenshots - at the top you see two shots of the two panes in their current separated form in v0.7, and below you see what it normally looks like (from v0.8). It's like i've somehow lost the whole header for the individual panes...
I've looked at all the buttons nearby, looked through all the settings, and googled as best i can, and i just can't figure it out. Can anybody help me? At the moment i can only hope that google fixes their developer L preview so i can actually start using 0.8 but who knows how long that will be....
In Intellij IDEA 13.1.5 for Mac, press Fn in keyboard, drag 'Devices' window to 'logcat' window, done!
Click and drag the part I highlighted in Red. When it becomes a separate box, just close it by clicking on the X on the top right.

How can I stop the LogCat output from scrolling automatically in Eclipse?

UPDATE: This turned out to be a bug in R14 of the SDK tools. It has been fixed in R15 which was released on Oct/27/2013. Updating to the latest release solves the problem as suggested in the accepted answer.
I use the LogCat window in the Debug view in Eclipse to diagnose and fix crashes in my code. I've noticed that the LogCat output will automatically scroll down anytime new lines are added (but only after you scroll to the bottom yourself).
This is great if I'm waiting for an exception stacktrace to come up, but extremely annoying if I'm trying to read something in the log and more lines are continuing to be added at the bottom (it keeps jumping to the bottom, so I scroll back to the error, then it jumps to the bottom again).
Is there any way to make it stay where I've placed it, when I place it, but continue to scroll automatically when I reach the bottom?
EDIT: Please note, I'm aware of filters and I don't consider this a solution to the problem.
ANOTHER EDIT: If I scroll up "far enough" from the bottom, it stops scrolling automatically. Far enough might be 5 lines or it might be 500 lines, it seems to be related to how many lines are in the log. Ideally, it would stop scrolling as long as I was at least 1 line away from the bottom.
In the LogCat tab on the upper far right there is a down pointing arrow with a line under it to enable
"Scroll Lock"
On older versions it's a pause button to
"Pause receiving new logcat messages"
That should do the trick!
update to the latest version. the new logcat automatically filters your logs into the app-specific crash logs when you build-launch your app via eclipse.
I stopped having problems disable the option: Automatically enable / disable scroll lock based on the scrollbar position.
Window> Preferences> Android> Logcat> uncheck the option above.
In my case, I'm using Eclipse + Android Developer Tools (Build: v22.6.2-1085508)
I suggest that if I want to use eclipse, download the full package from this link:
http://developer.android.com/sdk/index.html
After downloading, download all available updates, less NDK.
That's not what happens to me. If I scroll up it won't scroll down automatically when new lines come to the logcat until I scroll it to the bottom.
Maybe it's because of the Eclipse or the Android SDK version. I'm using the latest right now.
You can do adb logcat in a shell, and use your terminal app's scroll buffer and scrolling features to manage the logcat output.
Window => Preferences => Android => Logcat
Uncheck the box called:
Display logcat view when there are messages from
an application into the workspace
If you're only debugging crashes, click on the red (E) (error) filter for your main logcat, and keep your filter tab set to default to view all lines that are being reported by your application.
What ends up happening, when your application crashes it stays closed unless requested to restart by your choosing. So, the last lines in the logcat will be the crash report. This is one of the ways of how I debug crashes.
I also think it is "more aggressive" since the latest update! And it actually stops auto-scrolling when I scroll 10 or more lines up.
The best solution I have is clicking in the line you are interested in. If the logcat scrolls down too far and you don't see your line any more just press ArrowUp or ArrowDown to jump back to the line you were looking at.
If you write pid:pidofyourapp (which is written under online column in Device tab) in the search box,it will show the logs you wrote in your application.

Graphical Layout Scroll Problem in Eclipse Android Development

I am trying to develop an android application. I've put a scroll view as main container using graphical layout in eclipse. After that, I had put some UI elements, like buttons. When the total height of elements become more than viewable area, it can be seen using scroll view as expected. There is no problem until this point. The problem is the elements that are not fit viewable are of the screen can not be seen using graphical container of the eclipse interface. There is no problem with the source code, as it runs expectedly. Is there any option in the Eclipse gui to see the UI elements that are not fit the viewport?
I know what you're talking about. When you're viewing the xml file on the Eclipse Graphical layout you can only see the elements that fit on the screen. You can't scroll down to see the entire UI.
I use Eclipse at home and work. I'm using Eclipse Helios Service Release 1, on both systems. For some reason at home, when I'm on the graphical layout, there's a button on the upper right of the graphical viewer that says something like 'Remove Clipping'. (I'm at work now. So can't look to see exactly what it says).
When I click that button, I can now scroll down to see the entire UI. However, on my copy of Eclipse at work that same button isn't displayed. I've tried to figure out what the difference is between the setup on the two copies of Eclipse. But so far haven't been able to figure it out. Note, I've tried viewing the same exact xml file, within the same project, on both copies of Eclipse.
The problem seems to only occur when you're using a scrollview and all the ui elements won't fit on the graphical layout screen within Eclipse.
I have the same problem. I've been unable to troubleshoot, so I've resorted to using my physical device instead. I try to get the bulk of work done within the the Eclipse GUI... then nudge and polish with my device. Its a PITA to be sure, uploading what seems like a million times only to move one element a tiny bit more.
Best practices recommend developing on a device. Further, the Layout-tools && scrollView basically make it mandatory to really know what is going on. I can't seem to form this into a coherent search argument as my Google-fu has let me down on this one.
BTW - I'm using the shiny new r10 ADT plugin and I've been struggling with this for about 6 months.
Another workaround: You can use a smaller-ish tablet port in the GUI to get a really rough idea of what you are working with.
If your target layout is for a phone or smaller device, simply switch the preview to a larger screen size configuration.
In the upper left corner, under where it says 'Editing config: ~default', The list provides you with a number of screen sizes to target. Pick the 10.1 in version, and it will scale the preview, and will then allow you to see and work with all of the views that have scrolled off the screen.
Cheers-
I think this is an old topic but I was having the same issue. I have 2 apps made from outsourcing. when I opened each in eclipse one would show the full contents of the scrollview and one was clipped off. After numerous google searches nothing came up as a solution. I just happen to look and saw the app that is clipped was android version 1.6 and the app that shows everything like i wanted it to so I can use the graphical layout for a scrollview was android verion 2.1.
So i changed the one app to version 2.1 and it fixed it. noone seemed to address that. so for me the fix was make sure the android version you are building for is 2.1. you can always change it back to 1.6 compatable after you are done designing.
Hope this helps
The best way i could figure out is to give negetive top margin to the root layout that will make the rest of the content visible. This is only for dev purpose and should be removed when completed

Categories

Resources