0% found this document useful (0 votes)
516 views7 pages

Send Picture Message From PC To Mobile - Code Project

This article will help you to send a picture + text as sms from PC to mobile. Using c#, you can convert an image into ota format and copy all its data. You can also send a text message with a picture.

Uploaded by

vineet_tereliye
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
516 views7 pages

Send Picture Message From PC To Mobile - Code Project

This article will help you to send a picture + text as sms from PC to mobile. Using c#, you can convert an image into ota format and copy all its data. You can also send a text message with a picture.

Uploaded by

vineet_tereliye
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Send Picture Message from PC to Mobile - CodeProject

http://www.codeproject.com/KB/smart/MobileCommunication.aspx

8,308,622 members and growing! (94,781 online)

Email

Password

Sign in

J oin

Remember me? Lost password?

Home

Articles

Quick Answers

Discussions

Learning Zones

Features

Help!

The Lounge

send ota format picture as sms using nokia multim

Desktop Development Smart Client General

Send Picture Message from PC to Mobile


By Shakeel Mumtaz | 4 Jul 2007

Licence First Posted Views Downloads Bookmarked

CPOL 4 Jul 2007 232,372 1,868 43 times

See Also
More like this More by this author

.NET1.0 .NET1.1 .NET2.0 WinXP VS.NET2003 VS2005 C#2.0 .NETCF Dev Intermediate

This article will help you to send a picture + text as SMS from PC to mobile.........using C#
Article Browse Code Stats Revisions (2)
3.33 (21 votes) 78

Sponsored Links
Nexmo Nexmo is a Wholesale Messaging API service that allows developers to... nexmo.com Send email to SMS with Itduzzit SMS to email with Nexmo and Itduzzit www.itduzzit.com

Download source code - 26.07 KB

Introduction
Some days ago, I was wondering whether I could send a picture from my PC to mobile? After a lot of thinking, I came to know that I could do so. This article is a sample example for you in order to send a picture to your mobile. Text and picture messages have the same method for sending, but the only difference is the length of the message. You can fit your text into one message like if you just send "hello", but it's difficult to fit a picture in one message because you have a complete format for the picture. I am using OTA format for sending pictures to my mobile phone Sony Ericsson k500i.

Background
To understand this article, you must have knowledge of how to send text SMS.

OTA
Over the Air (OTA) is an image format for mobile phones which has standard size of 72x28, etc. It has only two colors, black and white. Read this article for how to convert an image into OTA format.

1 of 7

06-12-2011 12:03

Send Picture Message from PC to Mobile - CodeProject

http://www.codeproject.com/KB/smart/MobileCommunication.aspx

Details
First of all, convert your image into OTA format and copy all its data in any file like *.txt, *.doc, etc. Here is an example for the OTA data of image.
Collapse | Copy Code

66 40 80 80 40 5F 88 80 40 66

66 00 00 00 00 FF 10 10 00 66

66 00 00 00 20 FF 24 14 00 66

66 00 40 00 00 FF 80 40 00 66

66 60 04 00 00 FF 00 00 00 66

66 00 11 62 01 FE 40 1A 55 66

66 E0 04 89 42 A5 FF AA 55 66

66 00 44 C4 80 7F 02 AC 55 66

66 02 01 01 02 FA 01 01 02 66

99 40 40 80 80 40 40 80 80

99 00 00 00 01 0A 41 00 00

99 00 00 00 F0 AA 00 00 00

99 0E FF 00 00 00 01 00 00

99 90 FE 00 00 00 00 00 00

99 03 2F 41 00 00 03 35 00

99 10 8B 41 A2 55 AB 55 00

99 00 12 40 80 00 E0 56 00

99 02 02 01 01 02 02 01 01

80 80 40 40 80 82 44 40 99

00 00 00 00 0F 01 00 01 99

00 00 00 00 FE 50 00 00 99

00 31 00 00 00 04 08 00 99

00 08 00 00 00 40 20 80 99

00 0C 53 01 00 01 0D 6A 99

00 F3 8C 42 A5 5D 55 AA 99

00 B8 AA 80 00 08 58 AB 99

01 01 02 02 01 A1 82 02 99

As we know, when we send text SMS, we encode our text into PDU. So the same method will be used for the picture SMS.

PDU for Picture SMS (Encoding Picture)


The following example shows how to encode a picture SMS. The example includes a picture and a text "Test". The length of the Picture message is so long that the message must be sent as a concatenated message (in three SMS). Here is the encoded data: First part: (length =140)
Collapse | Copy Code

