Office Hours — Today, January 13

Thursday, January 8

Jan 13
8:50 AM
Mark M.
has entered the room
Mark M.
turned on guest access
8:55 AM
DanDroid
has entered the room
Mark M.
hello, DanDroid!
how can I help you today?
DanDroid
good morning mark
a few questions
Mark M.
go ahead with your first one
9:00 AM
DanDroid
I am having a very hard time with the graphical editor in android studio. elements snap instead of smoothly allowing me to widgets in place. is there a way to disable snapping?
Mark M.
I think so -- hold on a moment...
DanDroid
ok thanks
Mark M.
what container class are you trying to drag into?
the drag-and-drop behavior varies by container
so, for example, LinearLayout is going to limit you to dropping a widget after the preceding one, and perhaps setting the gravity
DanDroid
well i have a relativelayout and i have an edittext field and a button below that. when i try to place the button precisely below the edittext field, it snaps to the field instead of allowing me to move it smoothly in a precise manner.
Mark M.
RelativeLayout does not give me a snap-to-grid sort of effect, though drag-and-drop with RelativeLayout is wonky in general (as it was in Eclipse)
well, that's kinda the point of RelativeLayout
you're usually attaching widgets to other widgets, or to the RelativeLayout itself
9:05 AM
Mark M.
it *can* add margins, but you will have some difficulty doing so for small margin values
as the "magnets" that control that snapping effect are relatively strong
I don't think there's anything that you can do about that
DanDroid
ok
i think i get what you are saying. ill revisit this if i have major issues in the future
next quesiton
Mark M.
go right ahead -- if somebody else joins the chat, though, I'll want to give them a shot
DanDroid
in the logcat, most of the time it does not scroll continuously with messages, but sometimes it does. is it normal to have it scroll messages consinuously? it does this with the same app i am testing with a real device. sometimes with this app it scrolls continuously and sometimes it does not.
Mark M.
I am not completely clear on what you mean
it should scroll to bottom automatically, unless you have manually scrolled up
whether new messages show up depends upon whether they match the filter
and I have had filter problems on Android Studio
so sometimes I wind up having to switch off the automatically-created app-specific filter and switch to just filtering on severity in order to find my messages
DanDroid
no no i meant messages keep appearing in the logcat window they dont stop. is that normal
9:10 AM
Mark M.
if the scroll thumb is at the bottom, and new messages come in that match the filter, they should automatically show up
DanDroid
most of the time once i run the app and the messages stop once i stop interacting with the screen
Mark M.
LogCat is a "transcript"-style UI
well, again, that depends on the messages and the filters
if you have no filters provided, and you are debugging on hardware, you should see a fairly steady stream of messages, as Android is rather chatty
even the emulator should give you a fair bit of noise
but if you have filters applied, messages only show up if they match the filter
DanDroid
sometimes I dont get a stead stream of messages for the same app i am testing on a real device
Mark M.
what filter do you have set up? or do you not have a filter?
DanDroid
i dont have any filters set up
i dont think i do
Mark M.
are you sure? an app-specific filter is automatically applied when Studio runs your app
DanDroid
i dont remember setting up a filter though
Mark M.
that will be the drop-down, just above the transcript itself, in the toolbar on the right side
if it says something like "app: xxx.yyy.zzz", where xxx.yyy.zzz is your application ID, then it is filtering to be just your app's messages
DanDroid
oh. no i did not do that i guess its set to display all messages
Mark M.
Android Studio *automatically* flips to an app-specific filter when you run the app
you have to manually remove the filter to see all messages
DanDroid
its set to verbose
Mark M.
so, if you have not done any of that, you are only seeing messages from your app
look to the right
after verbose, there is a "search" field, then a drop-down
what is in the drop-down?
DanDroid
ya the app selected
Mark M.
more accurately, what is the current selection in the drop-down?
right
DanDroid
is*
9:15 AM
Mark M.
so you are only seeing the messages from your app
toggle that to "No Filters" to get the full unfiltered feed
DanDroid
ok but why does it sometimes show a steady stream of message while at other times it does not for the same app im running on a real device
Mark M.
I have had some problems with the app-specific filter not working, and no messages showing up
DanDroid
i have observed that too
Mark M.
it happens occasionally, and I have not figured out how to reliably reproduce the effect, to file a bug report
the only thing I have been able to do there is to switch to "No Filters", and perhaps only show error severity
DanDroid
but why does it stead streamed sometimes and not others for the same app
show*
Mark M.
the bug is a per-run bug
sometimes it works, sometimes it does not
it does not have anything to do with your specific app, AFAICT
DanDroid
ok
last question
sorry if im hogging chat
Mark M.
nobody else is here right now, so go right ahead
9:20 AM
DanDroid
View paste
so I want to display a list of bus stop information that includes arrival time predictions. Each list will display the bus number, arrival time and the the time to arrive in minutes.  The listview will be placed within a realivate layout container for "view_stop_info.xml" layout file. how do I referrence this with the listadapter in the java code?
Mark M.
"how do I reference this" -- I do not know what "this" is
DanDroid
or is that the right way to do it?
Mark M.
is "this" the ListView?
DanDroid
yes
Mark M.
are you using ListActivity/ListFragment, or just a regular Activity/Fragment, for showing this layout?
DanDroid
ActionBarActivity
Mark M.
are you using fragments at all, or just a simple ActionBarActivity?
DanDroid
just ActionBarActivity
no frags in the layout
framgents
Mark M.
in that case, you are presumably calling setContentView() to load up the layout
DanDroid
yes
Mark M.
you would retrieve the ListView by calling findViewById()
DanDroid
and then pass that in to the list adapter?
9:25 AM
Mark M.
no, you pass the ListAdapter to the ListView, via setAdapter()
DanDroid
ok
I have a button that loads the activity that hosts google maps. sometimes it takes about 3 seconds to load and at other times it loads right away like in 1 second. is this a bug within adroid or is it possible to make it load fast all the time?
Mark M.
it's not a bug
it's the implementation of Google Maps
DanDroid
oh ok
Mark M.
nothing really to be done about it
in part, it's whether the process that handles the maps is running or not
if it is not, Android needs to set up that process, and it appears to have to do a bunch of initialization work
DanDroid
i see
these are all questions i have for you mark. Thank you so much for helping me. I appreciate it. have a nice day! :)
Mark M.
you are very welcome
9:30 AM
DanDroid
Bye. Take care.
DanDroid
has left the room
10:00 AM
Mark M.
turned off guest access

Thursday, January 8

 

Office Hours

People in this transcript

  • DanDroid
  • Mark Murphy