Office Hours — Today, October 12

Thursday, October 7

Oct 12
9:50 AM
Mark M.
has entered the room
9:55 AM
Mark M.
turned on guest access
10:00 AM
Evan
has entered the room
Evan
hey Mark
Mark M.
howdy, Evan!
Evan
the one thing I came here to hopefully have some light shed on are strange undocumented numeric errors coming from MediaPlayer
Mark M.
yeah, well, that's pretty common
Evan
like "error -14002"! (UNKNOWN_ERROR)
Mark M.
the media frameworks are fond of undocumented errors
Evan
i'm trying to write something robust for a video app, and i have no clue how to handle these
Mark M.
on the whole, you don't handle them, other than to log them and say "oops" to the user
Evan
yeah, essentially that's what i was going to do
Mark M.
if you're using something that collects error data for you from the field, you can eventually perhaps come to some sort of pattern
and, if you can come up with a reproducible test case, you can always try posting it on b.android.com or something
Evan
very true
Mark M.
the key being "reproducible"
10:05 AM
Evan
i guess i could maybe comb through their code to see what generated that number
but that seems tedious
Mark M.
hope you have a large supply of Red Bull on h and
er, on hand
Evan
haha
Mark M.
seriously, your best hope is that Dave Sparks or somebody sees the issue and chimes in
this is particularly true with Android 2.2, as they're starting the cutover from OpenCORE to Stagefright as the media engine
which I am sure clutters things up yet more
Evan
yeah.
also does there exist a way effectively have the MediaPlayer try to start at an "index" outside of 0 (i.e. the start)?
Mark M.
local or streaming?
Evan
streaming
Mark M.
hrm
in theory, I'd say try seekTo() before start()
Evan
I recall being unsuccessful trying to do this...
Mark M.
yeah, particularly for streaming, I can see that as being potentially troublesome
outside of seekTo(), though, there's not much around for repositioning the playback point that I can think of
Evan
right...
but it should work for a local (i.e. downloaded) file?
10:10 AM
Mark M.
actually, I have only used seekTo() from a running clip (e.g., fast-forward)
I would think it is somewhat more likely to work with local media
but that's just a guess
docs say that seekTo() should be valid for the Prepared state
so, in theory, it should work for local and streaming, once the clip is prepared
alas, theory and reality don't always line up
Evan
heh. that's true.
in fact, I'd even say they've almost tended *not to* for me and Android lately ;-)
thanks Mark!
Evan
has left the room
10:15 AM
Frank S.
has entered the room
Mark M.
howdy, Frank!
Frank S.
Hi Mark
I guess the school hasn't refreshed their cache
I was wondering what was so new on the site, lol
Ciaran H.
has entered the room
Mark M.
it's a pretty nasty configuration they must have there
the TTL on the DNS entry is pretty short
cache should have been flushed a ways back
of course, I have some related problem -- I thought I set up a blind redirect from the old server to the new, but that's obviously not working
I'll take a peek at that post-chat
Frank S.
lol. It's funny because the SysAdmin is teaching a class that I'm taking now and configuring a local DNS is our current assignment
Mark M.
howdy, Ciaran!
Frank S.
anyways. I have a question about static string
Mark M.
go right ahead
10:20 AM
Ciaran H.
Hi Mark! I was wondering if there is any utilities to edit pdf files? For instance if i had a pdf and i wanted to add some information i got from the user and write it to a pdf. Is that possible?
Mark M.
Ciaran: I do not know if any run on Android. Try iText.
Frank: you had a question about static strings?
Ciaran H.
ok i will
Frank S.
I've been creating several apps that each fire off different broadcasts. And there are other apps that receive them. I find myself searching through the source to find the actual string
dhaupert
has entered the room
Frank S.
I know I should be putting them in the strings.xml
Mark M.
oh, I don't know about that
strings.xml is for user-facing messages
Frank S.
but is there a way to make them viewable externally
Mark M.
make what viewable externally?
Frank S.
Like how the system has it Intent.action.EDIT... etc
Mark M.
(btw, howdy, dhaupert!)
dhaupert
Hi Mark
Mark M.
within your own app, use a public static final String ACTION_SOMETHING_OR_ANOTHER="whatever.you.want.to.call.IT"
between apps, no, because you don't have the source code
the Android SDK can do it because your code and its are intermingled within your virtual machine and within the compilation process
third parties should be nicely documenting them wherever they are documenting how to use them
10:25 AM
Frank S.
Ok. So it is still a copy and paste job. I have been doing what your suggested, but it just didn't feel correct
Mark M.
yup, copy and paste are typical with broadcast actions and categories and such
dhaupert: do you have a question?
Frank S.
Alrighty than. Thanks for the clarification
dhaupert
Hi Mark, yes I do..
I am having trouble with intent-filters. I wanted to be able to open an attachment with the file extension PDB from gmail, mail, etc.
I saw they use the content scheme so I did this:
View paste (3 more lines)
<intent-filter>
   <action android:name="android.intent.action.VIEW"/>
   <action android:name="android.intent.action.SEARCH"/>
   <category android:name="android.intent.category.DEFAULT" />
   <category android:name="android.intent.category.BROWSABLE"/>
   <data android:mimeType="*/*" />
   
   <data android:scheme="http" android:host="*" android:pathPattern=".*
