Dec 28 | 7:50 PM |
Mark M. | has entered the room |
Mark M. | turned off guest access |
Mark M. | turned on guest access |
Dec 28 | 7:55 PM |
Suzanne A. | has entered the room |
Suzanne A. |
hello
|
Mark M. |
howdy, Suzanne!
|
Suzanne A. |
is it welcome back to the us?
|
Mark M. |
yup
|
Mark M. |
no overseas travel for the better part of a month
|
Dec 28 | 8:00 PM |
Suzanne A. |
ok. this week, i'm working on a baby names app
|
Suzanne A. |
like this: http://isource.com/2008/09/14/iphone-app-o…
|
Mark M. |
OK
|
Suzanne A. |
so a few questions
|
Suzanne A. |
first, how do we set a background image for an entire listview (not just a list item)?
|
Mark M. |
just android:background on the ListView, I suppose
|
Mark M. |
don't know why it would be any different than any other widget in that regard
|
Suzanne A. |
so my xml has just a TextView, and I'm using the ViewHolder pattern in java
|
Mark M. |
might have to mess with the selector a bit, though -- not sure how that works
|
fitz | has entered the room |
Suzanne A. |
the TextView is the list item. where do i define the ListView?
|
Mark M. |
normally, that is in your activity layout
|
Mark M. |
(BTW, howdy, fitz!)
|
fitz |
Hello - and Merry Xmas to all
|
Mark M. |
if you are using ListActivity and not calling
setContentView(), you would need to call some setBackground-ish method
on the widget
|
Suzanne A. |
yes, I'm using ListActivity
|
fitz |
just trying to get knowledge in chat here
|
Suzanne A. |
also, for the name data, do I just create a sqlite
db? is there any advantage to creating a content provider if I'm not
sharing data?
|
Mark M. |
so, you either supply a layout for the
ListActivity and call setContentView(), or call getListView() and then
setBackgroundResource()
|
Mark M. |
I'm not a fan of content providers yet, so I'd go with just a plain database
|
Suzanne A. |
aha, thanks
|
Suzanne A. |
yeah, content providers seem a bit .. well, complex
|
Mark M. |
considering the book I'm moving the coverage of contents providers to, I'd go with "advanced" :-)
|
Dec 28 | 8:05 PM |
Suzanne A. |
fitz, may I squeeze in another question? or do you want to ask one?
|
Suzanne A. |
ok. well .. how do I save a name to a favorites list?
|
fitz |
well I have read bother books and read tutorials -
so now I am in overload mode - kinda at a point of where to start - did
get phone for Xmas so that is a start
|
Mark M. |
Option #1: have an isFavorite column in the names table
|
Mark M. |
Option #2: have a favorites table, containing your name's primary key and other data (e.g., date it was made a favorite)
|
fitz |
both that is :)
|
Suzanne A. |
thanks, option 2 sounds a bit easier
|
Suzanne A. |
also, the best way to populate a list from a sqlite database?
|
Mark M. |
rawQuery() and a SimpleCursorAdapter
|
Mark M. |
see Database/Constants in the source code to The Busy Coder's Guide to Android Development
|
Suzanne A. |
ho-kay. this gives me a lot to work with, thanks
|
Mark M. |
no problem
|
Mark M. |
tell your beta testers I said "congratulations!"
|
Mark M. |
:-)
|
Dec 28 | 8:10 PM |
Suzanne A. |
will do :-) namely, my sister :-)
|
Mark M. |
I figured there was an itch being scratched here
|
Mark M. |
fitz: do you have a question?
|
Suzanne A. |
yes, i'm having a niece in march
|
fitz |
Mark - I have a need to on background scan emails
for a key word set - as in Google Docs when sharing can send an e-mail
notice out when colleague updates file - so 1st step is to do this
e-mail search for keywords and if a hit then cross reference to contact
e-mail - then display info on screen - question is - should all this be
done locally on cell? seams like that is a better process. If so what
function for e-mail scan should I use/look at and what should I look at
got cross referencing contacts
|
Mark M. |
OK, I'm seriously lost
|
Mark M. |
what are you scanning for keywords?
|
fitz |
because that is the notice we will be keying off
of - we could scan Google docs for updates on date/time stamps but that
seams a bit much
|
fitz |
maybe scanning Google docs is better?
|
Mark M. |
I can't answer that, because I don't understand what you're talking about, sorry
|
Mark M. |
suffice it to say, any sort of searching is better done someplace other than an underpowered smartphone
|
Mark M. |
unless the data being searched only exists on said underpowered smartphone
|
fitz |
see - we need to monitor when a doc file is updated by the other person your sharing with
|
Mark M. |
OK
|
Mark M. |
that still sounds like a better job for a server
|
fitz |
ok - that gives me a bit more direction - will do scan in our main c# .net app
|
Mark M. |
have the server do the searching/monitoring/whatever
|
Dec 28 | 8:15 PM |
Mark M. |
have the server let the Android app know about results
|
fitz |
we can send phone a NOTICE alert
|
fitz |
so so would that be using the ... hang on looking it up
|
Suzanne A. |
ok, gotta run, but thanks much
|
Mark M. |
well, I'm not sure what "a NOTICE alert" is
|
Mark M. |
Suzanne: have a pleasant evening!
|
Mark M. |
fitz: you could send the user an SMS or email, or
you could have the Android app ask the server sporadically for updates,
or you can use C2DM
|
fitz |
the C2DM process
|
fitz |
ok thanks
|
fitz |
cya
|
Dec 28 | 8:20 PM |
fitz | has left the room |
Dec 28 | 8:25 PM |
fitz | has entered the room |
fitz | has left the room |
fitz | has entered the room |
Mark M. |
re-howdy, fitz!
|
Dec 28 | 8:30 PM |
Suzanne A. | has left the room |
fitz |
forgot to ask - if I need to scan to get a
specific contact by e-mail address - what part of the books should I
focus on - want to pop open contact for user with notice file at docs
was updated
|
Mark M. |
um, well, the ContactsContract content provider is how you get information about contacts
|
fitz |
then add a link to that docs file - start to make sense?
|
Mark M. |
there's a chapter covering bits of that in the Advanced Android book
|
Mark M. |
I don't know what "with notice file at docs was updated" means
|
fitz |
so you and I share a excel doc at Google docs - I
am on road today so you go in and modify a sale # on excel file at
Google docs. Now Google SOMETIMES sends me an e-mail notice - if I only
have cell with - then it is not so good
|
Mark M. |
I don't do much Google Docs collaboration, so I'll take your word for it
|
Dec 28 | 8:35 PM |
fitz |
I want to get a notice the file is updated and I
can do that via the PC app we have in c# - so I will send a notice to my
phone somehow (maybe C2DM)- anyways what we will pass is the e-mail
address of the person that updated the file to android - so then I need
to scan contacts and do magic - sort of make more sense
|
Mark M. |
you assume that all collaborators are contacts, which may not be the case
|
fitz |
ya but that is ok - we then default a standard massage a file was updated and the contact was in in phone DB
|
fitz |
was not in the phone contact dB
|
fitz |
typing today has been fun :)
|
fitz |
ok so focus on ContactsContact in adv book
|
Mark M. |
yes
|
Mark M. |
ContactsContract is a fairly complex API, worse if you are trying to modify the data
|
fitz |
and then for alerts on screen what should I look at in books
|
Mark M. |
you probably want to do a Notification there
|
Mark M. |
that's in The Busy Coder's Guide to Android Development
|
Mark M. |
you do not want to pop up an activity just because somebody modified a Google Doc somewhere
|
fitz |
Na we are not modifying any data - just pulling it up for easy access for end user
|
Mark M. |
the user might be in the middle of something that they will not want interrupted
|
Dec 28 | 8:40 PM |
fitz |
yes - ok - and if I want to link to Google docs
file - what webview is best if on top I have contact name maybe e-mail
addess and then a link to Google docs
|
Mark M. |
why WebView?
|
Mark M. |
use TextViews for the name/address
|
Mark M. |
use a Button or a menu for accessing the doc, which you would want to open up in the user's choice of browser
|
fitz |
just trying to narrow down the amount of book info :) just a link to the file I guess - that is all I need
|
fitz |
yes ok great thanks
|
fitz |
off now cya
|
fitz |
signed up for 1 year program today :)
|
fitz |
cya
|
fitz | has left the room |