[android-developers] re: Receiving SMS Messages in 1.0?

2009-03-25 Thread thesquib

I can confirm that joe.scheidegger information about data sms does
work on device. However, the port specified on the receiver does not
seem to matter.

Joe wrote:
receiver android:name=.YourBroadcastReceiver
intent-filter
action
android:name=android.intent.action.DATA_SMS_RECEIVED /
data  android:scheme=sms/
data android:host=localhost/
data android:port=your port/
/intent-filter
/receiver

and then you must add the following permission:
uses-permission android:name=android.permission.RECEIVE_SMS/uses-
permission
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Receiving SMS Messages in 1.0?

2009-03-25 Thread thesquib

Sorry this was meant to be a reply to this thread:
http://groups.google.com/group/android-developers/browse_frm/thread/c51383cc8761ffd5?tvc=1q=sms+port

There was no reply button.

On Mar 26, 8:57 am, thesquib thesq...@gmail.com wrote:
 I can confirm that joe.scheidegger information about data sms does
 work on device. However, the port specified on the receiver does not
 seem to matter.

 Joe wrote:

 receiver android:name=.YourBroadcastReceiver
     intent-filter
         action
 android:name=android.intent.action.DATA_SMS_RECEIVED /
         data  android:scheme=sms/
         data android:host=localhost/
         data android:port=your port/
     /intent-filter
 /receiver

 and then you must add the following permission:
 uses-permission android:name=android.permission.RECEIVE_SMS/uses-
 permission
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Receiving SMS Messages in 1.0?

2008-12-10 Thread Cristina

Hi,

The permissions you need to receive and send SMS are
   uses-permission android:name=android.permission.RECEIVE_SMS /
   uses-permission android:name=android.permission.SEND_SMS /

About binarys SMS, AFAIK is not possible to emulate binanies SMS from
DDMS. Maybe there is an option via telnet (doing a telnet to the
emulator port, it opens an emulator console..look there if there is an
appropiate command for binaries sms)..but I have not checked it (I did
that by means of another phone emulator)

About receiving binary SMS, I was trying to send them using a
port..but in the emulator I was not able to receive them by port...But
I think it is just an emulator problem, because Joe says this works on
the G1.

Cheers
On Dec 9, 5:34 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 Cristina,
 First off, thanks for the code, I have been looking everywhere for
 this and was annoyed to only find references to code from the outdated
 SDK's.
 Just a couple of questions for you.  I'm trying to implement your code
 above and was wondering what permissions need to be added to the
 manifest file.  Also, I'm still fairly new to this, is there a way to
 send binary SMS's to the emulator through either DDMS or a command
 line?  My app will intercept and handle small binary files sent via
 SMS from non android devices.  I have the binary files, and would
 prefer not to write another android app and set up a new emulator just
 to be able to send the files via SMS.

 Thanks in advance for any help.
 Chris

 On Dec 4, 9:30 am, Cristina [EMAIL PROTECTED] wrote:



  Hi Joe,

  Firt of all, thanks for the code.
  However I have tested your code with the emulator and does not work
  for me. So there must be something I am doing wrong. Have you checked
  that with the emulator or with the G1? I am doing my tests in the
  emulator because I still don't hava a phone yet.
  Can you provide the code you use to send de binarySMSand to receive
  it in the broadcastreceiver?

  Thanks
  Cristina

  On Dec 4, 11:22 am, joe.scheidegger [EMAIL PROTECTED]
  wrote:

   Hi all

   i have found the way how you can receive a binarysmsaddressed to an
   application port!
   You must create a BroadcastReceiver and then you must put the
   following in the manifest file:

   receiverandroid:name=.YourBroadcastReceiver
       intent-filter
           action
  android:name=android.intent.action.DATA_SMS_RECEIVED /
           data  android:scheme=sms/
           dataandroid:host=localhost/
           dataandroid:port=your port/
       /intent-filter
   /receiver

   and then you must add the following permission:
   uses-permissionandroid:name=android.permission.RECEIVE_SMS/uses-
   permission

   have fun!
   cheers
   joe- Hide quoted text -

  - Show quoted text -- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Receiving SMS Messages in 1.0?

2008-12-10 Thread for android
Though I have not sent a binary SMS,i think this would work
http://code.google.com/android/reference/android/telephony/gsm/SmsManager.html#sendDataMessage(java.lang.String,%20java.lang.String,%20short,%20byte[],%20android.app.PendingIntent,%20android.app.PendingIntent)http://code.google.com/android/reference/android/telephony/gsm/SmsManager.html#sendDataMessage%28java.lang.String,%20java.lang.String,%20short,%20byte%5B%5D,%20android.app.PendingIntent,%20android.app.PendingIntent%29

with the  address of the dest number being  the emulator  instance like
5554,5556 and 5558.Ofcourse  you need to start the emulator instance
you are passing in the dest number field...

