Jun 21 | 7:25 PM |
Mark M. | has entered the room |
Mark M. | turned on guest access |
Jun 21 | 7:35 PM |
Scott P. | has entered the room |
Mark M. |
howdy, Scott!
|
Scott P. |
I'm back :-)
|
Scott P. |
alrightSo I got pretty
|
Scott P. |
*So I have something that I think is within your capability to help me with
|
Scott P. |
I contacted Google for what the issue might be
|
Scott P. |
and it sounds like the authorization token that I'm sending to the server is out of date
|
Scott P. |
so I need to manually pull one in fresh from google
|
Scott P. |
Do you know how to do that?
|
Mark M. |
no offense, but you're going to have to refresh my memory of what you're talking about
|
Scott P. |
right
|
Scott P. |
c2dm
|
Mark M. |
I barely remember what I had for breakfast this morning
|
Mark M. |
:-)
|
Mark M. |
the sum total of my C2DM knowledge is contained in that one chapter
|
Mark M. |
and, since I've forgotten most of it in the past year, I'd have to read my own chapter to get caught up to myself
|
Scott P. |
so Googles new GPE Beta integrates App Engine and Android together along with C2DM
|
Mark M. |
ok
|
Scott P. |
well I was looking through your chapter
|
Scott P. |
and it looks like you use a curl script to do it?
|
Mark M. |
ah, that token
|
Jun 21 | 7:40 PM |
Scott P. |
I'm not sure I fully understand how you execute the curl script
|
Scott P. |
and I'm not sure how to pull a value from it
|
Mark M. |
for the purposes of the book, lacking an app server, curl is a reasonable stopgap
|
Mark M. |
a real server process would use something more sophisticated
|
Mark M. |
I think the C2DM samples show a servlet for the server-side, getting and managing the auth token
|
Mark M. |
(C2DM samples from Google, that is)
|
Mark M. |
the curl script is designed to be pasted into a command line and run
|
Mark M. |
given that you have curl in your path
|
Mark M. |
and you adjust the parameters as needed
|
Mark M. |
it's designed for developers for lightweight testing, not for production use
|
Scott P. |
so I can't do that from my android phone?
|
Mark M. |
you'
|
Mark M. |
you're not supposed to do that on the client side
|
Mark M. |
that's for the server side
|
Mark M. |
where the curl scripts are a stopgap replacement for a real server
|
Scott P. |
hmmm, really?
|
Mark M. |
again, you're asking a guy who hasn't touched this in ages and, as usual, is short on sleep
|
Mark M. |
but I am really really sure that the curl scripts are not supposed to run on the device
|
Scott P. |
It seems that I need to have an authention token that I send from the phone to the server
|
Mark M. |
the equivalent of those scripts would either be
part of your GAE environment, or possibly manually run with the results
added to some configuration data your GAE stuff runs
|
Scott P. |
blah
|
Mark M. |
there are multiple tokens involved
|
Scott P. |
ok
|
Mark M. |
in my book, I have an activity and broadcast receiver, demonstrating the client side portion of matters
|
Scott P. |
yup
|
Mark M. |
hold on
|
Scott P. |
hmmm
|
Scott P. |
ok
|
Mark M. |
View paste
|
Jun 21 | 7:45 PM |
Mark M. |
(from page 454 of the Advanced Android book)
|
Mark M. |
the registration ID is the "token" that is on the client side
|
Scott P. |
right
|
Scott P. |
wait
|
Scott P. |
no
|
Mark M. |
View paste
|
Mark M. |
(also from page 454)
|
Scott P. |
I'm refering to something called the
Authentication Token. The Authentication Token is sent to the Server,
and is used to generate a registration cookie
|
Mark M. |
the "authentication token" is basically the result
of ClientLogin, indicating that your server is authorized to send
requests to the C2DM servers
|
Scott P. |
the cookie is then sent back to the device
|
Scott P. |
then that cookie is used to register to c2dm
|
Mark M. |
the "authentication token" is *exclusively* a server-side concept
|
Mark M. |
at least with C2DM the way it was a year ago
|
Scott P. |
hmmm
|
Mark M. |
now, I have never used GAE, let alone for this other stuff you're talking about
|
Mark M. |
I have no idea what the GAE frameworks are for sending stuff via C2DM
|
Scott P. |
it's all hiidden and done behind the scenes so I can't really tell either
|
Scott P. |
I suppose I'll just e-mail back and ask for a work around
|
Mark M. |
then you need to be talking to the GAE folk
|
Scott P. |
thanks
|
Mark M. |
the authentication token, as I recall, is something that will be useful for a while but will eventually be revoked due to age
|
Mark M. |
IIRC, you actually will get an updated token as part of doing C2DM calls, via a custom header
|
Scott P. |
IIRC?
|
Mark M. |
so, in theory, you'd use the curl stuff to
bootstrap your initial token, and your app server would update its
cached copy based on the custom headers if a new token is handed to you
|
Mark M. |
"if I recall correctly"
|
Scott P. |
hmmm
|
Scott P. |
ok
|
Scott P. |
Thanks, I appreciate it
|
Mark M. |
sorry I can't be of greater help
|
Jun 21 | 7:50 PM |
Mark M. |
C2DM is one of those topics I covered for the sake of covering it, more so than something I use or interact with regularly
|
Scott P. |
it's ok. I just thought I'd exhaust my other resources before I bothered them for a workaround
|
Mark M. |
is there anything else I can help you with today?
|
Scott P. |
I think that's it
|
Jun 21 | 7:55 PM |
Mark M. |
well, if you think of something, I'm here for another ~35 minutes or so
|
Jun 21 | 7:55 PM |
Scott P. |
1 more small question I suppose. Do you know of a
way when reading the SMS content provider to tell whether or not an SMS
is one recieved or one that is sent?
|
Mark M. |
since there is no SMS content provider in the Android SDK, I don't know much
|
Mark M. |
I assume you're referring to the content provider used by the AOSP Messaging app
|
Scott P. |
AOSP?
|
Mark M. |
Android open source project
|
Scott P. |
I suppose
|
Mark M. |
that app may not be on any device and, even if it is, may be modified by the OEM
|
Mark M. |
developers shouldn't be relying on that content provider for much of anything
|
Scott P. |
I've read your posts on stackoverflow about that
|
Scott P. |
and even read the linked articles
|
Mark M. |
I'm a bit of a broken record on the subject
|
Scott P. |
however it's unavoidable when there is no point to having the app if it can't use the functionality that this provides
|
Scott P. |
that being said, are there any known devices that don't implement it in some form or another?
|
Mark M. |
beats me
|
Scott P. |
I suppose it's possible t hat they don't include it or take it out
|
Mark M. |
and it is only "unavoidable" if you write this app
|
Jun 21 | 8:00 PM |
Mark M. |
or Google refactors it
|
Mark M. |
or Google renames it
|
Mark M. |
the similarly-unsupported calendar content provider had this happen
|
Mark M. |
fortunately for those who depended upon it, the change was relatively minor
|
Mark M. |
and, for calendar, there's always the Google Calendar APIs as an alternative access method
|
Mark M. |
personally, I wish Google would step up and make the SMS content provider part of the OS
|
Mark M. |
I even spoke to an engineer about that at I|O
|
Scott P. |
Well that change would only happen for future
versions correct, so why wouldn't a version check with different cases
for how to handle it be a simple work around?
|
Scott P. |
what did they say?
|
Mark M. |
for those narrow cases, perhaps
|
Mark M. |
the engineer basically said that it's not a priority
|
Scott P. |
I really feel like they need to make hardware acceleration a priority on the default home screen
|
Scott P. |
it amazes me they haven't done that yet.
|
Scott P. |
It makes the android experience feel slow and laggy compared to iOS
|
Mark M. |
it's accelerated in Honeycomb
|
Kathy | has entered the room |
Mark M. |
and will be going forward
|
Scott P. |
but that's tablets
|
Scott P. |
I haven't seen anything in terms of phones
|
Mark M. |
"going forward" = Ice Cream Sandwich = phones
|
Kathy |
Hello everyone.
|
Mark M. |
howdy, Kathy!
|
Scott P. |
oh snap
|
Scott P. |
Hi Kathy
|
Mark M. |
Kathy: do you have a question?
|
Jun 21 | 8:05 PM |
Kathy |
yes, I do.
|
Mark M. |
Kathy: go ahead with your question
|
Kathy |
I am doing a display of text in three columns and
an undetermined number of rows. I have been playing around with
gridview to do this. I do not want the words, to be clickable. I want
to propagate the rows and columns from a string array. I have been
looking at the google grid example but it is using images and listeners.
I have also looked at your example and it is using a listener.
|
Mark M. |
sounds like a TableLayout, perhaps wrapped in a ScrollView if it might exceed the bounds of the screen
|
Jun 21 | 8:10 PM |
Kathy |
I thought the grid layout might do some things
automatically like the scrolling. I was first playing with a table
layout and trying to propagate the rows and columns dynamically, but
then it looked like a grid might be better, of course I may be wrong.
|
Mark M. |
well, GridView cells are clickable, because that's the objective of any AdapterView
|
Scott P. |
Alright Mark. It's been a pleasure talking with you again. See you later.
|
Mark M. |
Scott: see ya!
|
Kathy |
Okay, then I should go back to the table layout
then? If so, is there a good example I could look at that would let me
use a string array and a dynamic number of rows?
|
Mark M. |
you'd have to construct the rows in Java code, rather than via a layout XML resource
|
Mark M. |
I don't have any examples of that handy
|
Mark M. |
nor can I think of any off the top of my head
|
Jun 21 | 8:15 PM |
Mark M. |
most of the time, people are looking for the input, and so GridView works
|
Kathy |
I guess I could use a listener with gridview and just ignore the clicks?
|
Mark M. |
the downside there is that users will see the visual response to the clicks and wonder why nothing is happening
|
Mark M. |
are you sure there's nothing you could/should be doing when the user clicks on a cell?
|
Kathy |
yeah, that would be bad.
|
Kathy |
I can think on it, but right now no.
|
Mark M. |
well, iterating over the string array and creating TextView and TableRow widgets in Java will be annoying, but certainly doable
|
Kathy |
Yes, I could do that. I like to use things as vanilla as possible, but then I want things that are not.
|
Jun 21 | 8:20 PM |
Scott P. | has left the room |
Kathy |
Thanks for your help on this and helping me to increase my understanding.
|
Mark M. |
sorry I didn't have a better answer for you
|
Kathy |
No problem and no worries.
|
Kathy |
On a different note, is there some sort of master
index for your books? I would like to be able to look at some sort of
index for example gridviews and get a list of which books and where thay
are at.
|
Mark M. |
not really
|
Mark M. |
given that they're digital, most people just use search
|
Mark M. |
if your desktop environment has an integrated
document indexer, and it indexes PDFs, you might be able to search all
three at once that way
|
Mark M. |
or, search them individually from your PDF reader
|
Mark M. |
or, create a concatenated copy of all three PDFs, and search that from your PDF reader
|
Kathy |
I have been pulling each book individually up in pdf and doing it that way. Is there a better way?
|
Mark M. |
there are various packages available to
concatenate PDFs, which you could use to create a master PDF for
searching, but then you'd need to update that with every book release
|
Jun 21 | 8:25 PM |
Kathy |
Well, those were the only questions I have for now. I very much appreciate your time and help.
|
Mark M. |
happy to be useful
|
Kathy |
Good bye.
|
Mark M. |
see ya!
|
Jun 21 | 8:30 PM |
Kathy | has left the room |
Mark M. | turned off guest access |