Sep 9 | 3:50 PM |
Mark M. | has entered the room |
Mark M. | turned on guest access |
Sep 9 | 3:55 PM |
Jeff | has entered the room |
Mark M. |
hello, Jeff!
|
Mark M. |
how can I help you today?
|
Aditya | has entered the room |
Mark M. |
hello, Aditya!
|
Aditya |
Hi everyone!
|
Mark M. |
how can I help you today?
|
Luca | has entered the room |
Aditya |
So I need help, I have to create a service which
can download multiple files and show the progress of the download as a
notification
|
Aditya |
the sameway the download manager does
|
Mark M. |
(BTW, hello, Luca -- I will be with you shortly!)
|
Luca |
hi all, ok
|
Sep 9 | 4:00 PM |
Aditya |
I dont need source code I just need to be pointed to the resources so I can make it myselk
|
Aditya |
but if a solution already exists I wont say no
|
Mark M. |
what specific parts of this are you seeking resources for?
|
Aditya |
making the service talk to the notification and update the notification as files get downloaded
|
Mark M. |
that's covered in the book
|
Mark M. |
see the Advanced Notifications chapter
|
Aditya |
thanks!
|
Mark M. |
page 1169 in the Version 5.1 PDF
|
Mark M. |
Luca: do you have a question?
|
Luca |
yep
|
Luca |
activity leak
|
Luca |
View paste
|
Mark M. |
I have seen that too
|
Mark M. |
so far, I have been interpreting it as StrictMode being a bit aggressive about when it reports a problem
|
Luca |
ok now the real question:
|
Luca |
View paste
|
Mark M. |
it may or may not be a leak
|
Mark M. |
use MAT to determine for certain
|
Sep 9 | 4:05 PM |
Luca |
ok thank you i have two other question
|
Mark M. |
let me take questions from the others, and I will be back for your next one shortly
|
Mark M. |
Jeff: do you have a question?
|
Luca |
ok
|
Mark M. |
hmmmm
|
Mark M. |
Aditya: do you have a question?
|
Mark M. |
OK, Luca, back to you: what is your next question?
|
Luca |
Can i use "new Thread(code).start()" directly for short tasks where i don't need ui callbacks or there are some drawbacks?
|
Mark M. |
if you plan on doing a lot of them, I'd consider some sort of thread pool
|
Mark M. |
otherwise, a plain thread is perfectly fine
|
Luca |
ok, can i go with the next?
|
Mark M. |
sure
|
Luca |
View paste
|
Mark M. |
JNI with OpenSSL is a reasonable approach
|
Mark M. |
SQLCipher for Android uses it, for example
|
Sep 9 | 4:10 PM |
Mark M. |
in fact, if you're not already doing so, I'd recommend bundling in your own copy of OpenSSL
|
Mark M. |
the SQLCipher team just moved to that model
|
Mark M. | |
Mark M. |
Jeff/Aditya: do you have any questions?
|
Luca |
i have compiled my own version of openssl because i had read to not trust much libraries that come with android
|
Mark M. |
if anyone has any questions, feel free to chime in
|
Sep 9 | 4:15 PM |
Luca |
In the future i will also need to use sqlcipher i
wonder if in some way i can use the same bundled version of openssl both
for sqlcipher and my jni
|
Mark M. |
AFAIK that should be possible, but I'm far from an NDK expert
|
Alex | has entered the room |
Luca |
ok thank you
|
Alex |
Hello
|
Mark M. |
hello, Alex!
|
Mark M. |
Alex: do you have a question?
|
Alex |
Yeah. About BroadcastReceivers
|
Mark M. |
Alex: go ahead
|
Alex |
If a BroadcastReceiver is registered via manifest,
at what point will it stop receiving broadcasts or does it not? In
other words, if the process that's tied with an app dies, does the
broadcast receiver sort of die with it?
|
Mark M. |
no, the process being terminated (for "natural causes") will not stop you from receiving broadcasts
|
Mark M. |
"Force Stop" from Settings will, however, block your receipt of future broadcasts, until the user runs one of your activities
|
Sep 9 | 4:20 PM |
Mark M. |
and my understanding is that a few devices from
boneheaded manufacturers do the "Force Stop" behavior from their own
replacement task managers, which sucks
|
Mark M. |
fortunately, that does not seem to be widespread
|
Aditya | has left the room |
Mark M. |
if anyone has any questions, chime in
|
Alex |
oh ok. thanks.
|
Alex |
so, i would assume that if the OS decided to stop
my applications' process and it can still receive broadcasts, does that
mean it's not really stopped? sort of running, but not really running?
|
Mark M. |
no
|
Sep 9 | 4:25 PM |
Mark M. |
a system-level process maintains the roster of <intent-filter>s
|
Mark M. |
when a broadcast is sent, it looks up matches in the roster
|
Alex |
gotcha
|
Mark M. |
if needed, it starts a process to deliver the broadcast to a specific receiver
|
Alex |
makes sense
|
Mark M. |
Alex: if you have another question, go ahead
|
Alex |
I'm good for now. thanks though.
|
Alex |
Thanks again. been helpful.
|
Alex | has left the room |
Luca |
i have another question, tell me when i can ask
|
Mark M. |
go right ahead!
|
Luca |
View paste
|
Mark M. |
"Do i need to ensure that the SQLiteDatabase is closed with a try/finally in every method?" -- no
|
Sep 9 | 4:30 PM |
Mark M. |
in fact, you don't want to close the database until you are *completely done with it*, from all threads
|
Mark M. |
which frequently means that you simply never close it
|
Mark M. |
I would stick with the singleton SQLiteOpenHelper (over a singleton SQLiteDatabase), but either should work
|
Luca |
ok
|
Mark M. |
if anyone has a question, go ahead
|
Luca |
A service which use "startForeground" will still need a partial wake lock to avoid that the cpu go to sleep?
|
Sep 9 | 4:35 PM |
Mark M. |
yes
|
Mark M. |
startForeground() gives the service foreground priority, but it has no effect on when the device goes into sleep mode
|
Luca |
ok, i'm already using your wakefulintentservice plus startforeground :P
|
Mark M. |
that should work just fine
|
Luca |
do you have some suggestions to view documents like doc, docx, xls and xlsx? the iOS web view handles a lot of them :/)
|
Mark M. |
let a third-party app handle them
|
Mark M. |
and, if queryIntentActivities() turns up no possible matches, prompt the user to install one
|
Luca |
i can't because are private files Q_Q
|
Sep 9 | 4:40 PM |
Mark M. |
then I cannot help you
|
Luca |
ok i think that only way is using something like apache poi and docx4j to convert documents to html
|
Mark M. |
I would convert them on the server and download the HTML
|
Mark M. |
and then consider PDF, as there are a variety of PDF-viewing libraries, open source and commercial
|
Mark M. |
I have no idea if there is a library for viewing Microsoft files
|
Luca |
ok thank you for your help
|
Luca |
bye all!
|
Mark M. |
you are very welcome!
|
Sep 9 | 4:45 PM |
Mark M. |
if anyone has any questions, chime in
|
Sep 9 | 4:50 PM |
Jeff |
hi Mark
|
Jeff |
I have a question
|
Mark M. |
go right ahead!
|
Jeff |
On a Droid 3, I periodically get the following
error, but it doesn't happen on other phones. I'm not too worried but
would like your thoughts:
|
Jeff |
IInputConnectionWrapper(18141): getExtractedText on inactive InputConnection
|
Jeff |
then I get 17: W/IInputConnectionWrapper(18141): beginBatchEdit on inactive InputConnection
|
Mark M. |
well, that second one is a warning (W/)
|
Jeff |
apparently, the InputConnection is the bridge between the Java code and the system's character reading
|
Jeff |
they are both warnings - sorry I said error
|
Mark M. |
it's the bridge between the app and the input method editor
|
Mark M. |
devices have a habit of being chatty in odd places, as device manufacturer developers leave Log calls lying around
|
Mark M. |
unless you have symptoms beyond the warnings, I'd ignore them
|
Jeff |
but it requires hitting the back button sometimes
|
Mark M. |
what is "it"?
|
Jeff |
the EditText field won't accept input
|
Jeff |
BUT, that only occurs with the virtual keyboard. the physical keyboard works fine always
|
Mark M. |
when you say it happens "periodically", I take it that you cannot reliably reproduce the error?
|
Sep 9 | 4:55 PM |
Jeff |
not reliably
|
Mark M. |
still feels like a device bug
|
Jeff |
the thing I like about the droid 3 is that it is the least robust phone I test on
|
Jeff |
so if it works on a droid3, it generally works
|
Mark M. |
"least robust" -- how polite! :-)
|
Jeff |
OK - I will leave it as device bug - Thanks!
|
Mark M. |
anything else that I can help you with?
|
Sep 9 | 5:00 PM |
Mark M. |
well, that's a wrap for today's chat
|
Mark M. |
the chat transcript will be archived at http://commonsware.com/office-hours shortly
|
Mark M. |
have a pleasant day!
|
Luca | has left the room |
Jeff | has left the room |
Mark M. | turned off guest access |