On Wed, Dec 10, 2008 at 1:38 PM, Cristina [EMAIL PROTECTED] wrote:


 Hi,

 The permissions you need to receive and send SMS are
   uses-permission android:name=android.permission.RECEIVE_SMS /
   uses-permission android:name=android.permission.SEND_SMS /

 About binarys SMS, AFAIK is not possible to emulate binanies SMS from
 DDMS. Maybe there is an option via telnet (doing a telnet to the
 emulator port, it opens an emulator console..look there if there is an
 appropiate command for binaries sms)..but I have not checked it (I did
 that by means of another phone emulator)

 About receiving binary SMS, I was trying to send them using a
 port..but in the emulator I was not able to receive them by port...But
 I think it is just an emulator problem, because Joe says this works on
 the G1.

 Cheers
 On Dec 9, 5:34 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
  Cristina,
  First off, thanks for the code, I have been looking everywhere for
  this and was annoyed to only find references to code from the outdated
  SDK's.
  Just a couple of questions for you.  I'm trying to implement your code
  above and was wondering what permissions need to be added to the
  manifest file.  Also, I'm still fairly new to this, is there a way to
  send binary SMS's to the emulator through either DDMS or a command
  line?  My app will intercept and handle small binary files sent via
  SMS from non android devices.  I have the binary files, and would
  prefer not to write another android app and set up a new emulator just
  to be able to send the files via SMS.
 
  Thanks in advance for any help.
  Chris
 
  On Dec 4, 9:30 am, Cristina [EMAIL PROTECTED] wrote:
 
 
 
   Hi Joe,
 
   Firt of all, thanks for the code.
   However I have tested your code with the emulator and does not work
   for me. So there must be something I am doing wrong. Have you checked
   that with the emulator or with the G1? I am doing my tests in the
   emulator because I still don't hava a phone yet.
   Can you provide the code you use to send de binarySMSand to receive
   it in the broadcastreceiver?
 
   Thanks
   Cristina
 
   On Dec 4, 11:22 am, joe.scheidegger [EMAIL PROTECTED]
   wrote:
 
Hi all
 
i have found the way how you can receive a binarysmsaddressed to an
application port!
You must create a BroadcastReceiver and then you must put the
following in the manifest file:
 
receiverandroid:name=.YourBroadcastReceiver
intent-filter
action
   android:name=android.intent.action.DATA_SMS_RECEIVED /
data  android:scheme=sms/
dataandroid:host=localhost/
dataandroid:port=your port/
/intent-filter
/receiver
 
and then you must add the following permission:
uses-permissionandroid:name=android.permission.RECEIVE_SMS/uses-
permission
 
have fun!
cheers
joe- Hide quoted text -
 
   - Show quoted text -- Hide quoted text -
 
  - Show quoted text -
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Receiving SMS Messages in 1.0?

2008-12-09 Thread [EMAIL PROTECTED]

Cristina,
First off, thanks for the code, I have been looking everywhere for
this and was annoyed to only find references to code from the outdated
SDK's.
Just a couple of questions for you.  I'm trying to implement your code
above and was wondering what permissions need to be added to the
manifest file.  Also, I'm still fairly new to this, is there a way to
send binary SMS's to the emulator through either DDMS or a command
line?  My app will intercept and handle small binary files sent via
SMS from non android devices.  I have the binary files, and would
prefer not to write another android app and set up a new emulator just
to be able to send the files via SMS.

Thanks in advance for any help.
Chris

On Dec 4, 9:30 am, Cristina [EMAIL PROTECTED] wrote:
 Hi Joe,

 Firt of all, thanks for the code.
 However I have tested your code with the emulator and does not work
 for me. So there must be something I am doing wrong. Have you checked
 that with the emulator or with the G1? I am doing my tests in the
 emulator because I still don't hava a phone yet.
 Can you provide the code you use to send de binarySMSand to receive
 it in the broadcastreceiver?

 Thanks
 Cristina

 On Dec 4, 11:22 am, joe.scheidegger [EMAIL PROTECTED]
 wrote:



  Hi all

  i have found the way how you can receive a binarysmsaddressed to an
  application port!
  You must create a BroadcastReceiver and then you must put the
  following in the manifest file:

  receiverandroid:name=.YourBroadcastReceiver
      intent-filter
          action
 android:name=android.intent.action.DATA_SMS_RECEIVED /
          data  android:scheme=sms/
          dataandroid:host=localhost/
          dataandroid:port=your port/
      /intent-filter
  /receiver

  and then you must add the following permission:
  uses-permissionandroid:name=android.permission.RECEIVE_SMS/uses-
  permission

  have fun!
  cheers
  joe- Hide quoted text -

 - Show quoted text -

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Receiving SMS Messages in 1.0?

2008-12-04 Thread Cristina

Hi Joe,

Firt of all, thanks for the code.
However I have tested your code with the emulator and does not work
for me. So there must be something I am doing wrong. Have you checked
that with the emulator or with the G1? I am doing my tests in the
emulator because I still don't hava a phone yet.
Can you provide the code you use to send de binary SMS and to receive
it in the broadcast receiver?

Thanks
Cristina

On Dec 4, 11:22 am, joe.scheidegger [EMAIL PROTECTED]
wrote:
 Hi all

 i have found the way how you can receive a binary sms addressed to an
 application port!
 You must create a BroadcastReceiver and then you must put the
 following in the manifest file:

 receiver android:name=.YourBroadcastReceiver
     intent-filter
         action
 android:name=android.intent.action.DATA_SMS_RECEIVED /
         data  android:scheme=sms/
         data android:host=localhost/
         data android:port=your port/
     /intent-filter
 /receiver

 and then you must add the following permission:
 uses-permission android:name=android.permission.RECEIVE_SMS/uses-
 permission

 have fun!
 cheers
 joe
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Receiving SMS Messages in 1.0?

