ā Thursday, December 30, 2010
Mark M. | has entered the room |
Mark M. | turned on guest access |
Jan 6 | 4:00 PM |
fitz | has entered the room |
Mark M. |
howdy, fitz!
|
Mark M. |
how can I help you today?
|
fitz |
hello - congrats on book revision - will read through it next week
|
Mark M. |
thanks! another update being generated right now
|
fitz |
I am again here to just learn and watch - any way to get emailed the chat files even if I miss session - just for my reference
|
Mark M. |
they are posted to the [cw-android] Google Group, generally
|
fitz |
ok cool - so now that you have had time to
evaluate 2.3 - you like or so-so - see at CES they announced honeycomb
already on Motorola tablet
|
Mark M. |
as a user, Android 2.3 isn't that big of a deal to me at present
|
Mark M. |
particularly since the SIP client doesn't work with my SIP provider
|
Jan 6 | 4:05 PM |
Mark M. |
as a developer, there is interesting incremental stuff, plus lots of goodies for game developers
|
fitz |
cart before the horse - stuff is moving fast :)
|
Mark M. |
since I'm not a game developer (nor do I play one on TV), the incremental stuff is my focus
|
Mark M. |
now, Android 3.0, based on the video from yesterday, is quite a departure
|
Mark M. |
not quite sure how to put that into context right now
|
fitz |
ya same here - games are not my thing
|
fitz |
have not had time to look at 3.0 - major direction change?
|
Mark M. | |
Mark M. |
tough to describe in words
|
Jan 6 | 4:10 PM |
fitz |
ok will go look - listening to CES verizon - hope they have something to say :)
|
fitz |
so I am just hanging to watch chats thanks
|
Mark M. |
OK
|
Jan 6 | 4:30 PM |
David | has entered the room |
Mark M. |
howdy, David!
|
David |
Happy New Year! I want to make a Web Server send data to an Android device (usually client) sometimes. How can I do that?
|
Jan 6 | 4:35 PM |
Mark M. |
um
|
Mark M. |
that doesn't make a lot of sense to me
|
Mark M. |
Web servers are typically "pull" models, with clients initiating requests
|
Mark M. |
what do you mean by "send data to an Android device sometimes"?
|
David |
Whenever the server has an event, it will send the data. I know in terms of Server/Client. But is it possible to use socket?
|
Mark M. |
You are welcome to use Java sockets in Android
|
Mark M. |
Your problem is primarily in the server
|
Mark M. |
and in the "sometimes"
|
Mark M. |
and in the "send data"
|
David |
Is the socket connection always on? Can the Android handle this?
|
David |
The server will initiate the sending when it has an alert.
|
Mark M. |
You probably want C2DM or Urban Airship, then
|
Mark M. |
or SMS
|
Mark M. |
rolling your own C2DM equivalent is certainly possible, but handling all scenarios will take quite a bit of time
|
Mark M. |
for example, you need to be careful not to draw too much power
|
David |
I will implement it too, but it has to go through Google network.
|
Mark M. |
and, you need to deal with socket timeouts
|
Mark M. |
and, you need to deal with network failovers from WiFi to 3G (or back to WiFi)
|
Jan 6 | 4:40 PM |
Mark M. |
if you have many developer-months lying around that you don't know what to do with, feel free to give it a shot
|
Mark M. |
what we could use is an open source C2DM clone, so you can host this stuff yourself
|
Mark M. |
alas, I am not aware of one
|
David |
I see.
|
Mark M. |
C2DM uses Google servers, Urban Airship uses Urban Airship servers
|
David |
How about HTTP persistent connection?
|
Mark M. |
see notes above about socket timeouts and network failovers
|
fitz |
will your advanced book next version cover more on C2DM?
|
David |
Will it work for my applicaiton?
|
Mark M. |
fitz: it already has a chapter on it, and I do not expect to expand upon it any time soon
|
Mark M. |
David: what is "it"?
|
David |
That is a good news.
|
fitz |
ok thanks
|
David |
Somepeople suggests a proxy. Will it work?
|
David |
I mean a proxy on Android.
|
Mark M. |
I have no idea what that suggestion might be referring to, sorry
|
Mark M. |
if you elect to implement your own C2DM-like system, watch the 2010 Google I|O presentation on C2DM
|
Mark M. |
they mention a number of challenges they needed to overcome, that you will need to overcome in your own implementation
|
Jan 6 | 4:45 PM |
David |
Thanks.
|
Mark M. |
also, bear in mind that C2DM does not require -- does not even *want* -- you to send much data
|
Mark M. |
mostly, you send a "tickle" with a pointer to some place to get the real data (e.g., URL to a Web service)
|
Mark M. |
hence, the C2DM message that passes through Google servers does not have to contain any data that Google could somehow use
|
David |
There is little info on how to send content from App Server over C2DM.
|
Mark M. |
the point is, you *don't* send "content" over C2DM, or Urban Airship for that matter
|
Mark M. |
you send a short notice (handful of bytes) that your client on the device can use to go pull the "content"
|
Mark M. |
e.g., a URL
|
David |
I see. Thanks I make sense.
|
David |
It makes sense.
|
David |
Between C2DM and Urban Airship, which one do you recommend?
|
Mark M. |
I have not used Urban Airship, I just know of it
|
Jan 6 | 4:50 PM |
Mark M. |
it has the advantage of working on a couple of platforms, whereas C2DM is Android-only
|
Mark M. |
OTOH, C2DM is free, and Urban Airship is not, IIRC
|
David |
That is good to know.
|
Mark M. |
On a completely unrelated note, _Android Programming Tutorials_ Version 3.1 will be released in less than an hour
|
Mark M. |
tested on Android 2.3, plus better material on getting Eclipse set up
|
Mark M. |
and the ever-popular errata fixes
|
Jan 6 | 4:55 PM |
fitz |
nice - thanks for update
|
Mark M. |
you can download the PDF now, unless you bought
your Warescription in the past couple of weeks -- last handful of PDFs
are being created now
|
Mark M. |
EPUB and Kindle editions will roll out over the next several hours
|
Mark M. |
running out of time -- any last questions?
|
fitz |
nope cya
|
fitz | has left the room |
David |
That is all for today.
|
David |
Thank you.
|
Mark M. |
OK, have a pleasant day!
|
David | has left the room |
Mark M. | turned off guest access |