[android-developers] Re: Problem while sending unicode character via SMS

2013-04-02 Thread vong borey

Hi Andu,

I am very new to android, and face the same problem. Reading your post I am 
very happy to follow but I really don't know to use that class for sending.
Could you please give me some tips?

Thank in advance,


On Tuesday, December 29, 2009 4:02:22 PM UTC+7, andu wrote:
>
> How are you all?
>
>
> I am developing application for android phone. Currently I am testing
> my system in the emulator. In my application, I want to send unicode
> character (Amharic language character) via SMS to the other emulator
> instance. But in the receiver side, the message is not viewed
> properly. I think the problem is some character encoding related
> problem.
>
> In addition similar problem happens for texts which are queried for
> the sqlite database. that is when I send a query result via SMS the
> same problem occurs. Please help me.
>
> Sorry for posting the same message again. Please help me.
>
> Thank you
>
> Andu.
>
>

-- 
-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Re: Problem while sending unicode character via SMS

2010-01-28 Thread andu
How are you

I would like to thank you for your support. I get some code that
enables me to send unicode character. I get it for the following site

http://since2006.com/blog/android-send-unicode-message/#

It may help others.

Thank you again

Andu



On Jan 25, 10:58 pm, Frank Weiss  wrote:
> Howdy. I didn't think the missing fonts would solve the problem, but I think
> they're ultimately necessary. If you try a latin character, chances are you
> will get the same reuslt, but I would try it to make sure. I still think the
> problem is either in how the messages are being sent or possibly a
> limitiation of the carrier. Unfortunately, I'm not coding an SMS
> application, which would allow me to help you better.
>
> Can you check the PDU metadata and see if the message is being restricted to
> 7-bit or 8-bit instead of UCS-16? You can find more technical details on the
> web, but here's some info I found on a quick 
> search:http://communication.howstuffworks.com/framed.htm?parent=sms.htm&url=...
> Note
> especially the "TP-DCS" field (follow the "data coding scheme" link. Bits 3
> and 2 define the character coding. I suspect you'll see either 00 or 01,
> which would explain why the U+1200, etc., characters you are trying to send
> are reduced to U+0020. I think you should expect bits 3 and 2 to be 10 for
> UCS2 (16-bit). I wish I could give you a more definite answer, but this is
> the best I can do without actually coding an SMS application myself.

-- 
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: Problem while sending unicode character via SMS

2010-01-24 Thread andu
Hi How are you

As you have suggested me I have installed the Ethiopian font in my
device. And I think the font is installed properly. But still the SMS
doesn't work. I don't know which part I can check. The message still
replaces unicode characters by space characters in the receiving side.
can you suggest me some more points that I should check or correct?

Thank you again.

Andu.



On Jan 22, 7:51 pm, Frank Weiss  wrote:
> If the received character is U+0020 instead of U+1200, then chances are that
> the message is being restricted to 7-bit somewhere along the line. This is
> somewhat alluded to in the SDK 
> Referencehttp://developer.android.com/reference/android/telephony/SmsMessage.h...
> )
>
> Another problem may be the font. Have you installed the Ethiopian fonts in
> your device or emulator? I just tried adding ቁ into an Android
> application's string.xml res file. On both the emulator and the Droid, the
> character is displayed as a small rectangle.
>
> It may help in debugging to try some Latin-1/ISO-8859-1 characters, such as
> U+00E3. This would test the 7-bit issue without having to install Ethiopian
> fonts on the emulator or device.
>
> On Thu, Jan 21, 2010 at 10:53 PM, andu  wrote:
> > Hello How are you
>
> > I have tried to send the sms with unicode character to the android
> > phone itself and accept the message by my application (using
> > BroadcastReceiver ...)  to view its content. but still the unicode
> > character is displayed as space. And I tried to see its code using
> > codePointAt( )  and it displays number 32.
>
> > What do you suggest?
> > Should I change the encoding for my code, JVM, ...? How can I change
> > the encoding of my program? I am developing my application by Eclipse
> > and Android ADT.
>
> > Thank you for response.
>
> > and also I waiting your response
>
> > Andu
>
> > On Jan 1, 1:49 am, Frank Weiss  wrote:
> > > The code looks good AFAICT.
>
> > > Please give the actual before/after characters that are coming out wrong.
> > > For example, try the Ethiopian syllable qu, U+1241. If it's coming across
> > as
> > > a box followed by an "A", then the receiver has gotten two characters,
> > > U+0012 and U+0041. I really need to see the hexadecimal data in your sent
> > > and received SMS messages to figure out what's going wrong.
>
> > > I would also suggest that using the debugger or android.util.Log, instead
> > of
> > > Toast, would be a better way to debug.
>
> > > On Thu, Dec 31, 2009 at 2:26 AM, andu  wrote:
> > > > To send the message I have used the following function:
>
> > > > public boolean sendSMSMessage(String compiledContent, String
> > > > DistinationAddress)
> > > >        {
> > > >                String receiverPhoneNumber = DistinationAddress;
> > > >                String messageCenterPhoneNumber = "";
> > > >                SmsManager smsMgr = SmsManager.getDefault();
> > > >                smsMgr.sendTextMessage(receiverPhoneNumber, null,
> > > > compiledContent,
> > > > null, null);
> > > >                return isSent;
> > > >        }
>
> > > > To receive the message I have used the following function:
>
> > > > @Override
> > > >    public void onReceive(Context context, Intent intent) {
> > > >        Bundle bundle = intent.getExtras();
>
> > > >        if(bundle != null)
> > > >        {
> > > >                Object messages[] = (Object[]) bundle.get("pdus");
> > > >                SmsMessage smsMessage[] = new
> > SmsMessage[messages.length];
> > > >                for (int n = 0; n < messages.length; n++)
> > > >                {
> > > >                    smsMessage[n] = SmsMessage.createFromPdu((byte[])
> > > > messages
> > > > [n]);
> > > >                }
>
> > > >                // show first message
> > > >                Toast toast = Toast.makeText(context, " Brhp Received
> > SMS: "
> > > > + smsMessage[0].getMessageBody()+ "from " + smsMessage
> > > > [0].getOriginatingAddress(), Toast.LENGTH_LONG);
> > > >                toast.show();
>
> > > >                String messageBody = smsMessage[0].getMessageBody();
> > > >                String messageSource =
> > > > smsMessage[0].getOriginatingAddress();
> > > >         }
>
> > > >    }
>
> > > > On Dec 29, 1:02 am, andu  wrote:
> > > > > How are you all?
>
> > > > > I am developing application for android phone. Currently I am testing
> > > > > my system in the emulator. In my application, I want to send unicode
> > > > > character (Amharic language character) via SMS to the other emulator
> > > > > instance. But in the receiver side, the message is not viewed
> > > > > properly. I think the problem is some character encoding related
> > > > > problem.
>
> > > > > In addition similar problem happens for texts which are queried for
> > > > > the sqlite database. that is when I send a query result via SMS the
> > > > > same problem occurs. Please help me.
>
> > > > > Sorry for posting the same message again. Please help me.
>
> > > > > Thank you
>
> > > > > Andu.
>
> > > > --

