Office Hours — Today, May 19

Thursday, May 15

Mark M.
has entered the room
Mark M.
turned on guest access
May 19
7:30 PM
Susheel C.
has entered the room
Susheel C.
Hi Mark
Mark M.
hello, Susheel!
how can I help you today?
Susheel C.
I have a question about eclipse ADT.
What is the name of the toolbar where you can change the theme for your app?
I did something to mine and its missing
Mark M.
you mean, in the Graphical Preview tab for a layout?
Susheel C.
Yes in the graphical layout
Mark M.
I didn't know you could get rid of that
Susheel C.
I have highlighted the red color region
Tiru B.
has entered the room
Susheel C.
oh
Mark M.
I have no idea how to get that back, though I presume that there is a way
Tiru B.
Hi Mark and Susheel
Susheel C.
Ok
Mark M.
(hello, Tiru -- I will be with you in just a moment!)
Susheel C.
I have another question
Hi
Mark M.
Susheel: let me take a question from Tiru first, since you already asked one
Tiru: do you have a question?
Susheel C.
absolutely
7:35 PM
Susheel C.
please go ahead
Tiru B.
Yes... Is there any reason why SQLite queries on Android run slower when the table has indexes than when the table doesn't have indexes at all?
Mark M.
I would not expect that behavior
use EXPLAIN QUERY PLAN to see if it is actually using your indexes
Tiru B.
It sounds strange, but that's what we noticed, even on Nexus 5 running latest version of kitkat!
Mark M.
I can certainly see queries not being helped by indexes, if the indexes aren't the right ones and a table scan is still needed
off the cuff, I would not expect indexes to make the table scan itself longer
but I haven't dealt with really large database contents, so I cannot rule it out
7:40 PM
Mark M.
Susheel: let's take your next question
Tiru B.
So, you suggest running EXPLAIN QUERY PLAN as a raw query from my Android app, and dumping the results?
Susheel C.
When I receive sms from a certain number is it possible to skip the usual sms notification and instead display a custom notification? It’s better if the sms is not stored in the usual sms inbox. I want to be able to start my app when I click on this custom notification. Is that possible?
Mark M.
Tiru: yes, or use the sqlite3 command-line utiliyt
er, utility
Susheel: on Android 4.3, you can abort the broadcast and do what you want, but then the entire message handling is up to you, as it will not be delivered to the inbox
on Android 4.4, you cannot interfere with the user's chosen SMS client
Susheel C.
ok
what about versions prior to 4.3?
Mark M.
oh, sorry, I mean Android 4.3 and earlier there
Susheel C.
cool
np
Mark M.
Tiru: do you have another question?
Tiru B.
Yes, Is there an easier way for implementing items sorted into section in a list view?
For instances, I want tasks to be grouped by date
Mark M.
"easier way" than what?
7:45 PM
Tiru B.
Adapter returning multiple different item types
Mark M.
well, that's going to be required for sections regardless of sorting
my MergeAdapter makes assembling such an adapter a bit easier
though the sorting part is up to you
Tiru B.
Actually, I meant grouping, not sorting
Why isn't there an easier way as in iOS?
Mark M.
if it is easier for you to create an adapter per section for the section's contents, that's where MergeAdapter works well
Tiru B.
Does MergeAdapter ensure that section title item is not clickable?
Mark M.
yes, that's the default
there are other third-party libraries out there that handle sectioned lists that you can look at as well
7:50 PM
Tiru B.
Any notable libraries that you know of?
Mark M.
sorry, there's a bunch of ListView ones, and I don't keep tabs on them all
try AndroidViews.net or android-aresenal.com
er, android-arsenal.com
Tiru B.
sure
Mark M.
Susheel: do you have another question?
Susheel C.
so only on ver 4.4, even if the user chooses default sms client I still cannot intercept the text?
Mark M.
oh, you can intercept the text
you just can't stop the user's chosen SMS client from *also* receiving the text
and showing the notification
Susheel C.
ok
Mark M.
and putting it in the inbox
Susheel C.
Got you
Mark M.
basically, as of Android 4.4, the use of SMS as an app control channel is no longer really viable
Susheel C.
ok
I have another question....
Mark M.
go ahead
Susheel C.
Is it possible to send email via my app without having to choose which client I want to pick?
Tiru B.
Is there a standard way to detect when the user is idle? (In other words, the user is not actively using the app.. in a sense, the user is "away from keyboard")
Mark M.
Susheel: you can use the JavaMail library, but then you need SMTP account credentials
Susheel: or, you can talk to your server, and your server can send the email
7:55 PM
Susheel C.
which is basically the username and password?
Mark M.
Susheel: otherwise, the user needs to be involved, via ACTION_SEND/ACTION_SENDTO
Susheel C.
ok
Mark M.
Susheel: username, password, SMTP server, etc. -- everything you normally configure in a mail client
Tiru: not really, as the idea is that the device goes to sleep then
Susheel C.
great. This works for all kinds of email clients? gmail, yahoo, irrespective?
Mark M.
JavaMail *is* an email client, in library form
Susheel C.
ok
Tiru B.
Is there a way to detect when the device is coming out of sleep?
Mark M.
whether any given SMTP server will talk to it depends a bit on that server and any requirements it may have that JavaMail may not support (e.g., TLS encryption)
Susheel C.
ok
Mark M.
and, it assumes that the user is interested in giving your app those details, or you are willing for the world's script kiddies to get at your hard-coded details
Tiru: not really
Susheel C.
Right
Thanks a lot for your help Mark :)
Tiru B.
Does JavaMail library work as-is on Android, or is there a scaled-down version of JavaMail library?
Mark M.
AFAIK, people are just using standard JavaMail
there may be somebody who has done a tweaked version, though I don't recall hearing of it
8:00 PM
Mark M.
if either of you have another question, go right ahead
Susheel C.
And I can automate sending sms and emails using AlarmManager, right?
Mark M.
yes
Susheel C.
great
Tiru B.
Have you tried Genymotion?
Mark M.
not recently
I have a fairly powerful notebook, so the x86 emulators (plus hardware) work fine for me
Tiru B.
on mac, or windows?
Mark M.
Linux
Tiru B.
Is HAXM supported on Linux?
Mark M.
there's an equivalent (KVM)
Tiru B.
great.. is that covered in the book?
8:05 PM
Mark M.
you mean how to set it up?
Tiru B.
yes
Mark M.
I mostly point to the developer docs for it, as I cannot really add much to it
Tiru B.
Any links that can help?
Mark M.
see "Configuring VM Acceleration on Linux"
and ignore their comments regarding VirtualBox -- I haven't had any problems using both VirtualBox and KVM
Tiru B.
Do you run your Linux inside a VirtualBox VM?
Mark M.
no, I run it on my notebook
8:10 PM
Susheel C.
Thank you Mark, have a good night
Tiru B.
I am trying to understand why they talk about VirtualBox on that page
Susheel C.
has left the room
Mark M.
my guess is that they ran into some driver conflicts somewhere along the line
but, again, I haven't had any problems
Tiru B.
Any guess when Android Studio would come out of beta?
Mark M.
possibly Google I|O 2014 (late June)
Tiru B.
Do you still use ADT in Eclipse, or have you started using Android Studio?
Mark M.
I use both, mostly Eclipse
Tiru B.
Do you expect any big announcements at I/O 2014?
Mark M.
I have given up guessing on what will happen at I|O :-)
Tiru B.
Yes, that's a sensible thing to do! :-)
8:15 PM
Tiru B.
Any new trends and recent developments with regard to Android development?
Mark M.
um, that's kinda broad
Tiru B.
I know
Any significant things that you find interesting
Mark M.
sorry, but that's not really what this chat is for
I'm here to help you solve development problems
Tiru B.
no problem
Are there any other consultants who work for commonsware, or do you do it alone?
Mark M.
CommonsWare is just me
Tiru B.
great
Thanks for your time... I'll catch you sometime later
Have fun
bye
Mark M.
OK, have a pleasant day!
Tiru B.
thank you
good night
8:20 PM
Tiru B.
has left the room
8:30 PM
Mark M.
turned off guest access

Thursday, May 15

 

Office Hours

People in this transcript

  • Mark Murphy
  • Susheel Chanda
  • Tiru Bokka

Files in this transcript