Jul 8 | 9:55 AM |
Mark M. | has entered the room |
Mark M. | turned on guest access |
Stefan D. | has entered the room |
Mark M. |
howdy, Stefan!
|
Stefan D. |
howdy Mark
|
Stefan D. |
I am the time zone messy
|
Jul 8 | 10:00 AM |
Stefan D. |
may i start?
|
Mark M. |
but you are here now, and that is what matters
|
Mark M. |
go right head!
|
Mark M. |
er, ahead!
|
Stefan D. |
thanks
|
Stefan D. |
so maybe you wanna have a look at the
"architecture" of my app: http://img713.imageshack.us/img713/4165/ar…
|
Stefan D. |
basically i am using an App Widget as an entry
point to launch two different apps
|
Mark M. |
A and B are triggered by clicks?
|
Stefan D. |
they are independent from oneanotherd
|
Stefan D. |
yes
|
Stefan D. | |
Stefan D. |
thats what the app widget looks like
|
CalvinS | has entered the room |
Mark M. |
that's mighty big
|
Mark M. |
(BTW, howdy, Calvin!)
|
Stefan D. |
Activity A is launched by the 2 buttons under core
questions
|
Stefan D. |
it is intended to be big ;)
|
CalvinS |
Hi!
|
Stefan D. |
Activity B would be accessible via button under
Trigger task(s)
|
Mark M. |
ok
|
Stefan D. |
the ? icon is a button as well
|
Stefan D. |
they start a Dialog (as an activity with dialog
theme)
|
Stefan D. |
here comes the problem:
|
Stefan D. |
sometimes the PendingIntents attached to the
buttons get mixed up
|
Stefan D. |
After coming back from Activity B a click on a
core question button might take you back to Activity B, instead of A
|
Marc T. | has entered the room |
Marc T. |
hi everybody
|
Stefan D. |
or the ? buttons display not the corresponding
help text
|
Jul 8 | 10:05 AM |
Mark M. |
Stefan: your PendingIntents probably are wrapping
Intents that are not sufficiently distinct
|
Stefan D. |
so I am gessing that either the Pending Intents
have to canceled (pendingIntent.cancel() )
|
Mark M. |
(btw, howdy, Marc T!)
|
Stefan D. |
ok
|
Stefan D. |
I use explicit intents
|
Stefan D. |
And Activity A and B are entirely distinct
applications
|
Stefan D. |
or Activities wrapped into the same app
|
Stefan D. |
so how about canceling the PendingIntents? I
create new PendingIntents on each AppWidget update
|
Mark M. |
use FLAG_UPDATE_CURRENT or FLAG_CANCEL_CURRENT
|
Stefan D. |
so now if created an ArrayList and add all
PendingIntents to that list
|
Mark M. |
when you create the PendingIntents
|
Stefan D. |
as an extra to the wrapped Intent?
|
Stefan D. |
flag, i mean
|
Mark M. |
no, FLAG_UPDATE_CURRENT and FLAG_CANCEL_CURRENT
are flags you pass to getActivity()
|
Mark M. |
when you create the PendingIntents
|
Mark M. | |
Ted | has entered the room |
Mark M. | |
Mike R. | has entered the room |
Stefan D. |
ok
|
Mike R. |
Hello
|
Stefan D. |
is there any chance that my manifest is set up
badly?
|
Mark M. |
howdy, Ted and Mike R -- you are in line after
CalvinS and Marc T
|
Stefan D. |
could the manifest cause this behaviour?
|
Mark M. |
Stefan: possibly, but I'd start with the
PendingIntents
|
Jul 8 | 10:10 AM |
Stefan D. |
ok. last question: does canceling the
PendingIntents before creating new ones have an effect?
|
Mark M. |
it should be identical to FLAG_CANCEL_CURRENT
|
Mark M. |
which is why I am steering you in the direction of
using those flags
|
Stefan D. |
ok, thanks a lot.
|
Stefan D. |
others, go ahead
|
Mark M. |
ok, CalvinS -- do you have a question?
|
CalvinS |
View paste
|
Mark M. |
no, sorry, I have not played with list filtering
yet
|
CalvinS |
ok
|
Mark M. |
don't know much about it
|
Mark M. |
OK, Marc T -- do you have a question?
|
Ted | has left the room |
Mark M. |
OK, we'll get back to Marc T in a bit...
|
Mark M. |
and with Ted now gone...
|
Mark M. |
Mike R: do you have a question?
|
Mark M. |
besides "will LeBron wind up with the Nets?" :-)
|
Jul 8 | 10:15 AM |
Mark M. |
tap...tap...tap... is this thing on?
|
Marc T. |
just want to ask if you have plans on publishing a
book about NDK dev't. Most of my dev't on android for the past few
months are on NDK
|
Mark M. |
Marc T: there will be chapters on the NDK in
_Android Beyond Java_
|
Mark M. |
however, if you have been working with the NDK for
"the past few months", you know more about the NDK than I do, most
likely
|
Marc T. |
:) not really..just hacking a few things here and
there
|
Mark M. |
yeah, well, you assume I've done much more than
that... :-)
|
Robert C. | has entered the room |
Marc T. |
even if I've been coding android stuff for more
than a year, I still subscribe and look at your book from time to time
|
Mark M. |
glad to hear it!
|
Mark M. |
howdy, Robert C!
|
Robert C. |
hi Mark
|
Mark M. |
since Mike R seems to be away from his browser...
|
Mark M. |
Robert C: do you have a question?
|
Mike R. |
oh i'm back
|
Mark M. |
OK, Mike R: do *you* have a question?
|
Jul 8 | 10:20 AM |
Mike R. |
yeah. starting getting crash reports and have one
I can't figure out.
|
Mike R. |
looks like this:
|
Mike R. |
View paste
(35 more lines)
|
Mark M. |
Is the v1.1 coming from your app, or indicating
this is Android 1.1?
|
Mike R. |
1.1 is my app
|
Mark M. |
looking at the source code for ActivityThread and
performResumeActivity()...
|
Mark M. |
tough to decipher, particularly with a head cold
|
Mark M. |
feels as though maybe the activity that called
startActivityForResult() was destroyed, and they are having difficulty
recreating it
|
Mark M. |
does this exception happen often?
|
Mike R. |
So far, i've gotten one report. the app method
that's being called is:
|
Mark M. |
I see "1 reports" for this week
|
Mike R. |
View paste
(13 more lines)
|
Jul 8 | 10:25 AM |
Mark M. |
I wouldn't worry about it too much, if it only
happened once, and there's no obvious tie to your code
|
Mark M. |
Android is a complex system and certainly has bugs
|
Mike R. |
ok thanks. i have another question, but I'll let
others get in first
|
Mark M. |
if it keeps repeating, see if you can glean any
commonalities about environment (e.g., only older phones with less RAM)
|
Mark M. |
OK, Robert C: do you have a question?
|
Robert C. |
yes, thanks
|
Robert C. |
I'm still working the wifi dropping problem.
|
Robert C. |
I found that if I turn it off and just use the 3G,
the player will go on forever.
|
Robert C. |
That is exactly what we want.
|
Robert C. |
If WiFi is turned on though, the phone eventually
shuts it down and we loose our connection to the audio stream.
|
Robert C. |
I've tried everything I can think of to keep WiFi
on but it still cuts out.
|
Mark M. |
and you're holding a WifiLock?
|
Robert C. |
Most definitely.
|
Robert C. |
When I wake the phone back up, the code tries to
regain a lock.
|
Mark M. |
are you also holding a WakeLock?
|
Robert C. |
In that code, it determines that it already has a
lock and so skips asking for another one.
|
Robert C. |
I tried that as well and it had no effect.
|
Robert C. |
I'm starting to think the phone or platform is to
blame.
|
Mark M. |
if you are holding a WakeLock, and the device is
going to sleep, you have a fundamental problem
|
Mark M. |
you might experiment with different WakeLock types
|
Robert C. |
The screen locks and then after 30 seconds the
WiFi goes away.
|
Robert C. |
So your call is that the lock should work no
matter what?
|
Robert C. |
I could try with the strongest one and see what
happens.
|
Mark M. |
well, the WakeLock should at least keep the CPU
running.
|
Jul 8 | 10:30 AM |
Mark M. |
however, PARTIAL_WAKE_LOCK gives no visible
indication of whether the WakeLock is indeed working, since the screen
goes dark in either case
|
Mark M. |
you could try SCREEN_DIM_WAKE_LOCK
|
Robert C. |
Yes, but I didn't see that as a problem. It was
the Wifi cutting out. As I said, if the phone is using 3G, then the
application will run for hours and not loose the audio stream.
|
Mark M. |
yes, but I think there may be different power
behavior characteristics for network access over 3G
|
Robert C. |
I'll try different settings, but we really want to
screen to go dark and be completely off.
|
Mark M. |
understood
|
Mark M. |
however, right now, you need to figure out whether
your phone is busted :-)
|
Robert C. |
Do you know of a way to cut back to 3G if the WiFi
goes out?
|
Robert C. |
:)
|
Mark M. |
drop and re-establish your connection
|
Robert C. |
HTC Incredible by the way.
|
Robert C. |
So detect the drop and then retry it?
|
Mark M. |
yes
|
Mark M. |
off chance you may need to delay the retry by some
number of milliseconds
|
Robert C. |
That could work if I can detect it properly.
Thanks. I have a few things to try at least. :)
|
Mark M. |
not sure how quickly 3G gets re-established
|
Mark M. |
I think there are broadcast Intents from either
ConnectivityManager or WifiManager that may help
|
Robert C. |
Well, the music gets buffered for 30 seconds I
believe by the MediaPlayer. That means I have plenty of time to get a
connection back.
|
Mark M. |
but it is pretty strange that an active WakeLock
and WifiLock are giving you the phenomena you are seeing
|
Robert C. |
I like that idea as well. I'll see if
ConnectivityManager can tell me something.
|
Robert C. |
That is why I think it is the HTC Incredible but
I'm hoping not.
|
Mark M. |
well, I know of other bugs in the Incredible
|
Mark M. |
so it's certainly not out of the question to be
HTC's fault
|
Robert C. |
Do you have a list of those bugs somewhere? Would
be very interested to look at them and make sure something else in the
program is not affected.
|
Mark M. |
the only one I'm sure of is that you cannot use
the number field on Notification
|
Jul 8 | 10:35 AM |
Mark M. |
it will not draw the number in the red dot over
your status bar icon
|
Mark M. |
on Incredible or EVO 4G
|
Mark M. |
amply demonstrated by the sample code in my first
book
|
Robert C. |
I don't think that will be a problem for us.
Thanks for the help!
|
Mark M. |
I seem to recall other Incredible-related
complaints on [android-developers], but my cold is making it difficult
for me to think
|
Mark M. |
OK...Stefan: do you have another question?
|
Marc T. |
hmm can i ask a question while stefan is away (?)
|
Mark M. |
hang on
|
Mark M. |
CalvinS: do you have another question?
|
Mark M. |
OK, Marc T -- go ahead
|
Jul 8 | 10:40 AM |
Marc T. |
yeah, just wondering how the Youtube widget and
NEws & weather widget made their text animate? AlarmManager
triggering the service every X seconds?
|
Mark M. |
possibly
|
Mark M. |
also, they might not be app widgets
|
Mark M. |
we don't have the source for those
|
Mark M. |
they could actually be features of the home screen
|
Marc T. |
but home screen is open source right?
|
Stefan D. |
I'd have another question if noone else will join.
But people who haven't had their shot are 1st
|
Mark M. |
depends on which home screen it is
|
Mark M. |
I have not used the YouTube widget
|
Mark M. |
the News/Weather widget is probably just
AlarmManager
|
Marc T. |
hmm, ok. thanks. Will just try that approach
|
Mark M. |
Stefan: go ahead
|
Stefan D. |
alrighty
|
Stefan D. |
I have an activity which is a modification from
the ApiDemos' FingerPaint
|
Stefan D. |
It combines taking a picture and drawing on that
photo afterwards
|
Stefan D. |
but I fail at handling bitmaps properly
|
Jul 8 | 10:45 AM |
Stefan D. |
I need to create a pretty small bmp from the jpg
for 2 reasons:
|
Stefan D. |
1. a 5MP photo as a bitmap will not make the
memory happy, to put it nicely
|
Stefan D. |
2. the image has to be scaled to the screen so a
user can view the entire photo
|
Stefan D. |
that is the more important thing
|
Stefan D. |
so what I am trying to do is maintaining the
actual image size (e.g. 5MP) and just scale the finger's drawing. And it
will have to merged into one image. any hints?
|
Mark M. |
what happens after the image is merged?
|
Stefan D. |
right now I am using the bitmap inside of a canvas
|
Stefan D. |
it will be transfered to a server
|
Mark M. |
your server?
|
Stefan D. |
yes
|
Mark M. |
do the merge there
|
Mark M. |
much more CPU power
|
Mark M. |
much better tools
|
Stefan D. |
interesting
|
Stefan D. |
automated?
|
Mark M. |
presumably
|
Stefan D. |
what kind of data would my server require?
|
Stefan D. |
what would it expect?
|
Stefan D. |
2 seperate images?
|
Mark M. |
the photo, the drawing, and details on how the
drawing should be upsized to do the merge
|
Mark M. |
plus any info you need for what the server should
do with the result
|
Stefan D. |
sure
|
Jul 8 | 10:50 AM |
Stefan D. |
how about that upsizing point?
|
Mark M. |
inverse of whatever you downsized the photo to
|
Stefan D. |
ok
|
Stefan D. |
sounds promising
|
Stefan D. |
what tool would you recommend on the server side?
|
Mark M. |
well, I'd use ImageMagick, but that's because I'm
not that good at this sort of thing and it's the only tool I know
|
Mark M. |
:-)
|
Stefan D. |
so the PHP script could call the command line
version of ImageMagick and process the picture, I guess?
|
Mark M. |
yes, or there may be a PHP library that can do it
-- I'm not a PHP guy
|
Stefan D. |
me neither
|
Stefan D. |
anyhow, nice approach. I'll give it a shot
|
Stefan D. |
thanks, mate
|
Mark M. |
OK, any other questions?
|
Mike R. |
I have one
|
Mark M. |
go ahead
|
Stefan D. |
no from my side
|
Stefan D. |
get well soon.
|
Stefan D. |
I'm out
|
Mike R. |
if you'll recall, i have a service in my app.
|
Robert C. |
Take care all!
|
Stefan D. |
bye everyone
|
Jul 8 | 10:55 AM |
Mike R. |
it opens a sqllite database in oncreate and closes
it in ondestroy
|
Jul 8 | 10:55 AM |
Mike R. |
in the meantime the service spins off several
threads in response to requests from different app activities
|
Stefan D. | has left the room |
Mike R. |
one of these threads could take a long, long time
to complete
|
Mike R. |
while that thread is running, the user could leave
the application
|
Mike R. |
i had thought that the service would remain
running until all of its threads terminate, but not so
|
Mark M. |
certainly, onDestroy() cares not a whit about
background threads
|
Mike R. |
so this thread tries to access the database that
ondestroy has already closed
|
Mike R. |
i modified all my threads to check for the
existence of the database. if the database is null, just return.
|
Mike R. |
is there a more elegant way to signal any
background threads to close?
|
Mark M. |
well, that depends on what the background threads
are doing
|
Mark M. |
you can use stuff like AtomicBooleans, and have
the threads look at those
|
Mike R. |
they are calling a remote server and updating a
database.
|
Mark M. |
however, that assumes they are actively awake and
are not blocked waiting on some event
|
Mike R. |
doesn't really matter if they complete their work.
they'll restart the next time the app is run
|
Jul 8 | 11:00 AM |
Mark M. |
your options are probably either to stick with
what you have, or change it such that the database is only closed when
the last thread is done with it
|
Mike R. |
ok last quick question. In the Market Developer
Console, what the difference between Downloads and Active Downloads?
|
Mike R. |
that is, Active Installs
|
Mark M. |
AFAIK, downloads is total number of times it was
ever downloaded
|
Mark M. |
active installs is downloads - uninstalls
|
Mike R. |
ok thanks. by mark
|
Mark M. |
active installs may run high, due to apps getting
removed without a real uninstall (e.g., factory reset)
|
Mark M. |
OK, that's a wrap for today's chat
|
Mike R. | has left the room |
Marc T. |
thanks for your time Mark, get well soon
|
Mark M. |
two more next week
|
Mark M. |
thanks!
|
Mark M. |
have a pleasant day!
|
CalvinS | has left the room |
Marc T. | has left the room |
Robert C. | has left the room |
Mark M. | turned off guest access |