Jun 2 | 3:50 PM |
Mark M. | has entered the room |
Jun 2 | 3:55 PM |
Mark M. | turned on guest access |
Jun 2 | 4:00 PM |
Chris | has entered the room |
Mark M. |
howdy, Chris!
|
Chris |
Hey
|
Chris |
Man, I'm not prepared at all.
|
Chris |
and I'm at work.
|
Mark M. |
um, prepared for what?
|
Chris |
To ask questions
|
Mark M. |
there's no exam at the end of the chat
|
Mark M. |
:-)
|
Chris |
phew
|
Chris |
1 sec
|
Jun 2 | 4:05 PM |
Chris |
OK, so I just wanted to have an activity screen and for the summary to be set to the current value of the preference.
|
Chris |
View paste
|
Chris |
is that ok?
|
Chris |
It works, just wanted to see if that's the proper way.
|
Mark M. |
I'd use a different default than the empty string
|
Mark M. |
otherwise, that seems fine
|
Chris |
View paste
|
Chris |
OK, I can do that.
|
Mark M. |
your second code snippet will be invoked on every preference change, not just the "server" one
|
Mark M. |
if you have more than one preference, this will change the summary of those other preferences as well
|
Chris |
Yep, that's what I want.
|
Mark M. |
oh, OK
|
Chris |
Remember last week when I said that it seemed like
my app was only opening one connection then the remaining connections
would never reach the server?
|
Mark M. |
I barely remember what I had for breakfast this morning
|
Mark M. |
:-)
|
Chris |
View paste
|
Mark M. |
oh, well, that'll do it
|
Chris |
haha
|
Chris |
So I bumped it up to 10 and it works even if I issue repeated commands to the server
|
Jun 2 | 4:10 PM |
Chris |
So I'm not sure what the magic # is or how the client is handling connections.
|
Chris |
I was thinking that HttpClient would be like a web browser. I'd have one client open and go to sites repeatedly.
|
Chris |
I'm not sure how to like issue a request then close the connection.
|
Mark M. |
having a single HttpClient object is a typical pattern, particularly for helping to deal with session cookies
|
Chris |
Do I need to do a shutdown() after I'm done?
|
Chris |
then keep creating a new httpclient for request?
|
Mark M. |
if the server supports Keep-Alive, that will keep a socket open; otherwise, AFAIK, it will shut down right away
|
Chris |
Doesn't seem right.
|
Mark M. |
however, this is really a question for the Apache HttpClient guys, not me
|
Chris |
Hmm... OK
|
Chris |
all right
|
Mark M. |
out of curiosity, why are you setting BasicHttpParams in the first place?
|
Chris |
Because I don't know what I'm doing and I found it online :)
|
Chris |
I did try to not set it and it wouldn't work at all haha
|
Mark M. |
well, most code I've seen never uses it
|
Mark M. |
then again, most code I've seen may not behave like yours
|
Mark M. |
the default appears to be 20
|
Mark M. |
SyncManager specifically bumps it to 25
|
Chris |
Oh haha
|
Chris |
I'll mess with it again. Maybe I did something wrong.
|
Mark M. |
that's the only two references I see in the Android source code
|
Jun 2 | 4:15 PM |
Mark M. |
now, I don't know how many of the other Android apps use HttpClient vs. HttpURLConnection
|
Jun 2 | 4:15 PM |
Chris |
Yeah I'm not even sure of the difference. I did
want a google i/o video from last year about REST apps and they said to
use HttpClient instead of HttpURLConnection
|
Mark M. |
hehehe
|
Mark M. |
yeah, I saw that too
|
Chris |
But I've gotten the authentication to work and I'm able to manipulate things on the server.
|
Mark M. |
then, in February or March, a Googler popped up on StackOverflow and said the opposite
|
Chris |
Yeah, I imagine a lot can change in a year.
|
Mark M. |
the upshot that I got from I|O this year is that
HttpURLConnection has been improved, so it's probably a wash, unless
you're using SSL, in which case HttpURLConnection has some benefits
|
Chris |
I am using ssl
|
Mark M. |
let me see if I can find my notes on that...
|
Chris |
Well, I'm faking it now.
|
Chris |
Using EasySSLSocketFactory
|
Mark M. |
"HttpsURLConnection now supports TLS intolerance
like Chrome. TLS intolerance means it can cope with https servers (and
firewalls) out there that reject TLS connections and require a fallback
to SSL without compression to handshake at all."
|
Mark M. |
also, you may want to keep tabs on http://stackoverflow.com/questions/5358014…
|
Jun 2 | 4:20 PM |
Chris |
OK
|
Chris |
Man I updated my sdk stuff and now my emulator is huge and slow
|
Chris |
It used to be about the same size as my phone and was really quick.
|
Mark M. |
well, Android 3.x emulators are WXGA and are glacial, if that's what you mean
|
NetApex | has entered the room |
Mark M. |
howdy, NetApex!
|
NetApex |
Hello
|
NetApex |
Long time no see
|
Mark M. |
was just thinking the same thing
|
Mark M. |
how can I help you today?
|
NetApex |
I haven't had a chance to go through the new books
yet (life has been hectic) but I have been playing with the Samsung
tablet and now I want to really work on making tablet "aware" apps
|
NetApex |
How bad are they?
|
Jun 2 | 4:25 PM |
Mark M. |
the books aren't too bad
|
Mark M. |
always room for improvement
|
Mark M. |
or, what did you mean by "they"?
|
NetApex |
Heheh I meant making tablet friendly changes
|
Mark M. |
oh
|
NetApex |
essentially, fragments
|
Mark M. |
depending on the app, fragments may not be necessary to be tablet-friendly (e.g., games)
|
Mark M. |
fragments require a new way of thinking, and some of the advanced effects like you see in Gmail are under-documented
|
NetApex |
I took a look at the IO app and after a bit it
seemed to be pretty straight forward as long as you change your way of
thinking when it comes activities
|
Mark M. |
bingo
|
Mark M. |
IMHO, if Android was MVC, originally the activity was the C and the widgets were the V
|
NetApex |
I sometimes don't take well to change though lol
|
Mark M. |
now, fragments are the C, widgets are the V, and activities are more of an orchestration layer
|
Mark M. |
major UI events that affect other fragments/activities ripple up from the fragment to the activity
|
Mark M. |
because only the activity knows where the other fragment is (in same activity? in another activity?)
|
NetApex |
ok
|
Chris |
Gotta go, thanks Mark.
|
Chris | has left the room |
NetApex |
another question for ya (semi related... all going to the same app at least)
|
NetApex |
using the endless adapter
|
Jun 2 | 4:30 PM |
Mark M. |
ok
|
NetApex |
I have a couple people with wordpress websites
that have a json plugin. Makes it pretty easy to grab the data and toss
it into an app...
|
NetApex |
My issue is trying to pull it with the endless adapter/json and then actually be able to get an onclick working
|
Mark M. |
is it some sort of a "paged" URL scheme?
|
NetApex |
not sure what to reference since I had become so used to using a "tag" as a crutch basically
|
NetApex |
yes sir
|
Mark M. |
ok
|
Mark M. |
and you rolled your own BaseAdapter to wrap the JSON?
|
NetApex |
correct
|
NetApex |
actually another friend of mine did and finally helped me figure that part out
|
Mark M. |
and you're wrapping that JSONAdapter in an EndlessAdapter?
|
NetApex |
Trying to at least
|
NetApex |
I am pretty sure that I am screwing something up there as well
|
Mark M. |
when the user taps the list and onListItemClick()
is called, just use the position to get at the particular hunk o' JSON
in your adapter
|
NetApex |
I am at work now and had forgotten that you were having the session right now, otherwise I would have my info up right now
|
Jun 2 | 4:35 PM |
Mark M. |
yeah, I try to rotate times, to accommodate various schedules
|
Mark M. |
next evening one is Tuesday
|
Mark M. |
(evening Eastern Time, that is)
|
NetApex |
Ahh that easy? I was assuming it would have to specifically know the hoJ (hunk o'JSON) that was being called
|
Mark M. |
I suppose it depends on what you're using for the JSON parser
|
Mark M. |
if it's org.json.JSONArray, your JSON adapter presumably supports getItem() by accessing the Nth entry in the JSONArray
|
NetApex |
ok
|
Mark M. |
EndlessAdapter does not mess with the position, other than supporting one past your own adapter's getCount()
|
Julius | has entered the room |
Mark M. |
so, whatever position you get in onListItemClick() should be good
|
Mark M. |
howdy, Julius!
|
NetApex |
ahh ok cool
|
NetApex |
That makes things good
|
Julius |
Hiya
|
Jun 2 | 4:40 PM |
NetApex |
The floor is yours Julius
|
Julius |
:) thanks!
|
Julius |
I have a question about ant
|
Mark M. |
small insect
|
Julius |
I have a project which is a library and I build multiple versions of the application for different brands
|
Mark M. |
ok
|
Julius |
what I was wondering is whether ant might be the way to go to be able to build all at once
|
Julius |
(rather than building each in Eclipse)
|
Mark M. |
sure
|
fitz | has entered the room |
Julius |
(PS - I don't know much about ant, but have edited the odd build.xml with vi)
|
Mark M. |
you'd have two main approaches:
|
Mark M. |
in both cases, you just set up the Ant scripts for
each non-library project via android project update -p . (where . is
the path to the project)
|
Julius |
wow that soudns simple
|
Mark M. |
whether you have the top-level "build 'em all"
script be an Ant script itself (option #1) or something else like a
batch file/shell script (option #2) is up to you
|
Mark M. |
you probably will have to tweak the
default.properties file for each top-level project to reference the
library project, per the Android docs
|
Mark M. | |
Mark M. |
but, again, that's a one-time deal
|
Julius |
cool thank you
|
Mark M. |
most, if not all, of my CWAC projects up on my github repo are set up to build the demo/ app, using the library project, by Ant
|
Mark M. |
I've added a few extra Ant tasks for things like creating JAR files (where relevant)
|
Julius |
(yeah that's what I understood!)
|
Mark M. |
howdy, fitz!
|
fitz |
Hello - Mark you work with Marakana training? looked at there classes and ouch some $'s
|
Jun 2 | 4:45 PM |
Mark M. |
yes, I work with Marakana training, and, yes, it's mostly aimed at corporations
|
Mark M. |
admittedly, not cheap
|
Mark M. |
I've done the occasional thing with a user group, though
|
Mark M. |
a lot of that is Marakana markup
|
fitz |
ya actually saw them through http://www.sfandroid.org/#upcoming
|
fitz |
was thinking of going to a meetup they have
|
Mark M. |
yeah, Marakana does a fair bit for the local Android community, particularly downtown SF (vs. the rest of the Valley)
|
fitz |
went last night to Google meetup for GTUG - was
good insight to tablet stuff - should we be looking at HTCdev or will
all android dev work outside of what HTC does?
|
Mark M. |
well, HTCdev is pretty nascent
|
Mark M. |
as it "sign up and we'll send you an email when we're ready" from what I saw
|
fitz |
ok so not much to concern ourselves with yet
|
Mark M. |
I suspect that they'll be publishing SDK add-ons to get to HTC-specific stuff, like MOTODEV does for MOTOPHONES
|
Jun 2 | 4:50 PM |
Mark M. |
and, with luck, HTC will have their own support boards for HTC-specific issues, akin to the ones run by MOTODEV
|
Jun 2 | 4:50 PM |
Mark M. |
I've had discussions with HTC regarding developer programs -- suffice it to say that this has been in the works for a long while
|
fitz |
ok - not up on motodev - installed in on eclipse a
few months back and it got real ugly real fast - maybe again someday
when I need it
|
Mark M. |
MOTODEV is the developer program
|
fitz |
for now just still a babe-in-the-woods
|
Mark M. |
MOTODEV Studio for Android is the Eclipse+ADT enhancement package
|
fitz |
ya I have seen it
|
fitz |
they have some plgin for eclipse
|
fitz |
plugin :)
|
Mark M. |
we're starting to run low on time -- any questions from anyone?
|
Julius |
I have one... :)
|
Mark M. |
go ahead
|
fitz |
ok sorry - will stop babbling
|
Julius |
I was wondering if anyone knew how to add a website as an extra to an intent which is adding a contact
|
Julius |
:D
|
Julius |
(hope that made sense)
|
Mark M. |
personally, I haven't a clue
|
Mark M. |
haven't really looked
|
Julius |
I'm also having trouble specifying the city too
|
Julius |
np - it's probably one of those really specific things
|
Julius |
View paste
|
fitz | has left the room |
Mark M. |
I don't think that's possible
|
Jun 2 | 4:55 PM |
Mark M. |
I think you'll get a duplicate class error at compile time
|
Julius |
I' guessing I'm going to have to do soem kind of branching on my svn server
|
Julius |
(of the library)
|
Mark M. |
back to your contacts question
|
Mark M. |
if you are using ACTION_INSERT, it doesn't appear that there's a documented way to add a Web URL
|
Mark M. |
city, in theory, should go somewhere in ContactsContract.Insert.POSTAL
|
Mark M. |
but, again, I haven't tried that
|
Mark M. |
I've only done simple name stuff, in the one Advanced Android sample
|
Julius |
I think I was trying: ContactsContract.CommonDataKinds.StructuredPostal.CITY
|
Julius |
no worries
|
Mark M. |
I think that's how you read it out
|
Mark M. |
ContactsContract.Insert is what ACTION_INSERT supports for inbound
|
Mark M. |
NetApex: any last questions?
|
Julius |
(ah!)
|
NetApex |
nnot I
|
Julius |
(thanks for all the help - good to meet you at IO!)
|
Julius |
have a good day all!
|
NetApex |
You too
|
Mark M. |
you too!
|
Julius | has left the room |
NetApex |
The crowd was just too big for me to catch you there
|
Jun 2 | 5:00 PM |
Mark M. |
yeah, tough to just bump into somebody when you're constantly bumping into somebody
|
Mark M. |
or bumping into robots
|
NetApex |
hehe
|
NetApex |
alright man, have a good one
|
Mark M. |
anyway, that's a wrap for today
|
Mark M. |
you too!
|
Mark M. |
catch you later!
|
NetApex | has left the room |
Mark M. | turned off guest access |