Re: [android-developers] Re: Problem while sending unicode character via SMS

2010-01-22 Thread Frank Weiss
If the received character is U+0020 instead of U+1200, then chances are that
the message is being restricted to 7-bit somewhere along the line. This is
somewhat alluded to in the SDK Reference
http://developer.android.com/reference/android/telephony/SmsMessage.html#calculateLength(java.lang.CharSequence,%20boolean
)

Another problem may be the font. Have you installed the Ethiopian fonts in
your device or emulator? I just tried adding ቁ into an Android
application's string.xml res file. On both the emulator and the Droid, the
character is displayed as a small rectangle.

It may help in debugging to try some Latin-1/ISO-8859-1 characters, such as
U+00E3. This would test the 7-bit issue without having to install Ethiopian
fonts on the emulator or device.

On Thu, Jan 21, 2010 at 10:53 PM, andu  wrote:

> Hello How are you
>
> I have tried to send the sms with unicode character to the android
> phone itself and accept the message by my application (using
> BroadcastReceiver ...)  to view its content. but still the unicode
> character is displayed as space. And I tried to see its code using
> codePointAt( )  and it displays number 32.
>
> What do you suggest?
> Should I change the encoding for my code, JVM, ...? How can I change
> the encoding of my program? I am developing my application by Eclipse
> and Android ADT.
>
> Thank you for response.
>
> and also I waiting your response
>
> Andu
>
>
> On Jan 1, 1:49 am, Frank Weiss  wrote:
> > The code looks good AFAICT.
> >
> > Please give the actual before/after characters that are coming out wrong.
> > For example, try the Ethiopian syllable qu, U+1241. If it's coming across
> as
> > a box followed by an "A", then the receiver has gotten two characters,
> > U+0012 and U+0041. I really need to see the hexadecimal data in your sent
> > and received SMS messages to figure out what's going wrong.
> >
> > I would also suggest that using the debugger or android.util.Log, instead
> of
> > Toast, would be a better way to debug.
> >
> > On Thu, Dec 31, 2009 at 2:26 AM, andu  wrote:
> > > To send the message I have used the following function:
> >
> > > public boolean sendSMSMessage(String compiledContent, String
> > > DistinationAddress)
> > >{
> > >String receiverPhoneNumber = DistinationAddress;
> > >String messageCenterPhoneNumber = "";
> > >SmsManager smsMgr = SmsManager.getDefault();
> > >smsMgr.sendTextMessage(receiverPhoneNumber, null,
> > > compiledContent,
> > > null, null);
> > >return isSent;
> > >}
> >
> > > To receive the message I have used the following function:
> >
> > > @Override
> > >public void onReceive(Context context, Intent intent) {
> > >Bundle bundle = intent.getExtras();
> >
> > >if(bundle != null)
> > >{
> > >Object messages[] = (Object[]) bundle.get("pdus");
> > >SmsMessage smsMessage[] = new
> SmsMessage[messages.length];
> > >for (int n = 0; n < messages.length; n++)
> > >{
> > >smsMessage[n] = SmsMessage.createFromPdu((byte[])
> > > messages
> > > [n]);
> > >}
> >
> > >// show first message
> > >Toast toast = Toast.makeText(context, " Brhp Received
> SMS: "
> > > + smsMessage[0].getMessageBody()+ "from " + smsMessage
> > > [0].getOriginatingAddress(), Toast.LENGTH_LONG);
> > >toast.show();
> >
> > >String messageBody = smsMessage[0].getMessageBody();
> > >String messageSource =
> > > smsMessage[0].getOriginatingAddress();
> > > }
> >
> > >}
> >
> > > On Dec 29, 1:02 am, andu  wrote:
> > > > How are you all?
> >
> > > > I am developing application for android phone. Currently I am testing
> > > > my system in the emulator. In my application, I want to send unicode
> > > > character (Amharic language character) via SMS to the other emulator
> > > > instance. But in the receiver side, the message is not viewed
> > > > properly. I think the problem is some character encoding related
> > > > problem.
> >
> > > > In addition similar problem happens for texts which are queried for
> > > > the sqlite database. that is when I send a query result via SMS the
> > > > same problem occurs. Please help me.
> >
> > > > Sorry for posting the same message again. Please help me.
> >
> > > > Thank you
> >
> > > > Andu.
> >
> > > --
> > > 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
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.