2008-11-21 Thread Mihai

  Thanks for the code example, I tried and it worked just fine.
However, I would like to know if in version 1.0 there are other ways
of reacting to an SMS and parsing its data, it seems to me a little
bit weird that there is no high level way to do this.

Have fun,
Mihai

On Sep 24, 12:21 pm, Cristina [EMAIL PROTECTED] wrote:
 Hi,

 I do not know if it is the right way, but I have found a way to get
 the message.
 Here I include my code to get the SmsMessages. I hope it helps you

 public class ServerMessagesReceiver extends BroadcastReceiver {

     static final String ACTION =
 android.provider.Telephony.SMS_RECEIVED;

     public void onReceive(Context context, Intent intent) {
         if (intent.getAction().equals(ACTION)) {
                  StringBuilder buf = new StringBuilder();
                  Bundle bundle = intent.getExtras();
                  if (bundle != null) {
                          Object[] pdusObj = (Object[]) bundle.get(pdus);
                          SmsMessage[] messages = new 
 SmsMessage[pdusObj.length];
                          for (int i = 0; ipdusObj.length; i++) {
                                  messages[i] = SmsMessage.createFromPdu 
 ((byte[]) pdusObj[i]);
                          }
 
 
 ...

 By the way, Does somebody know how to receive anSMSthat has been
 sent using
 an application port using the methos.sendDataMessage?

 On 24 sep, 08:15, Reto Meier [EMAIL PROTECTED] wrote:

  Is it still possible to listen for incomingSMSmessages in the latest
  1.0 SDK release?

  The SMS_RECEIVED_ACTION string used to listen for incomingSMS
  messages seems to have gone missing. It used to be available from the
  android.provider.Telephony.Smspackage, which also seems to have
  disappeared, so getMessagesFromIntent has gone too.

  Previously, you could create a Broadcast Receiver to listen forSMS
  messages using this code:

    String incoming_SMS =
  android.provider.Telephony.Sms.Intents.SMS_RECEIVED_ACTION;

    public void onReceive(Context _context, Intent _intent) {

      if (_intent.getAction().equals(incoming_SMS)) {
        SmsManagersms= SmsManager.getDefault();
        SmsMessage[] messages =
 Sms.Intents.getMessagesFromIntent(_intent);
      }

  Is there still a way to do this?

  Thanks
  Reto

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Receiving SMS Messages in 1.0?

2008-10-23 Thread rh

Hi,

Very nice.

Does this mean that only your application will handle the incoming
SMS?
Or does it mean you can read the incoming SMS but they will also be
directed to the regular SMS app?

Thanks

On 24 Sep, 12:21, Cristina [EMAIL PROTECTED] wrote:
 Hi,

 I do not know if it is the right way, but I have found a way to get
 the message.
 Here I include my code to get the SmsMessages. I hope it helps you

 public class ServerMessagesReceiver extends BroadcastReceiver {

     static final String ACTION =
 android.provider.Telephony.SMS_RECEIVED;

     public void onReceive(Context context, Intent intent) {
         if (intent.getAction().equals(ACTION)) {
                  StringBuilder buf = new StringBuilder();
                  Bundle bundle = intent.getExtras();
                  if (bundle != null) {
                          Object[] pdusObj = (Object[]) bundle.get(pdus);
                          SmsMessage[] messages = new 
 SmsMessage[pdusObj.length];
                          for (int i = 0; ipdusObj.length; i++) {
                                  messages[i] = SmsMessage.createFromPdu 
 ((byte[]) pdusObj[i]);
                          }
 
 
 ...

 By the way, Does somebody know how to receive an SMS that has been
 sent using
 an application port using the methos.sendDataMessage?

 On 24 sep, 08:15, Reto Meier [EMAIL PROTECTED] wrote: Is it still possible 
 to listen for incoming SMS messages in the latest
  1.0 SDK release?

  The SMS_RECEIVED_ACTION string used to listen for incoming SMS
  messages seems to have gone missing. It used to be available from the
  android.provider.Telephony.Sms package, which also seems to have
  disappeared, so getMessagesFromIntent has gone too.

  Previously, you could create a Broadcast Receiver to listen for SMS
  messages using this code:

    String incoming_SMS =
  android.provider.Telephony.Sms.Intents.SMS_RECEIVED_ACTION;

    public void onReceive(Context _context, Intent _intent) {

      if (_intent.getAction().equals(incoming_SMS)) {
        SmsManager sms = SmsManager.getDefault();
        SmsMessage[] messages =
  Sms.Intents.getMessagesFromIntent(_intent);
      }

  Is there still a way to do this?

  Thanks
  Reto

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Receiving SMS Messages in 1.0?

2008-10-02 Thread Cristina

Hi Justin,

Related to the problem of sending binary sms to port, I have changed
that parameter to null, and I send the data message using a port from
5554 emulator to 5556. This seems to work looking to the log
files.

The problem is that I am not able to receive the SMS data message in
the 5556 phone. So  there must be something I am doing wrong.

In order to receive the SMS to port messege in 5556 I have created
a BroadcastReceiver listening to the
android.provider.Telephony.SMS_RECEIVED action.
I did not know how to declare the port that this receiver is listening
to...so I figured out that maybe it was declared using the port option
in the manifest..

   receiver android:name=.ServerMessagesReceiver
   intent-filter
action android:name=android.provider.Telephony.SMS_RECEIVED /
data android:port=16001/data
  /intent-filter
   /receiver

Is this the right way to declare the port that this SMS receiver is
listening to? I suppose the problem is there

Thanks in advance for the help

Cristina


On Oct 2, 2:32 am, Justin (Google Employee) [EMAIL PROTECTED] wrote:
 Cristina,

 Set the second parameter to null. The scAddress relates to the address
 of the server on the cellular network that will handle the message, it
 is not the address of the sender.

 Cheers,
 Justin
 Android Team @ Google

 On Sep 24, 5:55 am, Cristina [EMAIL PROTECTED] wrote:



  I have just done a text to send a messege to aportusing this

  SmsManager smsManager = SmsManager.getDefault();
  shortport= 16001;
  smsManager.sendDataMessage(5556,5554,port, Hola.getBytes(),
  null, null);

  I use two emulators, one is launched at 5554 and the other at 5556 and
  I try to send the binarysmsfrom 5554 to 5556.
  In the 5556 phone I have launch an application with a
  BroadcastReceiver in order to receiveSMSMessages (but I do not know
  how to specify theport)

  The application does not failed. But the 5556 phone does not receive
  anything.
  Instead, in the console I receive the following messege every time I
  do a try
  [2008-09-24 14:05:06 - ddms]ADB rejected shell command (ls -l /):

  Strange but it seems that the adb is receiving the request...

  Does anybody has an example on how to send/receive binarySMSto an
  applicationportusing  sendDataMessage?

  On 24 sep, 14:20, De San Nicolas Jean Philippe [EMAIL PROTECTED]
  wrote:

   Hello, I've tried your code but it failed! my application failed. Have you
   tried and succeed?

   2008/9/24 Cristina [EMAIL PROTECTED]

Hi,

I do not know if it is the right way, but I have found a way to get
the message.
Here I include my code to get the SmsMessages. I hope it helps you

public class ServerMessagesReceiver extends BroadcastReceiver {

   static final String ACTION =
android.provider.Telephony.SMS_RECEIVED;

   public void onReceive(Context context, Intent intent) {
        if (intent.getAction().equals(ACTION)) {
                StringBuilder buf = new StringBuilder();
                Bundle bundle = intent.getExtras();
                if (bundle != null) {
                        Object[] pdusObj = (Object[]) 
bundle.get(pdus);
                        SmsMessage[] messages = new
SmsMessage[pdusObj.length];
                        for (int i = 0; ipdusObj.length; i++) {
                                messages[i] = SmsMessage.createFromPdu
((byte[]) pdusObj[i]);
                        }


...

By the way, Does somebody know how to receive anSMSthat has been
sent using
an applicationportusing the methos.sendDataMessage?

On 24 sep, 08:15, Reto Meier [EMAIL PROTECTED] wrote:
 Is it still possible to listen for incomingSMSmessages in the latest
 1.0 SDK release?

 The SMS_RECEIVED_ACTION string used to listen for incomingSMS
 messages seems to have gone missing. It used to be available from the
 android.provider.Telephony.Smspackage, which also seems to have
 disappeared, so getMessagesFromIntent has gone too.

 Previously, you could create a Broadcast Receiver to listen forSMS
 messages using this code:

   String incoming_SMS =
 android.provider.Telephony.Sms.Intents.SMS_RECEIVED_ACTION;

   public void onReceive(Context _context, Intent _intent) {

     if (_intent.getAction().equals(incoming_SMS)) {
       SmsManagersms= SmsManager.getDefault();
       SmsMessage[] messages =
Sms.Intents.getMessagesFromIntent(_intent);
     }

 Is there still a way to do this?

 Thanks
 Reto- Ocultar texto de la cita -

   - Mostrar texto de la cita -- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to

[android-developers] Re: Receiving SMS Messages in 1.0?

2008-10-01 Thread Justin (Google Employee)

Cristina,

Set the second parameter to null. The scAddress relates to the address
of the server on the cellular network that will handle the message, it
is not the address of the sender.

Cheers,
Justin
Android Team @ Google

On Sep 24, 5:55 am, Cristina [EMAIL PROTECTED] wrote:
 I have just done a text to send a messege to a port using this

 SmsManager smsManager = SmsManager.getDefault();
 short port = 16001;
 smsManager.sendDataMessage(5556,5554, port, Hola.getBytes(),
 null, null);

 I use two emulators, one is launched at 5554 and the other at 5556 and
 I try to send the binary sms from 5554 to 5556.
 In the 5556 phone I have launch an application with a
 BroadcastReceiver in order to receive SMS Messages (but I do not know
 how to specify the port)

 The application does not failed. But the 5556 phone does not receive
 anything.
 Instead, in the console I receive the following messege every time I
 do a try
 [2008-09-24 14:05:06 - ddms]ADB rejected shell command (ls -l /):

 Strange but it seems that the adb is receiving the request...

 Does anybody has an example on how to send/receive binary SMS to an
 application port using  sendDataMessage?

 On 24 sep, 14:20, De San Nicolas Jean Philippe [EMAIL PROTECTED]
 wrote:

  Hello, I've tried your code but it failed! my application failed. Have you
  tried and succeed?

  2008/9/24 Cristina [EMAIL PROTECTED]

   Hi,

   I do not know if it is the right way, but I have found a way to get
   the message.
   Here I include my code to get the SmsMessages. I hope it helps you

   public class ServerMessagesReceiver extends BroadcastReceiver {

      static final String ACTION =
   android.provider.Telephony.SMS_RECEIVED;

      public void onReceive(Context context, Intent intent) {
           if (intent.getAction().equals(ACTION)) {
                   StringBuilder buf = new StringBuilder();
                   Bundle bundle = intent.getExtras();
                   if (bundle != null) {
                           Object[] pdusObj = (Object[]) bundle.get(pdus);
                           SmsMessage[] messages = new
   SmsMessage[pdusObj.length];
                           for (int i = 0; ipdusObj.length; i++) {
                                   messages[i] = SmsMessage.createFromPdu
   ((byte[]) pdusObj[i]);
                           }
   
   
   ...

   By the way, Does somebody know how to receive an SMS that has been
   sent using
   an application port using the methos.sendDataMessage?

   On 24 sep, 08:15, Reto Meier [EMAIL PROTECTED] wrote:
Is it still possible to listen for incoming SMS messages in the latest
1.0 SDK release?

The SMS_RECEIVED_ACTION string used to listen for incoming SMS
messages seems to have gone missing. It used to be available from the
android.provider.Telephony.Sms package, which also seems to have
disappeared, so getMessagesFromIntent has gone too.

Previously, you could create a Broadcast Receiver to listen for SMS
messages using this code:

  String incoming_SMS =
android.provider.Telephony.Sms.Intents.SMS_RECEIVED_ACTION;

  public void onReceive(Context _context, Intent _intent) {

    if (_intent.getAction().equals(incoming_SMS)) {
      SmsManager sms = SmsManager.getDefault();
      SmsMessage[] messages =
Sms.Intents.getMessagesFromIntent(_intent);
    }

Is there still a way to do this?

Thanks
Reto- Ocultar texto de la cita -

  - Mostrar texto de la cita -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Receiving SMS Messages in 1.0?

2008-09-29 Thread Reto Meier

There's a bit of confusion upthread, so I'm just confirming that
Cristina's code sample works perfectly.

Using it you can listen for incoming SMS messages and extract each
message from the Intent. Thanks Christina!

Cheers
Reto Meier

-
Professional Android Application Development
http://www.amazon.com/gp/product/0470344717?tag=interventione-20

On 24 Sep, 14:03, Cristina [EMAIL PROTECTED] wrote:
 Sorry I misundertand your message..

 Yes I have tried that part of the application (receiving a text sms)
 and works for me.

 I have send the message using the DDMS send utility...
 Maybe you can use the debugger in order to see if you are receiving
 the intent bundle with the extra pdus...
 Using the debugger I discovered that the intent bundle has this pdus
 extra, which is an Object[].
 Each Object[] element is a pdu (byte[])

 Can you see this using the debugger? Where is your application
 failing?

 Cristina

 On 24 sep, 14:20, De San Nicolas Jean Philippe [EMAIL PROTECTED]
 wrote:



  Hello, I've tried your code but it failed! my application failed. Have you
  tried and succeed?

  2008/9/24 Cristina [EMAIL PROTECTED]

   Hi,

   I do not know if it is the right way, but I have found a way to get
   the message.
   Here I include my code to get the SmsMessages. I hope it helps you

   public class ServerMessagesReceiver extends BroadcastReceiver {

      static final String ACTION =
   android.provider.Telephony.SMS_RECEIVED;

      public void onReceive(Context context, Intent intent) {
           if (intent.getAction().equals(ACTION)) {
                   StringBuilder buf = new StringBuilder();
                   Bundle bundle = intent.getExtras();
                   if (bundle != null) {
                           Object[] pdusObj = (Object[]) bundle.get(pdus);
                           SmsMessage[] messages = new
   SmsMessage[pdusObj.length];
                           for (int i = 0; ipdusObj.length; i++) {
                                   messages[i] = SmsMessage.createFromPdu
   ((byte[]) pdusObj[i]);
                           }
   
   
   ...

   By the way, Does somebody know how to receive an SMS that has been
   sent using
   an application port using the methos.sendDataMessage?

   On 24 sep, 08:15, Reto Meier [EMAIL PROTECTED] wrote:
Is it still possible to listen for incoming SMS messages in the latest
1.0 SDK release?

The SMS_RECEIVED_ACTION string used to listen for incoming SMS
messages seems to have gone missing. It used to be available from the
android.provider.Telephony.Sms package, which also seems to have
disappeared, so getMessagesFromIntent has gone too.

Previously, you could create a Broadcast Receiver to listen for SMS
messages using this code:

  String incoming_SMS =
android.provider.Telephony.Sms.Intents.SMS_RECEIVED_ACTION;

  public void onReceive(Context _context, Intent _intent) {

    if (_intent.getAction().equals(incoming_SMS)) {
      SmsManager sms = SmsManager.getDefault();
      SmsMessage[] messages =
Sms.Intents.getMessagesFromIntent(_intent);
    }

Is there still a way to do this?

Thanks
Reto- Ocultar texto de la cita -

  - Mostrar texto de la cita -- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Receiving SMS Messages in 1.0?

2008-09-29 Thread anu

Hi,

I have been trying the receive sms app myself. It worked fine in 0.9
version. But, in the 1.0 version, there is no
android.provider.Telephony class and I see no other intents which I
can use to retrieve a received SMS. Please let me know if you have any
working code in the latest SDK.

Thanks,
Anu

On Sep 24, 6:03 pm, Cristina [EMAIL PROTECTED] wrote:
 Sorry I misundertand your message..

 Yes I have tried that part of the application (receiving a textsms)
 and works for me.

 I have send the message using the DDMS send utility...
 Maybe you can use the debugger in order to see if you are receiving
 the intent bundle with the extra pdus...
 Using the debugger I discovered that the intent bundle has this pdus
 extra, which is an Object[].
 Each Object[] element is a pdu (byte[])

 Can you see this using the debugger? Where is your application
 failing?

 Cristina

 On 24 sep, 14:20, De San Nicolas Jean Philippe [EMAIL PROTECTED]
 wrote:

  Hello, I've tried your code but it failed! my application failed. Have you
  tried and succeed?

  2008/9/24 Cristina [EMAIL PROTECTED]

   Hi,

   I do not know if it is the right way, but I have found a way to get
   the message.
   Here I include my code to get the SmsMessages. I hope it helps you

   public class ServerMessagesReceiver extends BroadcastReceiver {

      static final String ACTION =
   android.provider.Telephony.SMS_RECEIVED;

      public void onReceive(Context context, Intent intent) {
           if (intent.getAction().equals(ACTION)) {
                   StringBuilder buf = new StringBuilder();
                   Bundle bundle = intent.getExtras();
                   if (bundle != null) {
                           Object[] pdusObj = (Object[]) bundle.get(pdus);
                           SmsMessage[] messages = new
   SmsMessage[pdusObj.length];
                           for (int i = 0; ipdusObj.length; i++) {
                                   messages[i] = SmsMessage.createFromPdu
   ((byte[]) pdusObj[i]);
                           }
   
   
   ...

   By the way, Does somebody know how toreceiveanSMSthat has been
   sent using
   an application port using the methos.sendDataMessage?

   On 24 sep, 08:15, Reto Meier [EMAIL PROTECTED] wrote:
Is it still possible to listen for incomingSMSmessages in the latest
1.0 SDK release?

The SMS_RECEIVED_ACTION string used to listen for incomingSMS
messages seems to have gone missing. It used to be available from the
android.provider.Telephony.Smspackage, which also seems to have
disappeared, so getMessagesFromIntent has gone too.

Previously, you could create a Broadcast Receiver to listen forSMS
messages using this code:

  String incoming_SMS =
android.provider.Telephony.Sms.Intents.SMS_RECEIVED_ACTION;

  public void onReceive(Context _context, Intent _intent) {

    if (_intent.getAction().equals(incoming_SMS)) {
      SmsManagersms= SmsManager.getDefault();
      SmsMessage[] messages =
   Sms.Intents.getMessagesFromIntent(_intent);
    }

Is there still a way to do this?

Thanks
Reto- Ocultar texto de la cita -

  - Mostrar texto de la cita -

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Receiving SMS Messages in 1.0?

2008-09-24 Thread [EMAIL PROTECTED]

In reply please also include sending SMS capability in 1.0 for
background connection to the cloud reasons

On Sep 24, 1:15 am, Reto Meier [EMAIL PROTECTED] wrote:
 Is it still possible to listen for incoming SMS messages in the latest
 1.0 SDK release?

 The SMS_RECEIVED_ACTION string used to listen for incoming SMS
 messages seems to have gone missing. It used to be available from the
 android.provider.Telephony.Sms package, which also seems to have
 disappeared, so getMessagesFromIntent has gone too.

 Previously, you could create a Broadcast Receiver to listen for SMS
 messages using this code:

   String incoming_SMS =
 android.provider.Telephony.Sms.Intents.SMS_RECEIVED_ACTION;

   public void onReceive(Context _context, Intent _intent) {

     if (_intent.getAction().equals(incoming_SMS)) {
       SmsManager sms = SmsManager.getDefault();
       SmsMessage[] messages =
 Sms.Intents.getMessagesFromIntent(_intent);
     }

 Is there still a way to do this?

 Thanks
 Reto
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Receiving SMS Messages in 1.0?

2008-09-24 Thread Reto Meier

 please also include sending SMS capability in 1.0

From what I've seen it looks like sending SMS is still supported in
1.0, it's just receiving SMSs that's changed / gone.


On Sep 24, 9:57 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 In reply please also include sending SMS capability in 1.0 for
 background connection to the cloud reasons

 On Sep 24, 1:15 am, Reto Meier [EMAIL PROTECTED] wrote:



  Is it still possible to listen for incoming SMS messages in the latest
  1.0 SDK release?

  The SMS_RECEIVED_ACTION string used to listen for incoming SMS
  messages seems to have gone missing. It used to be available from the
  android.provider.Telephony.Sms package, which also seems to have
  disappeared, so getMessagesFromIntent has gone too.

  Previously, you could create a Broadcast Receiver to listen for SMS
  messages using this code:

    String incoming_SMS =
  android.provider.Telephony.Sms.Intents.SMS_RECEIVED_ACTION;

    public void onReceive(Context _context, Intent _intent) {

      if (_intent.getAction().equals(incoming_SMS)) {
        SmsManager sms = SmsManager.getDefault();
        SmsMessage[] messages =
  Sms.Intents.getMessagesFromIntent(_intent);
      }

  Is there still a way to do this?

  Thanks
  Reto- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Receiving SMS Messages in 1.0?

2008-09-24 Thread Cristina

Hi,

I do not know if it is the right way, but I have found a way to get
the message.
Here I include my code to get the SmsMessages. I hope it helps you


public class ServerMessagesReceiver extends BroadcastReceiver {

static final String ACTION =
android.provider.Telephony.SMS_RECEIVED;

public void onReceive(Context context, Intent intent) {
if (intent.getAction().equals(ACTION)) {
 StringBuilder buf = new StringBuilder();
 Bundle bundle = intent.getExtras();
 if (bundle != null) {
 Object[] pdusObj = (Object[]) bundle.get(pdus);
 SmsMessage[] messages = new SmsMessage[pdusObj.length];
 for (int i = 0; ipdusObj.length; i++) {
 messages[i] = SmsMessage.createFromPdu 
((byte[]) pdusObj[i]);
 }


...

By the way, Does somebody know how to receive an SMS that has been
sent using
an application port using the methos.sendDataMessage?


On 24 sep, 08:15, Reto Meier [EMAIL PROTECTED] wrote:
 Is it still possible to listen for incoming SMS messages in the latest
 1.0 SDK release?

 The SMS_RECEIVED_ACTION string used to listen for incoming SMS
 messages seems to have gone missing. It used to be available from the
 android.provider.Telephony.Sms package, which also seems to have
 disappeared, so getMessagesFromIntent has gone too.

 Previously, you could create a Broadcast Receiver to listen for SMS
 messages using this code:

   String incoming_SMS =
 android.provider.Telephony.Sms.Intents.SMS_RECEIVED_ACTION;

   public void onReceive(Context _context, Intent _intent) {

     if (_intent.getAction().equals(incoming_SMS)) {
       SmsManager sms = SmsManager.getDefault();
       SmsMessage[] messages =
 Sms.Intents.getMessagesFromIntent(_intent);
     }

 Is there still a way to do this?

 Thanks
 Reto
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Receiving SMS Messages in 1.0?

2008-09-24 Thread De San Nicolas Jean Philippe
Hello, I've tried your code but it failed! my application failed. Have you
tried and succeed?

2008/9/24 Cristina [EMAIL PROTECTED]


 Hi,

 I do not know if it is the right way, but I have found a way to get
 the message.
 Here I include my code to get the SmsMessages. I hope it helps you


 public class ServerMessagesReceiver extends BroadcastReceiver {

static final String ACTION =
 android.provider.Telephony.SMS_RECEIVED;

public void onReceive(Context context, Intent intent) {
 if (intent.getAction().equals(ACTION)) {
 StringBuilder buf = new StringBuilder();
 Bundle bundle = intent.getExtras();
 if (bundle != null) {
 Object[] pdusObj = (Object[]) bundle.get(pdus);
 SmsMessage[] messages = new
 SmsMessage[pdusObj.length];
 for (int i = 0; ipdusObj.length; i++) {
 messages[i] = SmsMessage.createFromPdu
 ((byte[]) pdusObj[i]);
 }
 
 
 ...

 By the way, Does somebody know how to receive an SMS that has been
 sent using
 an application port using the methos.sendDataMessage?


 On 24 sep, 08:15, Reto Meier [EMAIL PROTECTED] wrote:
  Is it still possible to listen for incoming SMS messages in the latest
  1.0 SDK release?
 
  The SMS_RECEIVED_ACTION string used to listen for incoming SMS
  messages seems to have gone missing. It used to be available from the
  android.provider.Telephony.Sms package, which also seems to have
  disappeared, so getMessagesFromIntent has gone too.
 
  Previously, you could create a Broadcast Receiver to listen for SMS
  messages using this code:
 
String incoming_SMS =
  android.provider.Telephony.Sms.Intents.SMS_RECEIVED_ACTION;
 
public void onReceive(Context _context, Intent _intent) {
 
  if (_intent.getAction().equals(incoming_SMS)) {
SmsManager sms = SmsManager.getDefault();
SmsMessage[] messages =
  Sms.Intents.getMessagesFromIntent(_intent);
  }
 
  Is there still a way to do this?
 
  Thanks
  Reto
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Receiving SMS Messages in 1.0?

2008-09-24 Thread De San Nicolas Jean Philippe
hello, it works,sorry


2008/9/24 De San Nicolas Jean Philippe [EMAIL PROTECTED]

 Hello, I've tried your code but it failed! my application failed. Have you
 tried and succeed?

 2008/9/24 Cristina [EMAIL PROTECTED]


 Hi,

 I do not know if it is the right way, but I have found a way to get
 the message.
 Here I include my code to get the SmsMessages. I hope it helps you


 public class ServerMessagesReceiver extends BroadcastReceiver {

static final String ACTION =
 android.provider.Telephony.SMS_RECEIVED;

public void onReceive(Context context, Intent intent) {
 if (intent.getAction().equals(ACTION)) {
 StringBuilder buf = new StringBuilder();
 Bundle bundle = intent.getExtras();
 if (bundle != null) {
 Object[] pdusObj = (Object[]) bundle.get(pdus);
 SmsMessage[] messages = new
 SmsMessage[pdusObj.length];
 for (int i = 0; ipdusObj.length; i++) {
 messages[i] = SmsMessage.createFromPdu
 ((byte[]) pdusObj[i]);
 }
 
 
 ...

 By the way, Does somebody know how to receive an SMS that has been
 sent using
 an application port using the methos.sendDataMessage?


 On 24 sep, 08:15, Reto Meier [EMAIL PROTECTED] wrote:
  Is it still possible to listen for incoming SMS messages in the latest
  1.0 SDK release?
 
  The SMS_RECEIVED_ACTION string used to listen for incoming SMS
  messages seems to have gone missing. It used to be available from the
  android.provider.Telephony.Sms package, which also seems to have
  disappeared, so getMessagesFromIntent has gone too.
 
  Previously, you could create a Broadcast Receiver to listen for SMS
  messages using this code:
 
String incoming_SMS =
  android.provider.Telephony.Sms.Intents.SMS_RECEIVED_ACTION;
 
public void onReceive(Context _context, Intent _intent) {
 
  if (_intent.getAction().equals(incoming_SMS)) {
SmsManager sms = SmsManager.getDefault();
SmsMessage[] messages =
  Sms.Intents.getMessagesFromIntent(_intent);
  }
 
  Is there still a way to do this?
 
  Thanks
  Reto
 



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Receiving SMS Messages in 1.0?

2008-09-24 Thread Cristina

I have just done a text to send a messege to a port using this

SmsManager smsManager = SmsManager.getDefault();
short port = 16001;
smsManager.sendDataMessage(5556,5554, port, Hola.getBytes(),
null, null);

I use two emulators, one is launched at 5554 and the other at 5556 and
I try to send the binary sms from 5554 to 5556.
In the 5556 phone I have launch an application with a
BroadcastReceiver in order to receive SMS Messages (but I do not know
how to specify the port)

The application does not failed. But the 5556 phone does not receive
anything.
Instead, in the console I receive the following messege every time I
do a try
[2008-09-24 14:05:06 - ddms]ADB rejected shell command (ls -l /):

Strange but it seems that the adb is receiving the request...

Does anybody has an example on how to send/receive binary SMS to an
application port using  sendDataMessage?





On 24 sep, 14:20, De San Nicolas Jean Philippe [EMAIL PROTECTED]
wrote:
 Hello, I've tried your code but it failed! my application failed. Have you
 tried and succeed?

 2008/9/24 Cristina [EMAIL PROTECTED]





  Hi,

  I do not know if it is the right way, but I have found a way to get
  the message.
  Here I include my code to get the SmsMessages. I hope it helps you

  public class ServerMessagesReceiver extends BroadcastReceiver {

     static final String ACTION =
  android.provider.Telephony.SMS_RECEIVED;

     public void onReceive(Context context, Intent intent) {
          if (intent.getAction().equals(ACTION)) {
                  StringBuilder buf = new StringBuilder();
                  Bundle bundle = intent.getExtras();
                  if (bundle != null) {
                          Object[] pdusObj = (Object[]) bundle.get(pdus);
                          SmsMessage[] messages = new
  SmsMessage[pdusObj.length];
                          for (int i = 0; ipdusObj.length; i++) {
                                  messages[i] = SmsMessage.createFromPdu
  ((byte[]) pdusObj[i]);
                          }
  
  
  ...

  By the way, Does somebody know how to receive an SMS that has been
  sent using
  an application port using the methos.sendDataMessage?

  On 24 sep, 08:15, Reto Meier [EMAIL PROTECTED] wrote:
   Is it still possible to listen for incoming SMS messages in the latest
   1.0 SDK release?

   The SMS_RECEIVED_ACTION string used to listen for incoming SMS
   messages seems to have gone missing. It used to be available from the
   android.provider.Telephony.Sms package, which also seems to have
   disappeared, so getMessagesFromIntent has gone too.

   Previously, you could create a Broadcast Receiver to listen for SMS
   messages using this code:

     String incoming_SMS =
   android.provider.Telephony.Sms.Intents.SMS_RECEIVED_ACTION;

     public void onReceive(Context _context, Intent _intent) {

       if (_intent.getAction().equals(incoming_SMS)) {
         SmsManager sms = SmsManager.getDefault();
         SmsMessage[] messages =
   Sms.Intents.getMessagesFromIntent(_intent);
       }

   Is there still a way to do this?

   Thanks
   Reto- Ocultar texto de la cita -

 - Mostrar texto de la cita -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---