Jun 15 | 7:45 PM |
Mark M. | has entered the room |
Jun 15 | 7:55 PM |
Mark M. | turned on guest access |
Jun 15 | 8:00 PM |
Jim | has entered the room |
Mark M. |
howdy, Jim!
|
Jim |
Hello Mark. Got time for a question ?
|
Mark M. |
that's why I'm here!
|
Mark M. |
fire away!
|
Jim |
First let me send you the stack trace.
|
Jim |
View paste
|
Jim |
Now the code.
|
Jim |
View paste
(18 more lines)
|
Jim |
It pops off on the createTempFile line.
|
Jim |
I am trying to save a camera picture.
|
Mark M. |
Your mkdir() call probably returned false
|
Jim |
Could there be a permissions problem ?
|
Mark M. |
perhaps the SD card is unavailable (not installed,
mounted on a host PC, etc.)
|
Mark M. |
you do need the WRITE_EXTERNAL_STORAGE permission,
starting with Android 1.6
|
Kevin M. | has entered the room |
Jim |
I used a Motorolla Droid.
|
Jim |
Running 2.1
|
Mark M. |
That'll be 2.0 or 2.1
|
Kevin M. |
Hello
|
Julius | has entered the room |
Mark M. |
right
|
Mark M. |
howdy, Kevin & Julius!
|
Jim |
Ok. Let me give a try.
|
Mark M. |
remember: either the DROID can have the SD card,
or the host PC can have the SD card, but not both at once
|
Jun 15 | 8:05 PM |
Julius |
hiya
|
Kevin M. |
Looks like you're helping someone. Let me know
when you're done
|
Mark M. |
Jim: you might try calling
Environment.getExternalStorageState() to see what is being reported
|
Mark M. |
OK...Kevin, you're next -- got a question?
|
Jim |
Yall go ahead while I try Mark's suggestion.
|
Kevin M. |
Sure. I'm trying to write a custom layout class
|
Kevin M. |
I'm having problems reading in the attributes from
an xml file
|
Mark M. |
what sorts of problems?
|
Kevin M. |
It doesn't have the attributes I specify in the
xml file
|
Kevin M. |
The layout is defined in another project. Not sure
if that is the problem
|
Mark M. |
that certainly complicates matters
|
Mark M. |
I would recommend you check out the Reusable
Components chapter of _The Busy Coder's Guide to Advanced Android
Development_
|
Julius |
(ah that answers a question I had... better read
that)
|
Mark M. |
and take a look at the CWAC-ColorMixer project: http://github.com/commonsguy/cwac-colormixer
|
Mark M. |
while not a custom layout class, these do
illustrate how to create a custom View in one project and reuse it in
another
|
Kevin M. |
I'll take a look at it. I referenced the file by
using a custom xmlns in the xml file
|
Mark M. |
is the attrs.xml from the layout class also copied
over into the reusing project's resources?
|
Kevin M. |
I think I got the right syntax as it didn't
complain but I never got the values set
|
Mike R. | has entered the room |
Jun 15 | 8:10 PM |
Mike R. |
Hello
|
Mark M. |
howdy, Mike R -- you're in line behind Kevin
(working on a question now) and Julius
|
Kevin M. |
No, I didn't copy it over
|
Mark M. |
Kevin: that's at least part of your problem
|
Kevin M. |
OK. Very confusing
|
Mark M. |
yes, it took me a fair amount of fussing to get a
recipe that works
|
Kevin M. |
If there was some sample code, that would help
alot
|
Mark M. |
with respect to layouts, I can't help you there
|
Kevin M. |
Good news is that the layout works well
programmatically
|
Mark M. |
with respect to attribute handling, that's in the
Custom Views and Reusable Components chapters of the Advanced Android
book
|
Kevin M. |
Ok. I'll take a look at it
|
Mark M. |
well, heck, getting the layout to work is the hard
part, from my standpoint, so you're in pretty good shape
|
Mark M. |
I tried writing one once and surrendered
|
Kevin M. |
It's a GridLayout with resizable columns and rows
|
Mark M. |
That's cool
|
Kevin M. |
Very cool. I don't have to recreate the layout
when I rotate the screen
|
Mark M. |
OK...Julius, got a question?
|
Julius |
just wondering about file format and whether it's
possible to query them
|
Julius |
so say I have some media
|
Julius |
like mp4 mp3 etc.
|
Jeffrey B. | has entered the room |
Julius |
is there a way to find out whether the media type
is supported
|
Mark M. |
I don't know of a way to do that, unfortunately
|
Julius |
there's a matrihttp://developer.android.com/intl/zh-TW/gu… I
found:
|
Julius |
oops
|
Julius | |
Mark M. |
howdy, Jeffrey -- you're in line behind Julius
(working on a question now) and Mike
|
Jun 15 | 8:15 PM |
Julius |
anywho it asically said some platforms "may"
support some file types
|
Mark M. |
Julius: right, that's the list of possible ones
|
Julius |
no worries I won't hold you up
|
Mark M. |
right
|
Julius |
thanks for the time
|
Mark M. |
most will support what is in there
|
Mark M. |
some may support WMA/WMV in addition
|
Mark M. |
I don't know of any device that supports less than
that list
|
Julius |
(I might lurk just to read)
|
Julius |
oh ok good ot know
|
Mark M. |
mostly because the support for all that is free
and in the open source tree
|
Mark M. |
OK...Mike, got a question?
|
Mike R. |
yeah. you already started to answer it on stack
overflow
|
Mike R. |
it's about webview
|
Mike R. |
trying to get it to work with Google AdManager
|
Mark M. |
got a link to the SO question?
|
Joey D. | has entered the room |
Mike R. |
so, I'm loading a HTML string which calls a lot of
javascript that eventually displays an image that hyperlinks back to ad
manager
|
Mike R. |
the image loads fine and onPageCompleted gets
called.
|
Mike R. |
when the user taps on the image, instead of
shouldLoadUrl being called, onLoadResource is called.
|
Mike R. |
I need shouldLoadUrl so that I can intercept and
invoke the full web browser.
|
Mark M. |
Hmmmm...is it loading in some Javascript, perhaps?
|
Mike R. |
oh yes, it's all javascript
|
Mark M. |
and the URL passed to onLoadResource() is a path
to a Javascript file being loaded?
|
Jun 15 | 8:20 PM |
Mike R. |
actually, there are a couple of calls. One or two
call back to Doubleclick, but the last one is a call to the advertiser
|
Mark M. |
...and the URL passed to onLoadResource() is a
path to a Javascript file being loaded?
|
Mark M. |
basically, I'm trying to understand why it is
onLoadResource() -- that should be for images, Javascript, etc.
|
Mark M. |
if the HTML is set up that clicking the image is
loading Javascript rather than loading a Web page, I don't think there's
much you can do, other than to rewrite the Javascript/HTML to not do
that
|
Mike R. |
that call is still included in the
onLoadResource() calls.
|
Mike R. |
for instance, http://www.apple.com in my example.
|
Mark J. | has entered the room |
Mark J. |
Hello
|
Mark M. |
Quick update: howdy, Joey and Mark -- you are
behind Jeffrey, who is behind Mike, who is being helped right now
|
Mike R. |
Surely, someone has AdManager working on an
Android device?
|
Mike R. |
this is all requirements from AdManager
|
Mark M. |
Mike: well, I haven't played with AdManager
anywhere, let alone on Android
|
Joey D. |
Thanks for the update.
|
Mark M. |
are you trying to use desktop browser stuff, or
the new mobile stuff?
|
Jun 15 | 8:25 PM |
Mike R. |
what new mobile stuff?
|
Mark M. |
Ummm...AdSense for Mobile, I think it's called
|
Mark M. | |
Mark M. |
since I have never used AdSense, I don't know what
level of control you have over sources of inventory, etc. -- all of
that is well outside the scope of this chat session
|
Mike R. |
i'm not sure that applies to us. we're using
admanager to server up our own ads, not to get third party ads to
display in our ap.
|
Mark M. |
I don't really know what to tell you
|
Mike R. |
ok. i'll keep looking
|
Mark M. |
I really doubt Android is mistakenly calling
onLoadResource()
|
Mike R. |
well the url in onLoadResource() is http://www.apple.com
|
Mark M. |
OK...Jeffrey, got a question?
|
Jeffrey B. |
Hi yes... Is it possible to reduce the
sensitivity of the microphone?
|
Mark M. |
cover it with a cotton ball?
|
Mark M. |
:-)
|
Jeffrey B. |
lol alread thought of that
|
Mark M. |
I haven't played with audio recording, so I am not
familiar with the options here -- sorry
|
Jeffrey B. |
OK... Thanks.
|
Jeffrey B. |
I'll look further.
|
Mark M. |
Ummmm...Joey, do you have a question?
|
Jun 15 | 8:30 PM |
Joey D. |
I am stuck on streaming audio
|
Joey D. |
I can get an MP3 to play via URL
|
Joey D. |
but when I try to open an aac+ file with
mediaplayer, I get errors that don't seem to have a definition
|
Joey D. |
error(1, -10_
|
Joey D. |
error(1, -10)
|
Mark M. |
yeah, those are being spit out by the Packet Video
OpenCORE code
|
Mark M. |
the error tag probably starts with PV
|
Joey D. |
yes
|
Mark M. |
unfortunately, most of that stuff is very
undocumented
|
Joey D. |
PVMF
|
Mark M. |
does the file work if you download it and play it
locally?
|
Mark M. |
also, is the HTTP or RTSP?
|
Joey D. |
it works on iphone...
|
Joey D. |
http
|
Mark M. |
er, is the protocol HTTP or RTSP?
|
Joey D. |
got it. it's http
|
Mark M. |
I would try the file locally -- if it fails, it is
an encoding issue
|
Mark M. |
if it succeeds...perhaps Android can't stream AAC+
over HTTP for some reason
|
Joey D. |
lots of apps do it, or claim to do it
|
Mark M. |
the boundaries of what MediaPlayer all supports,
particularly in terms of streaming, is tough to decipher
|
Joey D. |
i've been messing around with caching it locally
and opening it with a mp3 wrapper
|
Joey D. |
but I get a second problem (this one will be
easy!)
|
Joey D. |
i add WRITE_EXTERNAL_STORAGE to my manifest, but
the permission never shows up
|
Jun 15 | 8:35 PM |
Joey D. |
so I can't write to the cache file
|
Joey D. |
INTERNET works fine
|
Mark M. |
here is one that works:
|
Mark M. | |
Joey D. |
I'm targeting an N1 device for testing
|
Mark M. |
there is probably something syntactically off with
your permission in the manifest
|
Mark M. |
the permission definitely works on an N1
|
Mark M. |
OK...Mark, got a question?
|
Mark J. |
Heya, it is my first time hopping in here, so I
just wanted to say hello. Also I wanted to know if if code related
questions are allowed.
|
Mark M. |
so long as it is related to Android development,
it's fair game
|
Mark J. |
Alright cool it is :)
|
Mark M. |
though depending on how involved it is, I may or
may not be able to answer...
|
Mark J. |
Well, I have a tab widget with many different
tabs, and they have become very cramped
|
Mark J. |
I am looking to see how it is possibly to maybe
horizontally scroll through them
|
Mark J. |
possible*
|
Mark M. |
oy
|
Jun 15 | 8:40 PM |
Mark M. |
I haven't tried wrapping a TabWidget in a
HorizontalScrollView, so I don't know if that works
|
Mark M. |
if not, you'd probably have to subclass/rewrite
TabWidget, based on the open source code, which probably is not going to
be a ton of fun
|
Kevin M. | has left the room |
Mark M. |
are you sure you are not better off splitting some
of that into other activities?
|
Mark J. |
Hmm, well, what I was aiming for,
|
Mark J. |
Have you played with maybe, the Engadget app? or
the AndroidGuys app?
|
Mark M. |
neither (though don't tell AndroidGuys that)
|
Mark J. |
:P That's okay
|
Mark J. |
Alright, well since you have others to help, I
will just let you move on, as I will keep looking. By the way, just
bought the books yesterday and love them :) Thanks
|
Mark M. |
downloading the AG app now
|
Julius |
hi - sorry to butt in - I am expecting to have the
same problem and read here that there maybe a solution for this at some
point.
|
Mark M. |
from the screenshots, I'm not sure that's actually
tabs, in terms of TabHost/TabWidget
|
Julius | |
Julius |
(in the second picture in "pattern 5:"
|
Mark J. |
The "Tweets" and "People"?
|
Mark M. |
right
|
Julius |
(no idea how to do it, but it might allow for more
selection options in a way)
|
Mark M. |
that too is not TabHost/TabWidget, but something
else
|
Mike R. | has left the room |
Jun 15 | 8:45 PM |
Julius |
for sure - just a problem I'm expecting to face
soon and hoping this will help
|
Julius |
oh no the next piture
|
Mark M. |
yeah, I am eagerly awaiting the Twitter open
source release
|
Julius |
there are two next to each other and the one on
the left
|
Julius |
just under that one
|
Julius |
(me too :))
|
Mark M. |
Going back to the AG app, they are probably using
ViewFlipper for the body and something custom for the tabs
|
Mark M. |
probably a LinearLayout of tabs, in a
HorizontalScrollView, bracketed by ImageButtons
|
Mark J. |
Alright, I will give something like this a shot :)
|
Mark J. |
Thanks man.
|
Mark M. |
it's for stuff like that why I am trying to
encourage code reuse, because we need more stuff like it available for
all developers, without everyone reinventing the wheel
|
Mark M. |
anyway...back to the top...
|
Mark M. |
Jim: got another question?
|
Jim |
Nope. You rock. It was the permission.
|
Mark M. |
Great!
|
Mark M. |
Julius: got another question?
|
Julius |
no I'm good thankyou
|
Mark M. |
Jeffrey: got another question?
|
Mark M. |
OK, *anybody* have another question?
|
Jun 15 | 8:50 PM |
Joey D. |
i do
|
Mark M. |
go ahead
|
Joey D. |
perhaps I am not seeing it anywhere, but there
isn't a lot of discussion about coming from an MVC paradigm to android
|
Joey D. |
it seems to me that android mingles view and
controller functionality quite a bit
|
Jeffrey B. | has left the room |
Joey D. |
I would think that it would be discussed ad
naseaum, but I can't find anyone talking about it, or addressing it in
any way
|
Mark M. |
I tend to think of the widgets as being the view,
the Cursor (and helper classes) as being the model, and the activity as
being the presenter/controller
|
Mark M. |
but, you're right, MVC is not something Google
emphasizes
|
Mark M. |
in part, because a lot of MVC frameworks focus on
thick models
|
Mark M. |
and Android tries to minimize data copying, object
creation, etc.
|
Joey D. |
what does "thick model" mean?
|
Mark M. |
a thick (or rich or whatever) model would be a
model class (e.g., Person)
|
Mark M. |
if you did a query on a 'person' table, you'd copy
the data out of the Cursor into a bunch of Person objects
|
Joey D. |
ok
|
Mark M. |
and Person would have some amount of business
logic
|
Mark M. |
that's cool when you have gobs of RAM
|
Mark M. |
less cool when you have drips and drops of RAM,
and a slow CPU to boot
|
Jun 15 | 8:55 PM |
Mark M. |
someday, when there's more elbow room, you'll see
more emphasis on ORMs and the like
|
Mark M. |
right now, when resources are limited, coding for
structural cleanliness takes a back seat to optimization and performance
|
Mark M. |
rightly or wrongly
|
Mark M. |
OK, we're running low on time...any other
questions?
|
Joey D. |
thanks
|
Julius |
I tend to have my model classes set up with
constants like field names and table name in them etc.
|
Julius |
is that a bad way to go?
|
Mark M. |
well, constants (static final) are a generally
good thing
|
Julius |
yeah just so my dbHelper can use them...
|
Julius |
ok
|
Jim |
Any api to compress a jpeg before I send to a
servlet ?
|
Julius | has left the room |
Mark M. |
yeah, I think there something for that...
|
Jim |
In your books ?
|
Mark M. |
yeah, there's a compress() method on Bitmap
|
Mark M. |
no, not in the books
|
Jim |
Ok. Thanks. Have a good evening.
|
Mark J. |
I have one, sort of. What is your position
currently in Android Development?
|
Jim |
Huh ?
|
Mark M. |
Well, I'm sitting down right now
|
Jun 15 | 9:00 PM |
Mark M. |
:-)
|
Mark J. |
Sorry, I meant for Mark
|
Jim | has left the room |
Mark M. |
Could you be a bit more specific?
|
Mark J. |
Well, I mean, what are some of your projects? Or
what interests you most specifically?
|
Mark M. |
that's kinda a complex question
|
Mark J. |
Sorry :( We can just drop it :)
|
Mark M. |
my "projects" that I can talk about are my books,
promoting reuse via the Android Parcel Project, and so forth
|
Mark J. |
Okay, also are you the only one that answers
questions here?
|
Mark M. |
Well, my vast army of dust bunnies is presently on
strike, due to unsafe work conditions (a.k.a, vacuum cleaner)
|
Mark M. |
Otherwise, CommonsWare is just little ol` me
|
Mark J. |
Haha, alright
|
Mark M. |
anyway, that's a wrap for tonight's chat
|
Mark J. |
Well I love the it man, it think it is great, and I
love the books, I am currently still reading them through Aldiko. Seeya
next time
|
Mark M. |
Thursday's chat will be at the same time, rather
than the usual morning slot, since I am teaching a course this week
|
Mark M. |
Mark: thanks!
|
Mark M. |
have a pleasant evening!
|
Joey D. | has left the room |
Mark J. | has left the room |
Mark M. | turned off guest access |