\\.pdb"/>
   <data android:scheme="https" android:host="*"
android:pathPattern=".*\\.pdb"/>
   <data android:scheme="content" android:host="*"
android:pathPattern=".*\\.pdb"/>
   <data android:scheme="file" android:host="*"
android:pathPattern=".*\\.pdb"/>
...
As you can see it covers a bunch of ways the file could be called, but because those content schemes don't actually have the file name in their URL, this never happens.
Mark M.
you are *far* better served filtering on MIME type
10:30 AM
dhaupert
The problem is that the PDB file's MIME type is application/vnd.palm
Mark M.
so?
dhaupert
and while it seems to work fine with file browsers, it still doesn't show for email
I have this intent-filter as well..
View paste
<intent-filter> 
 <action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="handbase" />
<data android:host="*" />
</intent-filter>
whoops- wrong one..
View paste
<intent-filter> 
 <action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="handbase" />
<data android:mimeType="application/vnd.palm" /> 
<data android:host="*" />
</intent-filter>
that one gets called from a file explorer and works fine for me. But still doesn't show for gmail and the like
Mark M.
the reason your mail clients are not triggering the MIME type ones is probably because the sender's mail client would need to know the MIME type, and it probably does not
so, it probably is using application/octet-stream or something generic like that
dhaupert
probably- it's not a very popular one.
seems like it will be hard to figure out every possible MimeType being used by mail senders. I know in the past I've seen application/pdb in there as well
Mark M.
the intent filter mechanism is definitely more Web-centric than email-attachment-centric
10:35 AM
Mark M.
now, I would think that your file extension ones should work
leastways, it's how I'd try it
but I don't see in the Android source code where they use pathPattern that way
dhaupert
The actual URI doesn't have any sort of file pattern in it that has the file name unfortunately
Mark M.
oh, I see
right
um
I suspect you may just be out of luck
dhaupert
Had a feeling you'd say that!
I did a generic one that shows us for everything, but it seems as hokey as it gets- even clicking on MP3 files and APK files now show my app as an option
Mark M.
yup
dhaupert
Thanks for your help regardless!
Mark M.
sorry I didn't have a better flash of insight for you
Ciaran: got another question?
10:40 AM
Mark M.
ok
Frank: got another question?
Ciaran H.
not that i can come up with at this moment
thank you
Ciaran H.
has left the room
Frank S.
Not today. Thanks for the help. Will probably be on next morning office hours
Mark M.
yeah, unfortunately, office hours will be mostly US Eastern evenings for the next three, due to schedule conflicts
and I'm not sure what I'll be doing while I am in London for Droidcon UK and such
so, it may be a while before the next chat in this time slot
Frank S.
Oh. How will that AndroidDev conference be
Mark M.
I suspect it will be rather British
Frank S.
No. Isn't there one in the US
Mark M.
None in the Droidcon series
Frank S.
I think I saw it on your site
Mark M.
AnDevCon is in March 2011
that's in San Mateo or somewhere else out in Silicon Valley
Frank S.
Yeah. That's the one
Mark M.
dhaupert: do you have another question?
dhaupert
yes
Just wanted to hear your thoughts regarding obfuscation and LVL server
Mark M.
um
10:45 AM
Mark M.
I come at this from a radically different direction
dhaupert
I know that without the former, the latter is not really that useful
Mark M.
if your business model makes it so piracy is an issue, that's a bug in the business model
LVL and similar schemes are workarounds for the bug in the business model
now, it may be the workarounds are your chosen long-term solution for the business model bug -- effectively, the business model bug is a a WONT_FIX
in that case, LVL is interesting, though I'd like it if it were not tied exclusively to the Android Market
dhaupert
I tend to agree- my theory is that if I spend time to fight pirates, I make it harder for honest customers to use my software, and take time away from coding features to support those honest customers
Mark M.
right
for example, I'll be stunned if my books aren't floating around some BitTorrent server somewhere
in the grand scheme of things, that's not something I'm going to chase down
if I find it on the Web through a simple Google search, I might take action, but that's about it
dhaupert
yeah, and you're probably better off not looking- I looked once back in the Palm OS days and got myself worked up. Now I just avoid that!
Sebastiano P.
has entered the room
Mark M.
yeah, I know the feeling
dhaupert
I appreciate your advice!
Sebastiano P.
Hi everyone!
Mark M.
howdy, Sebastiano!
(who-hoo! spelled that right on the first try! :-)
Sebastiano P.
My first time in here :)
Yeah, you got it right!
dhaupert
Have a great week..
dhaupert
has left the room
Mark M.
dhaupert: you too!
Sebastiano: do you have a question that I can (try to) answer?
Sebastiano P.
yes thanks
I'm developing my first Android app
10:50 AM
Sebastiano P.
and I'm having a little issue
with the ViewFlipper and the gestures
my fellow developer who wrote that piece couldn't get a home-like functionality on the viewflipper
meaning, an horizontal swipe does flip pages on the viewflipper
but only after the gesture has completed
Mark M.
correct
ViewFlipper works that way
you can try a HorizontalScrollView
Sebastiano P.
is there any way to have a "dragging" behaviour like the home screen?
let me explain
we have two dashboard views, which are at the moment in the viewflipper
they're basically an icons grid
and we'd like to be able to have them behave how i described you
Mark M.
do not use a ViewFlipper, then
Sebastiano P.
what should we use?
Mark M.
put them side by side in a horizontal LinearLayout
and wrap that in a HorizontalScrollView
and hope
Sebastiano P.
lol
Mark M.
putting scrollable things inside scrollable things tends not to work well
but if that does not work, I have no idea how best you could achieve the look you want
Sebastiano P.
ok
i'm going to try out your suggestion
thank you very much for your kind help
10:55 AM
Mark M.
sure!
Sebastiano P.
have a nice day Mark!
Mark M.
you too!
Sebastiano P.
cheers from Italy :)
Mark M.
Frank: did you think of any other questions?
Sebastiano P.
has left the room
11:00 AM
Mark M.
have a pleasant day!
Frank S.
has left the room
Mark M.
turned off guest access

Thursday, October 7

 

Office Hours

People in this transcript

  • Ciaran Hannigan
  • dhaupert
  • Evan
  • Frank Sposaro
  • Mark Murphy
  • Sebastiano Poggi