Office Hours — Today, October 5

Thursday, September 27

Oct 5
9:55 AM
Mark M.
has entered the room
Mark M.
turned on guest access
Mark M.
has entered the room
Mark M.
has left the room
10:00 AM
brian k.
has entered the room
brian k.
morning mark!
Mark M.
howdy, Brian!
how can I help you today?
brian k.
first -- thanks again for the class in NYC -- very helpful!
Mark M.
you are very welcome!
brian k.
we are getting close to releasing the app i was working on but came across an odd behavior on the Nexus 7 in the Geocoder
10:05 AM
brian k.
i posted to stackoverflow and android developers but got no response
Mark M.
I have not used Geocoder, but historically, it has not exactly been a bastion of reliability
brian k.
on stackoverflow another person confirmed the same issue
odd thing is the issue seems ot come and go but seems most pronounced on the NExus 7
Prasanna
has entered the room
Mark M.
you probably should consider posting the full stack trace in the future
without that, nobody is really going to be able to help a lot
brian k.
good point
Mark M.
(BTW, howdy, Prasanna!)
Pedro T.
has entered the room
Prasanna
Hi Mark!
brian k.
i can repost it
Pedro T.
Hi everyone!
Mark M.
have you tested it in the Jelly Bean emulator?
(howdy, Pedro!)
brian k.
we fallback to the Maps API but since it caps at 2,500 requests per day i'm concerned about releasing it to production
no -- thought the device would be a better test
Mark M.
it feels like this may be tied to Jelly Bean, more than hardware
that's just a guess
and, as I noted, since Geocoder has never been all that stable, I've never touched it
you might consider finding another third-party service that you can use
brian k.
haven't been able to reproduce it on the Galaxy Nexus yet but i'll keep trying
Mark M.
let me take questions from the others, and I'll be back with you in a bit
brian k.
is there anyway to kick this up to someone at Google?
ok
Mark M.
Prasanna: do you have a question?
Prasanna
Yes
Mark M.
(brian: oh, how I wish)
Prasanna
View paste
I want to have a field called 'close friend' associated with the contacts in my device.  The 'close friend' field will be a boolean value.  
1. How do I go about entering a row in the ContactsContract.Data table that would hold this 'close friend' data item that I need.
2. How do I go about querying the contacts names and this 'close friend' filed from the contacts?
10:10 AM
Prasanna
View paste
I want to have a field called 'close friend' associated with the contacts in my device.  The 'close friend' field will be a boolean value.  
1. How do I go about entering a row in the ContactsContract.Data table that would hold this 'close friend' data item that I need.
2. How do I go about querying the contacts names and this 'close friend' filed from the contacts?
Mark M.
I have no idea on either of those
I have not experimented with adding custom contact data
sorry!
Prasanna
oh ok
Mark M.
Pedro: do you have a question?
Pedro T.
Prasanna maybe you can examine the table under adb under console I read some tables on console using sqlite3 after I enter with adb shell. so then after reviewing the table maybe you can use a query to modify the table as you want
Mark M.
either you are truly out of memory, or your heap is fragmented enough that there is no single block of memory big enough for your needs
Pedro: you cannot modify the database except as part of a firmware build or on a rooted device
Prasanna
Thanks Pedro. Heading out mark. Thanks for doing these QA sessions. Have a good day all.
Pedro T.
haa I have a rooted device maybe that's why i can do it. I never tried on a non rooted device
Mark M.
with respect to your memory issue, the amount of *device RAM* is not that important
the bigger issue is the amount of heap space per process, and what you are doing with the heap
Pedro T.
ok.
but the extrange question is why the heap is growing that fast
10:15 AM
Gabriele
has entered the room
Mark M.
dump your heap and use MAT to track down memory leaks
Gabriele
hi
Mark M.
(howdy, Gabriele -- I will be with you shortly)
Pedro T.
ok
Mark M.
and, again, it may be less of a full-fledged 'leak' than is a matter of heap fragmentation
Pedro T.
the dump heap file of android is compatible with MAT?
Mark M.
yes, if you dump it from DDMS in Eclipse
Pedro T.
ok
Mark M.
if you use standalone DDMS, there is a utility you need to use to convert the format
this is covered in _The Busy Coder's Guide to Android Development_
Pedro T.
I use DDMS under eclipse.
so great that is compatible
Mark M.
also, bear in mind that your button backgrounds are probably several times 40KB, as you will have different backgrounds for normal, pressed, selected, etc. in your StateListDrawable
and, 40KB is the on-disk compressed size, and so each of those will take substantially more memory when loaded and uncompressed into Bitmap objects
hence, each of those buttons could be chewing up a few hundred KB
but, again, I'd start with MAT and see if that tells you things you can do to improve matters
let me take questions from the others, and I will be back with you in a bit
Gabriele: do you have a question?
Gabriele
yes
View paste
I did some test using WebView, I don't know if I can ask here, my problem is understanding the Scale.
It seems that if I use the method setScale (to restore user zoom preferences), or if I restore it using javascript (document.getElementsByTagName('body')[0].style.zoom = value) this becomes the default MINIMUM Scale, meaning the the user cannot zoom out anymore (but he can zoom in), why?
Mark M.
I have no idea
10:20 AM
Pedro T.
ok I will try with mat and then go back
Gabriele
I've tried using setInitialScale, setScaleX (and Y), js, but the same happens
Mark M.
wait a minute
Gabriele
Sure. Alternatively, do you have an idea on how I can save and restore the zoom "position" of the user? So he dosn't have to use pinch-to-zoom every time he loads a new page on the WebView.
Mark M.
I think you want setZoom() on WebSettings
setScale() is actually scaling the View itself (e.g., for scale animations)
setScale() has nothing to do with user zoom levels
Gabriele
You meant setTextZoom?
10:25 AM
Mark M.
ah, yes, sorry
Gabriele
Oh, ok, thank you, I'm going to try it right now! I didn't find it.
Mark M.
Brian: do you have another question?
Prasanna: do you have another question?
Pedro: do you have another question?
if anyone has another question, feel free to chime in and ask
Pedro T.
not for the moment I want to solve this first
soli
has entered the room
Mark M.
howdy, soli!
10:30 AM
Mark M.
soli: do you have a question?
soli
Hello!
yeah, just a minute:)
btw, can i stay here just for fun?
Prasanna
has left the room
Mark M.
um, sure, though these office hours are more for questions and answers than just hanging out
if anyone has a question, feel free to ask
soli
ok
So, I have a client that wants me to make a clone of his iOS app, and i'm kinda weak in UI design.. which android ui elements do I need to use to create something like that? or in other words, how do i create a rectangle in the middle of the screen? Gridview?
Gabriele
Mark: which is the right event to detect user used pinch-to-zoom?
soli
Mza_6514578844771367884
Mark M.
soli: I am not sure what in there is "a rectangle in the middle of the screen"
10:35 AM
Mark M.
you could accomplish it using nested LinearLayouts or a GridLayout
Gabriele: I am not certain that there is an event for pinch-to-zoom that is raised for developers to listen for
if there is one, I do not know what it is off the top of my head
I do not recall seeing one
soli
oh ok, thought that GridLayout is limited to higher API's
Thanks
Mark M.
GridLayout is available as an Android library project from the Android Support package, working back to API Level 4
soli
damn it is
Great!
Mark M.
I think I have instructions for using the backport in my chapter on GridLayout in the book
soli
thanks
i'll look into that
Ok, so i'm going to read about it. Thanks for this awesome service and your book
Bye
Mark M.
you are most welcome!
brian k.
thanks again mark - i'll try posting my stack trace and seeing it that helps someone to respond to my posts
Mark M.
OK
10:40 AM
Mark M.
if you come up with a reproducible scenario, for any Nexus device or the emulator, consider filing an issue at http://b.android.com (assuming there is no such issue there already)
the key is "reproducible scenario"
10:45 AM
medhat
has entered the room
Mark M.
howdy, medhat!
medhat: do you have a question?
medhat
yes
hi
Actually, I like the book so much, but since it was merged into one book it is a little overwhelming to me.
In many places you talk about the core chapters, and I have been looking for a listing of those core chapters, but could not find it.
I found the listing of the trails.
Mark M.
the core chapters are all of the front ones, up through the Getting Help chapter
medhat
Is there a way to get a list of the minimum chapters I need to read to get started.
thanks.
Mark M.
i.e., everything that comes before the trails
medhat
ok.
that was my question :-) I guess I am a "very" busy coder that I couldn't figure that out by myself :-)
Mark M.
I should try to make it more obvious
10:50 AM
Mark M.
if anyone has a question, feel free to ask
medhat
has left the room
brian k.
has left the room
soli
has left the room
Gabriele
Thank you Mark, see you the next time. :)
Mark M.
OK
Gabriele
has left the room
11:00 AM
Mark M.
that is a wrap for today's chat
the next chat is Tuesday, IIRC
have a pleasant day!
Mark M.
has entered the room
Mark M.
has left the room
Pedro T.
has left the room
Mark M.
turned off guest access

Thursday, September 27

 

Office Hours

People in this transcript

  • brian kurzius
  • Gabriele
  • Mark Murphy
  • Mark Murphy
  • medhat
  • Pedro Teran
  • Prasanna
  • soli