Office Hours — Today, May 15

Tuesday, May 13

May 15
3:50 PM
Mark M.
has entered the room
Mark M.
turned on guest access
4:00 PM
Susheel C.
has entered the room
Mark M.
hello, Susheel!
how can I help you today?
Susheel C.
Hi Mark, how are you
I have a couple of questions
1) When I receive an incoming text, I want to identify its coming from a specific number and then trigger my application. How can I do that?
4:05 PM
Mark M.
I would assume getOriginatingAddress() on SmsMessage would tell you the number
however, you cannot have an <intent-filter> for a specific sending phone number
so your application will be "triggered" for all incoming SMS messages
your BroadcastReceiver can see if the SmsMessage has the desired phone number and decide what to do from there
Susheel C.
ok
I'm a little confused. So if I want to start my application only when I receive texts from a specific number, can I do that?
Mark M.
what do you mean by "start my application", specifically?
Susheel C.
I want my app to be launched
Mark M.
what do you mean by "my app to be launched", specifically?
do you mean you want an activity to appear? if so, why do you think the user wants to be interrupted right then?
Susheel C.
Yes, I want an activity to appear. You're right. I should probably use a notification.
Mark M.
either way, SMS messages come into a BroadcastReceiver
that BroadcastReceiver can examine the SmsMessage object to see if it is from your desired phone number
if it is, it can raise the Notification
4:10 PM
Susheel C.
Would it then be possible to receive and 'view' text messages from other numbers as usual without them triggering any events?
Mark M.
by definition, receiving a text message is an event
your BroadcastReceiver will receive all text messages on Android 4.4+
it will receive all text messages that have not been consumed by a higher-priority receiver on 4.3 and below
what you choose to do with those messages, such as examine their phone numbers and conditionally raise a Notification, is largely up to you
Susheel C.
ok
4:15 PM
Susheel C.
I have another question now....I apologize if the question is too broad...
there is a self text writing animation in the hyperlink: http://s449.photobucket.com/user/ine07jasoncase... you tell me if this can be implemented in android? If yes, how?
Mark M.
you can certainly draw on a Canvas
can you draw on a Canvas in an animated fashion that simulates handwriting? presumably
but that is outside of my skill set
Susheel C.
ok
4:30 PM
Susheel C.
Thank you for your help Mark :)
Mark M.
you are very welcome
Susheel C.
has left the room
5:00 PM
Mark M.
turned off guest access

Tuesday, May 13

 

Office Hours

People in this transcript

  • Mark Murphy
  • Susheel Chanda