Office Hours — Today, February 28

Thursday, February 23

Feb 28
8:55 AM
Mark M.
has entered the room
Mark M.
turned on guest access
9:05 AM
tunneling
has entered the room
Mark M.
howdy, tunneling
how can I help you today?
tunneling
good day!
Mark M.
that's highly debateable
I'm on Day 5 of the everlasting cold
starting to *really* get on my nerves
tunneling
this true, i'm actually under the weather and in bed.
Mark M.
:-)
tunneling
haha
tis the season
9:10 AM
tunneling
hey, is there a trick to making the spacing between views the same? I have a set of textviews that I put in a grid like format and I'd like to put a border around them that's 1px.
or 1dp
Mark M.
minimum spacing between widgets is dictated by the widgets themselves, particularly their backgrounds
above that, you android:layout_margin* to add more space
tunneling
yea.. my problem is that for views in the center, the right side of one view and the left side of the next view combine to make a 2sp border
Mark M.
then don't draw the border on both adjoining widgets
tunneling
i had made a style that has the margin on the appropriate side to make it look right, i was just hoping there was a more elegant way
Mark M.
(e.g., left one draws, right one does not)
I am not aware of anything more elegant, sorry
tunneling
ok. im just thinking ahead to trying to make this layout more dynamic, and was hoping I wouldn't have to figure out the position of the view in order to add the right styling
Mark M.
well, arguably, the thingy that draws the grid should be a ViewGroup
and it knows the positions of all of its children
within its own space, at any rate
tunneling
ok
9:15 AM
Mark M.
if you have other questions, chime in
tunneling
ok, that was really the main thing for today. I implemented the state list drawables yesterday using shape drawables.. worked out well.
except that eclipse was having a fit with the xml
Mark M.
welcome to Eclipse
9:20 AM
tunneling
yea? I all the time have to delete the R file and get it to regen so it sees resources
Mark M.
rather than delete R, use Project > Clean from the Eclipse menu
tunneling
ok
Mark M.
this should not be needed all the time, but will be needed sometimes
tunneling
ok
I'm thinking about trying to implement a mechanism for alerting users that a new version is on the Market. I have a couple of Users that are using a version like 10 revs back and keep reporting FC that are corrected.
I guess that would be easy enough with an xml or JSON file on the mother ship?
9:25 AM
Mark M.
yes
I should be creating a component for handling this scenario in the next few weeks
tunneling
oh cool.
i was essentially thinking of a "developer message" mechanism so I could have the user opt in to receive messages, and then have a notification that there is a new message.
Mark M.
that might be as simple as a blob of HTML
use an HTTP HEAD request to check the date
if the date is newer than the last one you sent, display the HTML in a WebView or user's default browser
tunneling
i haven't tried the google cloud service, so i was thinking about just using a Service to periodically query the server.
Mark M.
AlarmManager and IntentService would be a reasonable choice
tunneling
ok
Mark M.
though you may need my WakefulIntentService, so the device doesn't fall asleep while you do the work
tunneling
ok
9:30 AM
tunneling
I've never used that, I'll read up on it.
Mark M.
there is coverage in the Advanced Services chapter in _The Busy Coder's Guide to Advanced Android Development_
tunneling
you know, if I would actually just read the books. I may not have to bug you so much!
Mark M.
well, there *is* a reason why I wrote them... :-)
tunneling
haha
I just can't stand the thought of you being in these office hours sessions all alone.
ok, well.. thanks again for your time. I need to run. get well!
Mark M.
you too
9:40 AM
Darryl B.
has entered the room
Darryl B.
Hi Mark
Mark M.
howdy, Darryl
Darryl B.
I have a quick question on best practice
Mark M.
OK
go ahead
Darryl B.
I have a complex data object that I use that spans multiple fragments in my UI
I am using the fragmentpager to manage the display
And I was wondering should I instantiate the data object in the pager or extend application and use it from there
9:45 AM
Mark M.
is this "data object" part of your app's data model?
Darryl B.
I am sort of new to android and jave so I am just getting the hange of thins
yes
the app has a SQLite db with about 60 tables
Mark M.
60 tables sounds too complicated for a mobile device, but, be that as it may...
Darryl B.
I know, not my first choice for my first project
Mark M.
the activity hosting the FragmentPager should be the one to query the database, using a Loader
the fragments can get at the resulting Cursor by asking the activity for it
Darryl B.
ok cool that is where I was thinking it would go. I was not using cursors because of the _id restriction, so I have been using classes generated from the OData model
9:50 AM
Mark M.
there is no _id restriction on *cursors*
tunneling
has left the room
Mark M.
there is an _id restriction on *CursorAdapter* (and its subclasses)
Darryl B.
ah now I see I read that wrong
that will make things a little easier
I have been using the IO sched app as a guide
thanks for taking the time to answer my questions
Mark M.
sure, no problem
that's why these office hours exist
Darryl B.
Are you going to be the instructor on any of the Android Bootcamp classes?
Mark M.
I teach Marakana's Android Bootcamp in NYC and Washington DC
9:55 AM
Darryl B.
Great I am going to sign up soon, I will check the schedule
Mark M.
next DC one is first week of April; next NYC one is mid-May
Darryl B.
Thanks again have a great day, see you in class
Mark M.
thanks!
Darryl B.
has left the room

Thursday, February 23

 

Office Hours

People in this transcript

  • Darryl Brown
  • Mark Murphy
  • tunneling