Is there a function available to construct a deliver PDU type based on Standards 23.040 ? I know getSubmitPdu is used for constructing Submit PDU.
Or if someone has already written a function for it, could you please share it with me? Avi On Feb 18, 9:23 am, Mark K <mark.ka...@gmail.com> wrote: > To get thepdufrom a message, use a broadcast reciever, set the > intent filter in the manifest to recieve sms, you can get apdufrom a > message in the broadcast reciever as follows: > > public void onReceive(Context context, Intent intent) > { > // if the abort command is issued this will execute when the > next message is received. > // The message will not be processed and this instance will be > removed as a receiver. > System.out.println("onRecieve message....."); > System.out.println("Intent action: "+intent.getAction()); > if (intent.getAction().equals(ACTION_RECIEVED)) > { > System.out.println("getting messages."); > // retrieve the received sms messages form the intent. > Bundle bundle = intent.getExtras(); > if ( bundle==null) > { > System.out.println("Message bundle is null!"); > return; > } > else > { > // retrieve all incoming messages that haven't been > processed. > // typically will be only one message per receive > event. > Object[] pdusObj = (Object[]) bundle.get("pdus"); > if ( pdusObj==null ) > { > System.out.println("Messagepdu'sare null!"); > return; > } > SmsMessage[] messages = new SmsMessage[pdusObj.length]; > System.out.println("retrieving: "+pdusObj.length+" > messages."); > for (int i = 0; i<pdusObj.length; i++) > { > // create the message from thepdu > messages[i] = SmsMessage.createFromPdu ((byte[]) > pdusObj > [i]); > System.out.println("Message: "+i+" "+messages > [i].getMessageBody()); > System.out.println("Message from: "+messages > [i].getOriginatingAddress()); > if (saveMessage)saveMessage(messages[i]); > } > } > } > } > > On Feb 16, 9:48 pm, Hui <wan...@yeah.net> wrote: > > > > > To SmsMessage, it only supports to parsedeliverpduinto SmsMessage, > > but how to do a reverse operation (get adeliverpdufrom a > > SmsMessage). On the other hand, there is a method getSubmitPdu to get > > a submitpdufrom a submit message, but no reverse function.- 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-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---