Office Hours — Today, March 31

Tuesday, March 29

Mar 31
3:50 PM
Mark M.
has entered the room
Mark M.
turned on guest access
3:55 PM
Marco G.
has entered the room
Mark M.
howdy, Marco!
Marco G.
Hello mark, can i ask you something?
some advices.. not technical stuff yet..
Mark M.
go right ahead
Marco G.
I would like to implement an application for my wordpress blog
4:00 PM
Marco G.
I would like to have a listview with my rss feeds with the news
Are there some libraries or something that will make the work easier?
Mark M.
if "the work" is fetching and parsing the RSS, yes
in fact, _Android Programming Tutorials_ now uses one
Marco G.
Great!
Mark M.
check out Tutorial 15
Marco G.
I was thinking also to take a look at REST implementation of Google I/O 2010, to store some of the feeds on the phone.. Is there something similar inside the commonsware books? I've looked only part of the first book yet. It's a good idea or a waste of time?
Mark M.
I'm not a huge fan of the architecture they described in that conference session
overly complex, IMHO
Marco G.
Ok.. I don't want to do stuff that it's not necessary
Mark M.
my books are more on the bits and pieces, less on how to plug everything into make some larger app
Mike R.
has entered the room
Mike R.
Hello
Dimitri
has entered the room
Mark M.
howdy, Mike and Dimitri!
Marco G.
Thank you Mark.. There is a ChangeLog of 3.6 version of the book?
4:05 PM
Dimitri
Hi
Mark M.
Marco: well, a blog post that serves as my release notes
Mike: do you have a question?
Mike R.
yes.
Marco G.
Thanks
Mike R.
Would like to know the orientation of the device as an activity starts up. Is there a way to get that?
Mark M.
getResources().getConfiguration().orientation
Mike R.
thanks
Marco G.
Great, fragments and compatibility library
Mark M.
Dimitri: do you have a question?
Dimitri
Yes how the ever used or hered of droid-fu library for Asynctask?
Mark M.
I have heard of droid-fu
I haven't used it, nor do I know much about any specific AsyncTask support it may have
Marco: do you have a question?
4:10 PM
Marco G.
No, thank you Mark, you answered all my questions for today
Mark M.
OK
Mike: do you have another question?
Dimitri
ok, the reason being is that I have just read through your update book (great stuff) but i am still little confused. This is an ongoing problem from the last session. I need to clarify something in my head. i have an app. That needs on start to load some data other the Internet, and the save it in a local db in order to be used later in the ui. I Am using an asynTask to load all data and save in the database this takes time.
Should i be using a Service?
Mark M.
Dmitri: possibly
Dimitri
Or brake up my main task into any small tasks/ Inserting to the database 1000 takes ratherlong...
Mark M.
well, on the inserting front, you really really really need to use some transactions
by default, 1000 inserts = 1000 transactions = 1000 sets of flash I/O writes = slow
the far other end of the spectrum: 1 transaction of 1000 inserts = 1 transaction = 1 set of flash I/O writes = not quite as bad
there are shades of gray in between (e.g., one transaction per 100 inserts)
Dimitri
what would be the correct design pattern i.e for your restaurant application if you were to implement it
Mark M.
OK
let's say that I wanted to pre-populate the LunchList app with 1,000 local restaurants (I hope we're in NYC...)
4:15 PM
Mark M.
I would probably use an IntentService
Dimitri
yes..
Mark M.
much like you see in the latest edition of the tutorials, how I have an IntentService for fetching the RSS feed
there, fetching the feed is pretty quick, so an AsyncTask would probably be OK
but, downloading 1,000 restaurants, parsing that, and stuffing the data into a database is probably something I would want to have running regardless of what is going on with activities
I'd send a broadcast Intent when the work was done, so the activity, if it is still around, could update itself for the new data
Dimitri
so then the list in ui would be update....
what would happen until then user would have a process dialog....
Mark M.
you could use a progress dialog, if you wanted
I try not to use those
they block access to other parts of the app
(e.g., help, about, settings)
I'd rather use a progress indicator in the title bar or something like that
4:20 PM
Dimitri
I see i will have a closer look at the tutorials, thank you, regarding the restaurant app, i know its for beginners, but stuff such as this could really improve our learning curve if incorporated in one demo app.
Mark M.
that's not really the goal of that book
as I was telling Marco before you joined, the books are mostly showing the pieces of Android, not trying to show some massive project integrating some subset of those pieces
while what you want to learn (downloading/parsing/inserting 1000 entries) is important to you, I am sure there are hundreds of similar combinations that would be important to others
and I just can't do them all
Dimitri
true thank you anyway
Mark M.
anyone have any questions?
4:30 PM
Mark M.
BTW, fresh PDFs are ready for you to download, correcting the bookmarks/table of contents problem in the update to _The Busy Coder's Guide to Android Development_ that I released earlier today
Mike R.
mark i have another question
Mark M.
go right ahead
4:35 PM
Mike R.
i've been experimenting with the orientation value you suggested
on my particular device, when I hold it in portrait mode, orientation returns 0
when i hold it in landscape mode, orientation returns 1
According to the documentation
portrait is 1 and landscape is 2
what should i believe?
Mark M.
what is the device?
Mike R.
droid
Mark M.
are you just turning the device, or are you actually sliding the keyboard in and out?
Mike R.
turning the device
Mark M.
then, do you have android:screenOrientation set in your manifest?
Mike R.
not on that particular view.
Mark M.
it's not an attribute on a view in a layout
Mike R.
the view does orient itself to the proper orientation as i change it
Mark M.
android:screenOrientation would be on your <activity> in the manifest
Mike R.
i have some views where I lock the screenOrientation to "portrait" in the manifest
on this view there is no screenOrientation entry in the manifest and so it rotates as the device rotates
4:40 PM
Mark M.
well, once upon a time, the DROID would not have any effect if the device were rotated, unless you set screenOrientation="sensor"
the orientation trigger was sliding the keyboard in or out
Mike R.
it definitely has an effect. it just doesn't seem to return values consistent with the documentation
Mark M.
I can tell you that the right values seem to be used on a XOOM
as I was just playing with that a couple of days ago
beyond that, I don't know what to tell you
Dimitri
Mark i have another question. In a view a have a EditText, and a Listview. The EditText implements a texTWatcher and filters the selectable Listview. When the user types to edit the android keyboard fill-ups most of the space is there a way to adjust the keyboard size except using "adjustPan'
Mark M.
If you have a ListView, I'd use adjustResize
so it shrinks the ListView while the soft keyboard is exposed
4:45 PM
Mike R.
has left the room
Dimitri
I need to be able to select as many rows as possible.... whilst typing i do not want to hide what the user's input is actualy doing to the list
Mark M.
I fail to see how that will be possible
Dimitri
ok thats what i thought...
thanks anyway...
bye
Dimitri
has left the room
Mark M.
got any questions?
Marco G.
No, now i quit, thank you Mark. Bye
Mark M.
have a pleasant day!
5:00 PM
Marco G.
has left the room
Mark M.
turned off guest access

Tuesday, March 29

 

Office Hours

People in this transcript

  • Dimitri
  • Marco Grassi
  • Mark Murphy
  • Mike Renda