[android-developers] Re: Problem while sending unicode character via SMS

2010-01-21 Thread andu
Hello How are you

I have tried to send the sms with unicode character to the android
phone itself and accept the message by my application (using
BroadcastReceiver ...)  to view its content. but still the unicode
character is displayed as space. And I tried to see its code using
codePointAt( )  and it displays number 32.

What do you suggest?
Should I change the encoding for my code, JVM, ...? How can I change
the encoding of my program? I am developing my application by Eclipse
and Android ADT.

Thank you for response.

and also I waiting your response

Andu


On Jan 1, 1:49 am, Frank Weiss  wrote:
> The code looks good AFAICT.
>
> Please give the actual before/after characters that are coming out wrong.
> For example, try the Ethiopian syllable qu, U+1241. If it's coming across as
> a box followed by an "A", then the receiver has gotten two characters,
> U+0012 and U+0041. I really need to see the hexadecimal data in your sent
> and received SMS messages to figure out what's going wrong.
>
> I would also suggest that using the debugger or android.util.Log, instead of
> Toast, would be a better way to debug.
>
> On Thu, Dec 31, 2009 at 2:26 AM, andu  wrote:
> > To send the message I have used the following function:
>
> > public boolean sendSMSMessage(String compiledContent, String
> > DistinationAddress)
> >        {
> >                String receiverPhoneNumber = DistinationAddress;
> >                String messageCenterPhoneNumber = "";
> >                SmsManager smsMgr = SmsManager.getDefault();
> >                smsMgr.sendTextMessage(receiverPhoneNumber, null,
> > compiledContent,
> > null, null);
> >                return isSent;
> >        }
>
> > To receive the message I have used the following function:
>
> > @Override
> >    public void onReceive(Context context, Intent intent) {
> >        Bundle bundle = intent.getExtras();
>
> >        if(bundle != null)
> >        {
> >                Object messages[] = (Object[]) bundle.get("pdus");
> >                SmsMessage smsMessage[] = new SmsMessage[messages.length];
> >                for (int n = 0; n < messages.length; n++)
> >                {
> >                    smsMessage[n] = SmsMessage.createFromPdu((byte[])
> > messages
> > [n]);
> >                }
>
> >                // show first message
> >                Toast toast = Toast.makeText(context, " Brhp Received SMS: "
> > + smsMessage[0].getMessageBody()+ "from " + smsMessage
> > [0].getOriginatingAddress(), Toast.LENGTH_LONG);
> >                toast.show();
>
> >                String messageBody = smsMessage[0].getMessageBody();
> >                String messageSource =
> > smsMessage[0].getOriginatingAddress();
> >         }
>
> >    }
>
> > On Dec 29, 1:02 am, andu  wrote:
> > > How are you all?
>
> > > I am developing application for android phone. Currently I am testing
> > > my system in the emulator. In my application, I want to send unicode
> > > character (Amharic language character) via SMS to the other emulator
> > > instance. But in the receiver side, the message is not viewed
> > > properly. I think the problem is some character encoding related
> > > problem.
>
> > > In addition similar problem happens for texts which are queried for
> > > the sqlite database. that is when I send a query result via SMS the
> > > same problem occurs. Please help me.
>
> > > Sorry for posting the same message again. Please help me.
>
> > > Thank you
>
> > > Andu.
>
> > --
> > 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