8C0B0504158A00000003010301300000045465737402010000481C0166666666 6666666666999999999999999999800000000000000001400000006000E00002 400000E900310000280000031080CF3B801800000400411044401400000FFFE2 F8B12024000000000538CAA0280000000006289C401800000000041414001400 00000001428002400020000

Second part: (length =140)


Collapse | Copy Code

8C0B0504158A00000003010302014280028001F0000000A28001800FFE000000 A500015FFFFFFFFFFEA57FFA400AAA0000005500028201500440015D08A18810 2800040FF0201404100010003ABE00244000008200D55588280101440001AAAA C0180000000003555560140010000806AAAAB024000000000555555028000000 000000000199999999999999

See Also...
How to Create a Nokia OTA Picture Message vb.net AT commands to send SMS Collapse | Copy Code Send and Read SMS through a GSM Modem using AT Commands

Third part: (length =23)

2 of 7

06-12-2011 12:03

Send Picture Message from PC to Mobile - CodeProject

http://www.codeproject.com/KB/smart/MobileCommunication.aspx

170B0504158A000000030103039999666666666666666666

A Simple Guide To Mobile Phone File Transferring Converting image files to OTA file format (Mobile Picture Message) Library for Decode/Encode SMS PDU Implementing an SMS Quiz Server Using a GSM Modem Enabled Mobile Phone .NET Phone Communication Library Part IV - Receive SMS Using VB.NET to Decode PDU string Create WAP Push SMS Messages Introduction to AT commands and its uses Mobile Birthday Reminder and Automatic SMS Sender Using VB.NET to Encode SMS and EMS PDU lib under STL for SMS How To Send and Receive SMS using GSM Modem

Explanation for the First Part


8C length of part 1 (280/2=140(dec) and 8C(hex) because our data is in hex) 0B length of user data header 05 Identifier (IEI; application port addressing scheme, 16-bit port address) 04 Information Element Data Length (IEDL) 158A Information Element Data (destination port) 0000 Information Element Data (originator port) 00 Information Element Identifier (IEI; concatenated short message, 8-bit reference number) 03 Information Element Data Length (IEDL) 01 Information Element Data (concatenated short message reference number) 03 Information Element Data (total number of concatenated messages (0-255)) 01 Information Element Data (sequence number of current short message) 30 Identifier for version, current version is (ASCII) zero "0". If it is not "0", stop processing of the message. 00 "00" <Item-length> 00 Text length 04 Text length 54657374 "Test" 02 "02" = <Item length><OTA bitmap> 0100 <Item-length> value 0100(hex) = 256(dec) = 4 octets for header and the rest for OTA bitmap data 00 The first byte of the bitmap must be 00 (hex); i.e., OTA bitmap header field 'number of animated icons' must hold 0, indicating that there is no animation, just a single static image. 48 Width = 48(hex) = 72(dec) 1C Height = 1C(hex) = 28(dec) 01 The depth of the bitmap (number of grey scales) All the rest is the image data.

The Daily Insider


30 free programming books Daily News: Signup now.

Explanation for the Second Part


8C length of part 2 (280/2=140(dec) and 8C(hex) because our data is in hex) 0B length of user data header 05 Identifier (IEI; application port addressing scheme, 16-bit port address) 04 Information Element Data Length (IEDL) 158A Information Element Data (destination port) 0000 Information Element Data (originator port) 00 Information Element Identifier (IEI; concatenated short message, 8-bit reference number) 03 Information Element Data Length (IEDL)

3 of 7

06-12-2011 12:03

Send Picture Message from PC to Mobile - CodeProject

http://www.codeproject.com/KB/smart/MobileCommunication.aspx

01 Information Element Data (concatenated short message reference number) 03 Information Element Data (total number of concatenated messages (0-255)) 02 Information Element Data (sequence number of current short message) All the rest is the image data.

Explanation for the Third Part


17 length of part 3 ((48-2)/2=23(dec) and 17(hex) because our data is in hex) 0B length of user data header 05 Identifier (IEI; application port addressing scheme, 16-bit port address) 04 Information Element Data Length (IEDL) 158A Information Element Data (destination port). 0000 Information Element Data (originator port) 00 Information Element Identifier (IEI; concatenated short message, 8-bit reference number) 03 Information Element Data Length (IEDL) 01 Information Element Data (concatenated short message reference number) 03 Information Element Data (total number of concatenated messages (0-255)) 03 Information Element Data (sequence number of current short message) All the rest is the image data. Now we have divided our image into a number of parts. So add the following data in the front of each part.
Collapse | Copy Code

