Sep 14 | 7:50 PM |
Mark M. | has entered the room |
Mark M. | turned on guest access |
Sep 14 | 7:55 PM |
Julius | has entered the room |
Julius |
hi Mark
|
Mark M. |
howdy, Julius!
|
Julius |
you must be sick of seeing me here... :)
|
Mark M. |
no worries
|
Julius |
anywho... I have a couple of questions.
|
Sep 14 | 8:00 PM |
Mark M. |
fire away!
|
Julius |
I'm trying to set the speakerPhone function on when a call starts and not having much luck. I'm using:
|
Julius |
View paste
|
Julius |
I do it when the phone goes Off_HOOK
|
Julius | |
Max S. | has entered the room |
Julius |
just wondering if you' had a loko at this bfore.
|
Mike R. | has entered the room |
Mike R. |
Hello
|
Mark M. |
I haven't touched AudioManager yet, let alone the speakerphone feature
|
Max S. |
Hi Mark, not sure of the protocol, will ready a question, let me know when I should ask it please. (Hello, everyone)
|
Mark M. |
(BTW, howdy, Max S and Mike R!)
|
Julius |
no problem thanks. I can go to the back of the queue.
|
Mark M. |
Julius: have you used Google Code Search to see where that's being used in Android proper?
|
Julius |
no - I should google tat term?
|
Mark M. |
on Google Code Search, yes, with the package:android limiter
|
Julius |
cool thanks
|
Mark M. |
I see a snippet where the Phone app uses it
|
Julius |
I'll try taht now
|
Mark M. |
Max: you ducked in just ahead of Mike, so...do you have a question?
|
Max S. |
View paste
|
Mark M. |
the data you want is in android.os.Build
|
Max S. |
Great, Ill poke around that, you can move on ...
|
Mark M. |
you can either display that info, or rig up something to upload the data, etc.
|
Sep 14 | 8:05 PM |
Mark M. |
actually, Build is only for manufacturer, model, OS versoin
|
Mark M. |
er, version
|
Mark M. |
the rest is actually a bit difficult to get
|
Max S. |
I see what is good enough in there, thanks!
|
Mark M. |
Mike R: got a question?
|
Mike R. |
Sure do. I'm having a layout issue.
|
Mike R. |
I have a data entry view that I'm laying out using
a TableView. Two cells per row. The left cell is a TextView label.
The right cell is an EditText
|
Mike R. |
Except one of the lines has 3 widgets: A TextView for the label, a TextView for a value, and an Image Button.
|
Mike R. | |
Mike R. |
it looks like this.
|
Mike R. |
The issue is the line labeled "Country"
|
Mark M. |
that's the Country line?
|
Mike R. |
yep
|
Mike R. |
As it's initially laid out, it looks ok
|
Mike R. |
When I get a value in there, it usually looks ok
|
Mike R. | |
Mike R. |
My problem is when the value is too long. It pushes the button right off the screen.
|
Mike R. | |
Mark M. |
solution #1: don't support the Congo
|
Mark M. |
:-)
|
Sep 14 | 8:10 PM |
Mike R. |
I wish I had a snappy come-back for that!
|
Mike R. |
Here's the layout.
|
Mike R. | |
Mike R. |
I've defined the TextView to be 1 line, and added an elipsis at the end
|
Mark M. |
OK
|
Mike R. |
I could probably get this through trial and error, but I figured I'd ask the expert.
|
Mark M. |
well, I can think of two possibilities
|
Mark M. |
the easy one to try is to have android:shrinkColumns="1" along with your android:stretchColumns="1", and hope for the best
|
Mark M. |
I'm skeptical that it'll work, though
|
Mark M. |
the second option is a bit more involved:
|
Mark M. |
Step #1: get rid of all your layout_span="2" attributes
|
Mark M. |
Step #2: Wrap your countryvalue and countrybutton in a RelativeLayout, to form a single child that goes in your 2nd column
|
Mark M. |
Step #3: Set up the countrybutton to be alignParentRight="true"
|
Mark M. |
Step #4: Set up the countryvalue to be alignParentLeft="true" and toLeftOf="@id/countrybutton"
|
Mark M. |
that more directly expresses the rule you're seeking
|
Mark M. |
yet another option would be to use a Spinner for
the country choice, but I'm guessing you thought of that and passed on
it for whatever reason
|
Sep 14 | 8:15 PM |
Mike R. |
I like the 2nd option. I have 240 countries in the list - the full ISO country list. Don't think a spinner would work as well.
|
Mike R. |
So, I'll try option 2. It does seem to best express what I'm trying to do. Thanks Mark
|
Mark M. |
no problem
|
Mark M. |
Julius: got another question?
|
Julius |
yes
|
Julius |
I'm having trouble with C2DM
|
Julius |
basically I have registered with the service,
tried using the documentation on the google dev site and then used the
info in the Adv book
|
Julius |
here is where I am:
|
Julius |
I have a button to start the process:
|
Julius |
View paste
|
Julius |
APP_REG_EMAIL is the email I got back in the email from Google
|
Julius |
View paste
|
Julius |
So I think that I need to name my Receiver C2DMReceiver in order for it to be called:
|
Julius |
C2DMReceiver
|
Julius |
I've tested in the emulator with Wireshark
|
Julius |
I can see traffic going to Google setting up the SSL but for some reason it's not coming back into the application.
|
Sep 14 | 8:20 PM |
Julius |
I'm guessing that the problem is that the message is coming back but not going to the Receiver
|
Julius |
but I can't be sure
|
Julius |
sorry for taking so long
|
Mark M. |
what's your manifest look like for that <receiver>?
|
Julius |
View paste
|
Julius |
View paste
|
Mark M. |
something is out of sync
|
Mark M. |
View paste
|
Julius |
ah
|
Mark M. |
at least in my code sample, C2DMReceiver is a Service, C2DMBroadcastReceiver is a BroadcastReceiver
|
Julius |
I have:
|
Julius | |
Mark M. |
OK
|
Mark M. |
that lines up
|
Julius |
which is one of your (useful) WakefulServiceIntents
|
Julius |
(just used oen of those the other day)
|
Mark M. |
when you do your push, are you getting a good response from the Google server?
|
Julius |
I can't do a push as I don't have a registrationI
|
Julius |
registrationId
|
Julius |
it's the registration part I'm having trouble with
|
Mark M. |
oh, I'm sorry, I misunderstood
|
Sep 14 | 8:25 PM |
Julius |
that is registration of the specific instance of the application (on the phone)
|
Mark M. |
when you wrote: "APP_REG_EMAIL is the email I got
back in the email from Google", do you mean that APP_REG_EMAIL is the
Google account you used for the C2DM signup?
|
Julius |
Google sends packets back, but they're in SSL so I can't see whether Google is happy with the registration
|
Julius |
yes it's the senderId
|
Julius |
sorry for not being clear
|
Mark M. |
not sure what the problem is, then
|
Julius |
so the manifest "looks" ok
|
Julius |
(I think I understand the whole process)
|
Mark M. |
I didn't have much difficulty with the registration -- all my troubles were on the actual push side
|
Julius |
heh
|
Mark M. |
yes, the manifest seems to line up with my example, modulo class name changes
|
Julius |
great something to look forward too
|
Julius |
to
|
Julius |
right
|
Julius |
ok I might just download your one from git and make tiny changes
|
Mark M. |
actually, you might want to just start with it verbatim
|
Mark M. |
if it works with your account, then you know your account is OK
|
Julius |
oh yes good plan
|
Mark M. |
:-(
|
Mark M. |
conversely, if it doesn't work with your account, either your account isn't set up right, or they broke my code
|
Julius |
:-/
|
Julius |
heheh
|
Julius |
It'll be me
|
Julius |
thank you for your time
|
Mark M. |
sure
|
Mark M. |
happy to help
|
Mark M. |
Max: got another question?
|
Max S. |
Is there a good tool for analytics / metrics that I
can plug into an Android App that will report anonymous usage
statistics like number of times app was run, what buttons were pressed
etc. It cannot display ads. Or is this something I would have to roll
my own for?
|
Mark M. |
There are a few
|
Mark M. |
I've used Flurry
|
Mark M. |
I think Medialets has their library available
|
Max S. |
Cost? Any reasons you chose Flurry?
|
Mark M. |
I suspect there's an open source implementation or two of the concept floating around
|
Mark M. |
the client wanted Flurry :-)
|
Sep 14 | 8:30 PM |
Mark M. |
Flurry is fine
|
dan t. | has entered the room |
Mark M. |
Personally, I'd want to do something that routed to my own server, but I'm just paranoid that way
|
Max S. |
OK, Ill check it out, when searching for open
source flavors is "analytics" the right word to search for (I hear you
with the tinfoil hat)
|
Mark M. |
bear in mind that none of these are fully
automatic -- it's more that they're logging frameworks with various
amounts of graphing and such on the server side
|
Mark M. |
it's not like they know automatically what events you want logged
|
Mark M. |
as a bonus, though, some offer exception logging, which is always great to have to collect crash data from the field
|
Max S. |
OK, you can move on to next question-thanks!
|
Mark M. |
howdy, dan t!
|
dan t. |
morning!
|
Mark M. |
Dan: do you have a question?
|
Julius |
(heh big dan)
|
dan t. |
nah just lurking for now ... just started reading the books...
|
Mark M. |
cool@
|
Mark M. |
er, cool!
|
Mark M. |
Mike: got another question?
|
Mark M. |
Julius: got another question?
|
Julius |
I'm good just got to learn how to use git - use svn usually
|
Mark M. |
there's also the Download Source button, upper right
|
Sep 14 | 8:35 PM |
Mark M. |
gives you your choice of ZIP or TAR
|
Julius |
oh thank you!
|
Mark M. |
yeah, I wish they'd make that button red or something
|
Mark M. |
not quite obvious enough IMHO
|
Mark M. |
anyway...
|
Mark M. |
Max: got another question?
|
Max S. |
You know what a wi-fi pay page is? Like if you
open yahoo.com in a browser while on wifi at Logan Airport and you get
redirected to a page to pay for internet access? Is there a way to
detect this in a webview? Its not exactly a 404--which I am also
curious about how to detect--Im not sure if there is a http header
associated with this kind of redirect ... and how to detect it.
|
Mark M. |
beats me
|
Max S. |
Do you know how to detect a 404 in a webview?
|
Mark M. |
short of experimenting with a desktop browser and good debugging tools, I'm not sure how you'd find out
|
Mark M. |
Implement a WebViewClient
|
Mark M. |
I think onReceivedError() will be called on a 404
|
Mark M. |
attach it via setWebViewClient() on the WebView
|
Mark M. |
yeah, onReceivedError() looks like it should work
|
Max S. |
OK, I can overload that, I already have a custom
webview client to hide the URL bar, so that should be pretty easy, and
I'll bring wireshark to starbucks to try and figure out the other part,
thanks ... I have more if we get back to me :)
|
Mark M. |
BTW, I'll be rather surprised if there's an industry standard for those feed-me-Seymour pay WiFi pages
|
Max S. |
One thing I have thought of is to detect the
incoming url and compare it to what I requested, you can move on, that
was really helpful, thanks!
|
Sep 14 | 8:40 PM |
Mark M. |
If anyone else has a question, pipe up, otherwise we'll keep working through Max's list
|
Mark M. |
Max: in the meantime, go ahead
|
Max S. |
I am out of "easy" questions. My next one is about
making a sliding container, here is a rough cut of the issue, maybe you
can steer me in the best direction ...
|
Max S. |
View paste
|
Julius |
(Mark: your code works - thanks)
|
Mark M. |
um, you have a lot of stuff in there
|
Mark M. |
let me ask for a few clarifications:
|
Mark M. |
1. What is "a preference icon"?
|
Mike R. | has left the room |
Mark M. |
2. Is this a single activity or two activities?
|
Max S. |
Its not important, but it is a i button (like
"info"), it is an imageview with an onclick the icon is from the android
source ic_menu_info_details.png, but that is neither here nor there
|
Max S. |
It is two activities (I think I confused View with
Activity), but I am open to making it one if that is preferable (do I
hide elements?)
|
Mark M. |
this will be easier if you have all this in a single activity
|
Mark M. |
I have an example of what you're seeking in The Busy Coder's Guide to Advanced Android Development
|
Mark M. |
chapter on Animations
|
Sep 14 | 8:45 PM |
Mark M. |
I demonstrate a custom View that is a sliding panel, sliding up from the bottom and sliding back down on demand
|
Mark M. |
should be relatively easy to modify to suit your needs (or, as easy as anything is with animations)
|
Max S. |
Is it possible with multiple activities? The
reason I ask is that there are many screens with this button and I think
it will make the code harder to maintain if I put it all into one
activity. But if I have to, I will ...
|
Mark M. |
not really
|
Mark M. |
well, change that
|
Mark M. |
I'm not sure if somehow using a transparent background for the 2nd activity will help
|
Mark M. |
it's not out of the question
|
Mark M. |
but I've never really fussed with custom inter-activity animations, so I don't know the limits, tricks, etc.
|
Max S. |
Have you seen that black screen problem before, based on the SDK docs I thought I set it up correctly but could not get past it.
|
Mark M. |
without seeing it, I'm not quite sure what effect you're describing, sorry
|
Max S. |
Ill come back Thursday with screen shots now that I
have seen how well those work (code too) if the problem persists. I
have one more question, its pretty easy, I think.
|
Mark M. |
go ahead
|
Max S. |
I recently discovered the icons in:
platforms/android-1.6/data/res/drawable but very few of them have
different states (pressed, etc.), any thoughts on this? Is there a good
free source for icons with states, or should I use some kind of custom
xml file with some color magic applied to the gray icons, or ... ?
|
Sep 14 | 8:50 PM |
Mark M. |
I am not aware of a "good free source for icons with states"
|
Mark M. |
in terms of "some color magic", I think ImageView has a tint option you could play with
|
Mark M. |
but that, of course, only works with ImageView
|
Mark M. |
right now, the "right" answer is "hire a graphic designer"
|
Max S. |
So is your typical use case to use graphic artist created icons? Would you say that is most common?
|
Mark M. |
point them to the icon design guidelines, and have your checkbook handy
|
Mark M. |
well, "most common" isn't to use states
|
Mark M. |
there are relatively few places you gotta gotta have those
|
Mark M. |
tab icons and backgrounds being two that come to mind
|
Max S. |
Oh, that is useful! OK.
|
Max S. |
backgrounds?
|
Mark M. |
what makes a Button look like a Button, for example, is a StateListDrawable
|
Mark M. |
which in turn points to a set of nine-patch PNG files
|
Mark M. |
and that's used as a background
|
Mark M. |
it's why if you use android:background="#FFFF0000" to make a button red, it no longer looks like a button
|
Max S. |
Book chapter reference for me to study up on?
|
Mark M. |
I have a bit on StateListDrawable in a Drawable chapter in the Advanced Android book, but I need to add a lot more
|
Max S. |
OK, that does it for me, really enjoy your books and this chat, thanks for your time!
|
Mark M. |
sure
|
Mark M. |
anyone else have any questions?
|
Julius |
yes
|
Julius |
quick one
|
Max S. |
Can I get a transcript of this?
|
Julius |
I have an application which I would like to be
able to use the move to the SD Card functionality, but the application
is built for 1.6. If I want to do something like this, would I need to
have different versions of the code and deploy each separately?
|
Sep 14 | 8:55 PM |
Mark M. |
no, I think 1.6 will ignore the manifest attribute you would set for apps-to-SD
|
Mark M. |
you will need to use the 2.2 build tools
|
Mark M. |
but you can still set minSdkVersion to...ummm...4 (or whatever 1.6 is, I forget)
|
Julius |
so am I building against 2.2 but right
|
Julius |
ok
|
Julius |
thanks!
|
Mark M. |
be sure to review that list of "don't do apps-to-SD if you implement X" things
|
Julius |
oh ok will do
|
dan t. |
where is that list?
|
Mark M. |
In the App Install Location page, Dev Guide tab, developer.android.com (or your docs in your 2.2 SDK)
|
dan t. |
thx
|
Julius | |
Mark M. |
I'd cite a URL, but I'm rocking this chat on my Nexus One tether, courtesy of a craptacular Internet connection at this hotel
|
Julius |
(under Applications That Should NOT Install on External Storage - I'm guessing)
|
Mark M. |
yup, that's it
|
Mark M. |
unfortunately, it's a rather compelling list
|
Julius |
thank you once again
|
Julius |
yeah the first thing makes me think it's not an option
|
Julius |
but never know
|
Julius |
bye all
|
Julius | has left the room |
Mark M. |
any last questions?
|
Max S. |
Will this chat log be archived somewhere or can I get a transcript now?
|
Max S. |
Its not letting me copy more than one chat item at a time :(
|
Mark M. |
not sure if you can get a transcript from here (I can, but I'm the owner of the chat room)
|
Sep 14 | 9:00 PM |
Mark M. |
I send out links to transcripts to the cw-android Google Group
|
Max S. | has left the room |
Max S. |
Perfect, thanks and good night
|
dan t. |
thx
|
dan t. |
gn
|
Mark M. |
no problem!
|
dan t. | has left the room |
Mark M. | turned off guest access |