Here is an example of getting the SmsMessage object:
http://unlocking-android.googlecode.com/svn/chapter7/trunk/TelephonyExplorer/src/com/msi/manning/telephonyexplorer/SmsReceiver.java
The SmsMessage has various methods to get at different parts of the
message, including the body as a String.
Hi, once you read the SMS into a String, you can use the
String.substring() method to find the first character of the sms. E.g,
if the SMS is hello and it is stored in String foo, you would use
foo.substring(0,1) for the first char.
On Jan 6, 7:33 am, IPEG Student ipeg.stud...@gmail.com wrote:
Here you go.. You can get the SMS in the String Array as per below:
#
Uri uri = Uri.parse(content://sms/inbox);
Cursor c= getContentResolver().query(uri, null, body like
'%hello%',
null,null);
Hi..
All you need is simple SQL..
Modify the Cursor as:
Cursor c= getContentResolver().query(uri, null, body like
'%hello%', null,null);
Since the query takes the following argument:
public final Cursor query(Uri uri, String[] projection, String
selection, String[] selectionArgs,
Hi,
Thanks a lot for the problem, but I'm still unfortunately at square one.
Here is what I need:
Read an SMS into a string variable, then do some string operations.
For example, how can I find the first character of an SMS?
Thanks in advance for helping me out.
So you need some support like parsing strings for regular expressions
matching?
Take a look at java.util.regex.Matcher
http://code.google.com/intl/zh-CN/android/reference/java/util/regex/Matcher.html
Maybe it's helpful to you.
On Tue, Jan 6, 2009 at 3:33 PM, IPEG Student ipeg.stud...@gmail.com
6 matches
Mail list logo