-- 
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


Re: [android-developers] Re: Problem while sending unicode character via SMS

2009-12-31 Thread Frank Weiss
The code looks good AFAICT.

Please give the actual before/after characters that are coming out wrong.
For example, try the Ethiopian syllable qu, U+1241. If it's coming across as
a box followed by an "A", then the receiver has gotten two characters,
U+0012 and U+0041. I really need to see the hexadecimal data in your sent
and received SMS messages to figure out what's going wrong.

I would also suggest that using the debugger or android.util.Log, instead of
Toast, would be a better way to debug.




On Thu, Dec 31, 2009 at 2:26 AM, andu  wrote:

> To send the message I have used the following function:
>
> public boolean sendSMSMessage(String compiledContent, String
> DistinationAddress)
>{
>String receiverPhoneNumber = DistinationAddress;
>String messageCenterPhoneNumber = "";
>SmsManager smsMgr = SmsManager.getDefault();
>smsMgr.sendTextMessage(receiverPhoneNumber, null,
> compiledContent,
> null, null);
>return isSent;
>}
>
> To receive the message I have used the following function:
>
>
> @Override
>public void onReceive(Context context, Intent intent) {
>Bundle bundle = intent.getExtras();
>
>if(bundle != null)
>{
>Object messages[] = (Object[]) bundle.get("pdus");
>SmsMessage smsMessage[] = new SmsMessage[messages.length];
>for (int n = 0; n < messages.length; n++)
>{
>smsMessage[n] = SmsMessage.createFromPdu((byte[])
> messages
> [n]);
>}
>
>// show first message
>Toast toast = Toast.makeText(context, " Brhp Received SMS: "
> + smsMessage[0].getMessageBody()+ "from " + smsMessage
> [0].getOriginatingAddress(), Toast.LENGTH_LONG);
>toast.show();
>
>
>String messageBody = smsMessage[0].getMessageBody();
>String messageSource =
> smsMessage[0].getOriginatingAddress();
> }
>
>
>}
>
>
>
>
>
>
>
> On Dec 29, 1:02 am, andu  wrote:
> > How are you all?
> >
> > I am developing application for android phone. Currently I am testing
> > my system in the emulator. In my application, I want to send unicode
> > character (Amharic language character) via SMS to the other emulator
> > instance. But in the receiver side, the message is not viewed
> > properly. I think the problem is some character encoding related
> > problem.
> >
> > In addition similar problem happens for texts which are queried for
> > the sqlite database. that is when I send a query result via SMS the
> > same problem occurs. Please help me.
> >
> > Sorry for posting the same message again. Please help me.
> >
> > Thank you
> >
> > Andu.
>
> --
> 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
>

