How to send and receive SMS messages from outside the emulator?

by David » Thu, 17 Apr 2008 04:22:53 GMT


Sponsored Links
 Hi, I am developing an application that requires data to be passed
between two phones via SMS messages.  One phone is a physical phone
that is our server while the other is the android emulator.  To test
the architecture I need to be able to get my messages in and out of
the emulator, so that the emulator can communicate with the server
phone.

To send messages to the emulator, I have tried opening a connection to
the emulator and sending the command "sms send <number> <message>";
however it appears that the emulator may be converting the message
into 7 bit encoding instead of leaving it at 8 bit.  This causes a
problem because my string is not meant to be interpreted as 7 bit
since the message is just a string representation of encoded and
compressed data.

At this point, our idea is to write the message to a file, push it
into the emulator, and code our SMS receiver to read the file and pass
the data in the file instead of the actual SMS message.  Then to
"send" an SMS message out, we would write it to a file and pull it out
of the emulator.  This should work but is not desirable.

Does anyone have any better suggestions on how to pass SMS data
messages in and out of the emulator?

Thanks,
David


--~--~---------~--~----~------------~-------~--~----~



How to send and receive SMS messages from outside the emulator?

by Digit » Thu, 17 Apr 2008 04:33:06 GMT


 can you elaborate about the "it appears that the emulator may be converting
the message into 7 bit encoding" ?

when using 'sms send <number> <message>', the content of <message> must be
utf-8, with a few escape conventions added in (type 'help sms send' for more
details)

internally, the SMS spec allows you to send messages in either the 7-bit GSM
alphabet or UCS-2 and the emulator will choose the proper encoding based on
the content of <message>. it will also do all the gritty-nitty segmentation
for you (since each SMS PDU is quite limited in size)

there is a known bug where any characters in the "escaped section" of the
GSM alphabet (i.e. anything in [|]{}~^) will not generate a totally proper
message, but this will be addressed in a later release...





--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Other Threads

1. Disable Fastboot or Bootloader?

I would like to know if there is any way to disable fastboot or
bootloader for Nexus One?
I've built without usb support but I'm still able to fastboot.

-- 

2. Tablayout example in Android SDK version 11

Hi ,
     I need sample example for Adding tabs in new sdk version ,below
is my code i get error in that
package com.zsl.HoneycombTab;

MY CODE:

import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.util.Log;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;

public class HoneycombTab extends TabActivity
{
    /** Called when the activity is first created. */

        public void onCreate(Bundle savedInstanceState)
        {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.main);
            TabHost tabs = (TabHost)findViewById(R.id.tabhost);

            tabs.setup();
            Log.e("Test","1");
            Resources res = getResources();
       // TabHost.TabSpec spec;
        Intent intent;
        intent=new Intent().setClass(this,Tab2.class);
        TabSpec spec = tabs.newTabSpec("Tweets");
 
spec.setIndicator("",res.getDrawable(R.drawable.selecttweets)).setContent(intent);
        Log.e("Test","2");
        tabs.addTab(spec);
        intent=new Intent().setClass(this,Tab3.class);
        TabSpec spec1 = tabs.newTabSpec("Retweets");
 
spec1.setIndicator("",res.getDrawable(R.drawable.selectretweets)).setContent(intent);
        Log.e("Test","3");
        tabs.addTab(spec1);
        intent=new Intent().setClass(this,Tab4.class);
        TabSpec spec2 = tabs.newTabSpec("Favourites");
        Log.e("Test","1");
 
spec2.setIndicator("",res.getDrawable(R.drawable.selectfavourites)).setContent(intent);
        tabs.addTab(spec2);

        }

}
My XML file:

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout
        android:id="@+id/linearLayout1"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        xmlns:android="http://schemas.android.com/apk/res/android">

<TabHost
        android:id="@+id/tabhost"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

<LinearLayout
        android:layout_width="match_parent"
        android:id="@+id/linearLayout2"
        android:layout_height="match_parent"
        android:orientation="vertical">

<TabWidget
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/tabs"></TabWidget>

<FrameLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/tabcontent">

</FrameLayout>
</LinearLayout>
</TabHost>
</LinearLayout>

-- 

3. Cinemator 0.8.9

4. miui rom

5. Intent to choose a folder containing images rather than a particular image

6. help me android

7. Ruby on Rails for Tablet Computers (Android OS)