0051000C91xxxxxxxxxxxx00F5A7

Explanation
00 always added 5100 not going to explain here 0C length of phone number 91 phone number format (91=international and 81=national) xxxxxxxxxxxx 12 digit phone number (for example my phone number is 23216427434. write it as 292361244743) 00F5 not going to explain here A7 time limit (24 hours in this case) Complete Example
Collapse | Copy Code

SMS # 1:

4 of 7

06-12-2011 12:03

Send Picture Message from PC to Mobile - CodeProject

http://www.codeproject.com/KB/smart/MobileCommunication.aspx

0051000C913012467234F400F5A78C0B0504158A000000030103013000000 45465737402010000481C0166666666666666666699999999999999999980 0000000000000001400000006000E00002400000E90031000028000003108 0CF3B801800000400411044401400000FFFE2F8B12024000000000538CAA0 280000000006289C401800000000041414001400000000014280024000200000 SMS # 2: 0051000C913012467234F400F5A78C0B0504158A000000030103020142800 28001F0000000A28001800FFE000000A500015FFFFFFFFFFEA57FFA400AAA 0000005500028201500440015D08A188102800040FF0201404100010003AB E00244000008200D55588280101440001AAAAC01800000000035555601400 10000806AAAAB024000000000555555028000000000000000199999999999999 SMS # 3: 0051000C913012467234F400F5A7170B0504158A0000000301030399996666 66666666666666

Send Picture SMS


The code for how to send a simple text SMS is attached with this article. Just paste your SMS PDU and send your cute picture massage. Remember that I am using a serial port for the communication. Or You can use Windows hyper terminal for sending your message. Start->Programs->Accessories->Communications->HyperTerminal And then use the following commands for sending SMS: AT+CMGF=0 (pdu mode, use the command only first time if you have multiple SMS like in our case, three SMS.) AT+CMGW=(length of pdu, for example 153 in SMS # 1) > write your pdu, in the end press ctrl+z and then press Enter. If it will display Ok, then succeeded. It will also display the message number. AT+CMSS=(message number) And now your message has been sent.

Future Work
I am trying to send MMS as well, using C#.

References
Nokia Smart_Messaging_FAQ_v2_0

5 of 7

06-12-2011 12:03

Send Picture Message from PC to Mobile - CodeProject

http://www.codeproject.com/KB/smart/MobileCommunication.aspx

History
5th July, 2007: Initial post

License
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author


Shakeel Mumtaz
Web Developer Pakistan Member

I did BS in Computer Science from Punjab University,Pakistan. I have developed lot of Softwares and mostly interested in mathematics,image processing,AI,signal processing,mobile technology,database etc. Currently working at Confiz Solutions as Sr.Software Engineer.

Article Top

Sign Up to vote

Poor

Excellent

Vot e

Comments and Discussions


You must Sign In to use this message board. (secure sign-in) FAQ Profile popups Refresh Noise level
Medium

Search Layout
Normal

Per page

10

Updat e

First Prev Next

6 of 7

06-12-2011 12:03

Send Picture Message from PC to Mobile - CodeProject

http://www.codeproject.com/KB/smart/MobileCommunication.aspx

photo 9848722979 pakistan bj dalpat Hai ra gjhgfjhgjkfj cxccxcx 8270394443 request Last Visit: 19:00 31 Dec '99 General News Last Update: 20:01 5 Dec '11 Suggestion Question Bug

dimpuvara shiva kumar mekala manojaan abhi kus vadu dalpat Suresh.avk.naidu tufan sadhukhan abrarpc4 rupesht7 m shuja

23:56 1 Dec '11 9:06 14 Oct '11 23:23 29 Sep '11 20:56 28 Aug '11 1:55 1 Aug '11 19:00 15 Jul '11 22:30 24 Jun '11 22:31 15 Mar '11 7:51 14 Mar '11 6:33 6 Mar '11 1 2 3 4 5 6 7 8 Next

Answer

Joke

Rant

Admin

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.
Permalink | Advertise | Privacy | Mobile W eb01 | 2.5.111203.1 | Last Updated 5 Jul 2007 Layout: fixed | fluid Article Copyright 2007 by Shakeel Mumtaz Everything else Copyright CodeProject, 1999-2011 Terms of Use

7 of 7

06-12-2011 12:03

You might also like