-- 
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: Problem while sending unicode character via SMS

2009-12-31 Thread andu
To send the message I have used the following function:

public boolean sendSMSMessage(String compiledContent, String
DistinationAddress)
{
String receiverPhoneNumber = DistinationAddress;
String messageCenterPhoneNumber = "";
SmsManager smsMgr = SmsManager.getDefault();
smsMgr.sendTextMessage(receiverPhoneNumber, null, 
compiledContent,
null, null);
return isSent;
}

To receive the message I have used the following function:


@Override
public void onReceive(Context context, Intent intent) {
Bundle bundle = intent.getExtras();

if(bundle != null)
{
Object messages[] = (Object[]) bundle.get("pdus");
SmsMessage smsMessage[] = new SmsMessage[messages.length];
for (int n = 0; n < messages.length; n++)
{
smsMessage[n] = SmsMessage.createFromPdu((byte[]) messages
[n]);
}

// show first message
Toast toast = Toast.makeText(context, " Brhp Received SMS: "
+ smsMessage[0].getMessageBody()+ "from " + smsMessage
[0].getOriginatingAddress(), Toast.LENGTH_LONG);
toast.show();


String messageBody = smsMessage[0].getMessageBody();
String messageSource = smsMessage[0].getOriginatingAddress();
}


}







On Dec 29, 1:02 am, andu  wrote:
> How are you all?
>
> I am developing application for android phone. Currently I am testing
> my system in the emulator. In my application, I want to send unicode
> character (Amharic language character) via SMS to the other emulator
> instance. But in the receiver side, the message is not viewed
> properly. I think the problem is some character encoding related
> problem.
>
> In addition similar problem happens for texts which are queried for
> the sqlite database. that is when I send a query result via SMS the
> same problem occurs. Please help me.
>
> Sorry for posting the same message again. Please help me.
>
> Thank you
>
> Andu.

-- 
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