Mark M. | has entered the room |
Mark M. | turned on guest access |
Jun 22 | 8:00 PM |
Julius | has entered the room |
Julius |
hi
|
Mark M. |
howdy, Julius!
|
Julius |
just have a quick (hopefully) question
|
Mark M. |
go right ahead!
|
Julius |
I'm getting an ANR and not quite sure why although
I know the lone
|
Julius |
line
|
Julius |
so I'm doing this:
|
Jun 22 | 8:05 PM |
Julius | |
Julius |
thet way I have done this is I have a Service
|
Ron B. | has entered the room |
Julius |
and the Service runs a Thread
|
Julius |
and the Service updates Activities based on what's
happening
|
Mark M. |
OK
|
Mark M. |
(btw, howdy, Ron!)
|
Julius |
so the interface is responsive
|
Julius |
it's not like it's stopping
|
Julius |
but occasionaly I get an ANR
|
Ron B. |
Hi Mark
|
Mark M. |
ANR dialog?
|
Julius |
one thing I can control is potentially to parse a
smaller amount of xml
|
Julius |
but I figure maybe there's a better way
|
Julius |
ah yes
|
Mark M. |
on what thread are you parsing the XML?
|
Julius |
one that I have started in the Service
|
Mark M. |
then it is not the cause of your ANR, at least not
directly
|
Mark M. |
ANRs are purely from work done on the main
application thread
|
Julius |
oh
|
Julius |
so it's just running at the same time perhaps
|
Julius |
(why I'm seeing it mentioned in the traces.txt)
|
Mark M. |
most likely
|
Mark M. |
BTW, any reason you're forking your own Thread,
versus using an AsyncTask?
|
Julius |
I've had a play with the TraceViewer
|
Julius |
oh
|
Julius |
no I'm not familiar with AsyncTask...
|
Jun 22 | 8:10 PM |
Mark M. |
android.os.AsyncTask
|
Julius |
:)
|
Julius |
ok I'll check it out
|
Mark M. |
covered in the Threads chapter in The Busy Coder's
Guide to Android Development
|
Ron B. |
Hi Mark,Should be a quick one. I'm trying to set a
required time for a user touch to activate a button or list element.
Say 10 seconds before calling 911 so it doesn't go off accidentally. Wh
|
Julius |
ah ok I'll check that out
|
Mark M. |
great for parsing jobs and stuff like that
|
Julius |
ok thanks
|
Ron B. |
Sorry, hit send too early
|
Julius |
hi Ron, will let you ask :)
|
Julius |
np
|
Julius |
bfn
|
Julius |
thank you Mark!
|
Mark M. |
Julius: happy to help!
|
Mark M. |
Ron B.: want to try that question again?
|
Ron B. |
Hi Mark,Should be a quick one. I'm trying to set a
required time for a user touch to activate a button or list element.
Say 10 seconds before calling 911 so it doesn't go off accidentally.
Where would I find the setting to make that happen?
|
Julius | has left the room |
Mark M. |
Setting?
|
Mark M. |
let's back up a step
|
Mark M. |
what do you mean by "required time for a user
touch to activate a button or list element"?
|
Ron B. |
Well, a class or method, etc.
|
Ron B. |
I know how to make a call programmatically. I
want it to happen when the user presses an emergency key.
|
Mark M. |
what do you mean by "required time for a user
touch to activate a button or list element"?
|
Jun 22 | 8:15 PM |
Ron B. |
I don't want the call to go off by accident, since
it's a 911 call. So I want the user to press and hold for 10 seconds
or so before the call is made.
|
Jun 22 | 8:15 PM |
Mark M. |
If you're trying to change the time it takes for
onClick() to react, I doubt that is possible.
|
Mark M. |
Certainly, I don't know where to change it
|
Mark M. |
you'd want to look at onTouchEvent() and handle it
at a lower level
|
Mark M. |
perhaps not using a true Button, but an ImageView
or something
|
Ron B. |
OK, thanks!
|
Mark M. |
any other questions?
|
Ron B. |
Not from me, have a good evening
|
Mark M. |
you too!
|
Ron B. | has left the room |
Jun 22 | 8:20 PM |
JonnyG | has entered the room |
Mark M. |
howdy, Jonny!
|
JonnyG |
Heya Mark.
|
JonnyG |
been trying to catch one of these chats, but
foiled by the time zones!
|
Mark M. |
sorry
|
Mark M. |
normally, they are Tuesday evening and Thursday
morning, US Eastern
|
Mark M. |
varies sometimes based on my schedule
|
JonnyG |
No worries. Should've checked first. Good to know.
|
Mark M. |
how can I help you?
|
JonnyG |
I just started Android development - disgruntled
iPhone dev - and your books have been a great help so far...
|
Mark M. |
glad to hear they're useful!
|
JonnyG |
I'm just starting to read about animations and how
to apply them to views
|
Mark M. |
wow, diving into the deep end early
|
Mark M. |
:-)
|
JonnyG |
and I've played around with layout animation
controllers in a GridView and ListView
|
Jun 22 | 8:25 PM |
JonnyG |
but, what I'm trying to do is animate only the
addition of new data to my Adapters, if that makes sense, and I'm hoping
you can point me in the right direction for where to be dealing with
this code
|
Mark M. |
that is so much in the deep end, you've made your
own pool
|
JonnyG |
hah! i bet
|
Mark M. |
I would have absolutely no idea where to begin on
that
|
Mark M. |
animation of simple views and containers (as a
whole) is as far as I've gone
|
Mark M. |
the concept of animating the addition of something
to an AdapterView...I suppose it's possible, but I don't have the
slightest idea how to approach it
|
JonnyG |
ok, well that's lower on my list of things to
tackle, so I'll keep plowing through. Not even necessary for my app.
Just a nice little bit of sheen.
|
Mark M. |
yeah, I can imagine the effect would be rather
striking, done right
|
Jun 22 | 8:30 PM |
JonnyG |
i think i have a couple more questions for you, if
I can figure out how to ask them =)
|
Mark M. |
anything else I can try to help you with?
|
Mark M. |
take your time -- as you can see, it's a quiet
night in the chat
|
Mark M. |
two others were here, got answers, and departed
|
JonnyG |
I'm using your SimpleWebCache to load images from
the web and I'm finding that, depending on the host, the loading can
hang forever. I've pulled the source for SimpleWebCache into my project
and modified it to be able to set a configurable ConnectionTimeout and
ReadTimeout. A) Can you think of any problems that could arise from
setting these timeouts and B) are there any Android "System" properties
that I can set to achieve this without either modifying source or
extending the SimpleWebCache?
|
Mark M. |
A) If they work for you, they should be OK
|
Mark M. |
B) No, sorry
|
Mark M. |
C) SimpleWebCache is a nasty piece of code that I
need to rewrite someday
|
Jun 22 | 8:35 PM |
JonnyG |
one of the things I'm looking at is to have a
different AsyncTask (or AsyncTaskEx) for reading the images from either
level of the cache and having a different one for loading from the Web.
I'm still trying to figure out exactly what AsyncEx is doing.
|
JonnyG |
because the web loading is holding up loading from
cache (i've got a bunch of thumbnails on the screen at once)
|
JonnyG |
but, i haven't really dove in that far yet to see
what's happening
|
Mark M. |
AsyncTaskEx was there to deal with the fact that
AsyncTask originally only handled one operation at a time and could not
handle a queue of more than 10 pending tasks
|
Mark M. |
newer versions of AsyncTask are better
|
Mark M. |
if you are only supporting Android 2.x, you
probably do not need AsyncTaskEx
|
JonnyG |
ah, ok, gotcha. I'm shooting for 1.5 or 1.6, but
that may change. I've certainly found other things I want from 2.x.
|
Jun 22 | 8:40 PM |
JonnyG |
alright, well, I think I'll go play around in
AsyncTask land and try and crack that nut. Thanks for your time, Mark,
and the great books!
|
Mark M. |
you're very welcome!
|
JonnyG |
night!
|
JonnyG | has left the room |
Jun 22 | 8:45 PM |
Mark J. | has entered the room |
Mark J. |
Heya Mark
|
Mark J. |
I couldn't leave you here alone! :)
|
Mark M. |
howdy, Mark!
|
Mark M. |
actually, three others were here and gone earlier
|
Mark M. |
how can I help you?
|
Mark J. |
Well, I am just somewhat here to chat, and
somewhat here for questions
|
Mark J. |
If nobody else is here
|
Mark M. |
well, the floor is yours
|
Mark J. |
Well, just wanted to say, nice job! I walked into a
Barnes & Noble today and saw all of your Android books :)
|
Mark M. |
All?
|
Jun 22 | 8:50 PM |
Mark M. |
more than _Beginning Android 2_?
|
Jun 22 | 8:50 PM |
Mark J. |
Maybe not All, But I saw 2? Maybe 3?
|
Mark M. |
the ones with the CommonsWare imprint aren't
usually carried in bricks-and-mortar bookstores
|
Mark M. |
mostly because I don't accept returns
|
Mark M. |
hence, I'm surprised if you saw more than the
Apress _Beginning Android 2_ on the shelf
|
Mark J. |
They weren't the ones here at commonware. But they
were from Apress
|
Mark M. |
well, I did _Beginning Android_, replaced by
_Beginning Android 2_
|
Mark M. |
both of which are Apress' branded version of _The
Busy Coder's Guide to Android Development_
|
Mark M. | |
Mark J. |
Ahh, yes. Just a link to the store, and where I
found them
|
Mark J. | |
Mark M. |
ah, online they're available
|
Mark M. |
most online bookstores carry them
|
Mark M. |
just not the kind you walk into
|
Mark J. |
Though, I guess I only saw the Beginning Android
and Beginning Android 2 were the ones I saw
|
Mark J. |
Well, before your time runs up I do have a quick
question
|
Mark M. |
go ahead!
|
Jun 22 | 8:55 PM |
Mark J. |
I am looking for an easy way to background an RSS
reader before it displays the info. My current work has it so that the
application is frozen the entire time until it has finished retrieving
the content
|
Mark J. |
Do you know of somewhere I can read up on this
|
Mark M. |
uh, well, what exactly do you mean by "background
an RSS reader"?
|
Mark J. |
I want the downloading of the content to happen in
the background while my UI is still operating
|
Mark J. |
As it is now, the application "Halts" while it
waits for the content
|
Mark M. |
OK
|
Mark J. |
Did I explain enough?
|
Mark M. |
first, you're going to need to move the fetching
and parsing off the main application thread
|
Mark J. |
Okay
|
Mark M. |
to do that, you can use AsyncTask, covered in the
Threads chapter of The Busy Coder's Guide to Android Development
|
Mark M. |
your choice then is whether to have your reader
activity do the task, or have it managed by a service
|
Mark J. |
Sweet, is pretty much everything I need covered in
that chapter?
|
Mark M. |
if you have the activity do it, you will need to
think about orientation changes -- there's a new section on this in the
latest edition of The Busy Coder's Guide to Android Development
|
Mark J. |
As far as the threads?
|
Mark M. |
yes
|
Mark M. |
if you want to have a service do it, that's
covered in the services chapter of The Busy Coder's Guide to Android
Development
|
Mark J. |
Alright I will take a look at both of them later
this evening
|
Jun 22 | 9:00 PM |
Mark J. |
Well, from now on, I will attempt to hop in here
every session and at least chat and ask questions
|
Mark J. |
To help out the crowd :)
|
Mark M. |
hey, last week in this time slot, I had 8 people
|
Mark M. |
actually a bit difficult to get everyone's
questions answered
|
Mark M. |
so, it comes and goes
|
Mark M. |
you're certainly welcome to swing by, but it's
rarely lonely for an extended period
|
Mark J. |
Sweet :) I will try and make every single one, I
love that you added the schedule to Google Calendar
|
Mark M. |
yeah, I don't schedule too far in advance, in case
of travel changes
|
Mark M. |
I usually try to keep two chats outstanding
|
Mark M. |
for example, I just updated the schedule for next
Tuesday's chat -- oddball time, courtesy of a training event in Portugal
|
Mark J. |
Ahh alrighty
|
Mark J. |
One last question for you
|
Mark J. |
Is all of the work you do related to Android?
|
Mark M. |
Well, I vacuum the condo from time to time
|
Mark M. |
:-)
|
Mark J. |
:-) Sometimes you have to!
|
Mark M. |
I do development in Ruby on some side projects
|
Jun 22 | 9:05 PM |
Mark M. |
primary focus nowadays is Android
|
Mark M. |
more than enough to keep me busy
|
Mark M. |
anyway, that's all for this evening's chat
|
Mark J. |
Okay, well if your time is coming to an end, you
may end the chat. Though I will be here next time to hang out, and ask
questions if anything comes around
|
Mark J. |
Have a good evening Mark
|
Mark M. |
thanks, and have a pleasant evening!
|
Mark J. | has left the room |
Mark M. | turned off guest access |