Contact Editor - PC application? - HD2 General

I've been wondering if there is any application I could use to edit contacts on HD2, directly from PC.
I would need to rename every each of them, doing it manually on phone will take much time.
Thank you in advance.

If you synchronise with Outlook (via Activesync) you can easily edit contacts on your PC. Of course this requires outlook.
Or you could install something like myFunambol and synchronising with their server. Edit on the web interface and sync back.

Efficasoft Mobile Express (google it, I dont have permissions to add outside link)
it works with my LEo and it's for free

I sync my contacts with Google and edit them on there.
Can't stand Outlook.

stratplayer said:
I sync my contacts with Google and edit them on there.
Can't stand Outlook.
Click to expand...
Click to collapse
How did you do it?

You can also sync your phone with Microsoft MyPhone and edit your contacts on the myphone website. Works fine and you don't need to connect your phone with your pc.

Thank you guys. Efficasoft Mobile Express did its job.

stratplayer said:
Can't stand Outlook.
Click to expand...
Click to collapse
Don't ever get one of those good jobs where you sit in an office then, because rest assured they'll be using Exchange and Outlook.
The solution to the OP's problem is to sync your phone with a Microsoft Exchange and edit your contacts in Outlook, and let Microsoft Exchange Server ActiveSync seamlessly and wirelessly sync the changes to your phone.
As far as I'm concerned, a smartphone isn't really a smartphone unless it's sync'd with Microsoft Exchange.

Spike15 said:
Don't ever get one of those good jobs where you sit in an office then, because rest assured they'll be using Exchange and Outlook.
The solution to the OP's problem is to sync your phone with a Microsoft Exchange and edit your contacts in Outlook, and let Microsoft Exchange Server ActiveSync seamlessly and wirelessly sync the changes to your phone.
As far as I'm concerned, a smartphone isn't really a smartphone unless it's sync'd with Microsoft Exchange.
Click to expand...
Click to collapse
I am afraid I do already, IT related job too. But I have a loathing for Outlook as it reminds me of being at work!
I use my HD2 to sync with Googlemail and Hotmail, thats it. So the Windows Device Centre on my Win7 PC isn't much use to me to be honest other than to do a guest connection.
The large company I work for doesnt allow connections outside of the domain with VPN and encryption, if I could do it I would then of course use Outlook to sync.

here a script in VBA for the outlook
****************************
Private Sub ReFileContacts()
Dim items As items, folder As folder
Dim contactItems As Outlook.items
Dim itemContact As Outlook.ContactItem
Dim StrAux As String
Dim StrFName As String
Dim StrMName As String
Dim StrLName As String
Dim StrSuf As String
Dim objcat As String
Set folder = Session.GetDefaultFolder(olFolderContacts)
Set items = folder.items
Count = items.Count
If Count = 0 Then
MsgBox "Nothing to do!"
Exit Sub
End If
' Filter on the message class to obtain only contact items in the folder.
Set contactItems = items.Restrict("[MessageClass]='IPM.Contact'")
Set contactItems = items.Restrict("[MessageClass]='IPM.Contact'")
For Each itemContact In contactItems
StrFName = ""
StrMName = ""
StrLName = ""
StrSuf = ""
StrAux = ""
If Len(itemContact.FirstName) > 0 Then StrFName = itemContact.FirstName
If Len(itemContact.MiddleName) > 0 Then StrMName = itemContact.MiddleName
If Len(itemContact.LastName) > 0 Then StrLName = itemContact.LastName
If Len(itemContact.Suffix) > 0 Then StrSuf = itemContact.Suffix
If Len(StrSuf) > 0 Then StrAux = StrAux + StrSuf + " -"
If Len(StrFName) > 0 Then
If Len(StrAux) > 0 Then StrAux = StrAux + " "
StrAux = StrAux + StrFName
End If
If Len(StrMName) > 0 Then
If Len(StrAux) > 0 Then StrAux = StrAux + " "
StrAux = StrAux + StrMName
End If
If Len(StrLName) > 0 Then
If Len(StrAux) > 0 Then StrAux = StrAux + " "
StrAux = StrAux + StrLName
End If
If Len(itemContact.Email1Address) > 0 Then
itemContact.Email1DisplayName = StrAux + " (" + itemContact.Email1Address + ")"
End If
If Len(itemContact.Email2Address) > 0 Then
itemContact.Email2DisplayName = StrAux + " (" + itemContact.Email2Address + ")"
End If
If Len(itemContact.Email3Address) > 0 Then
itemContact.Email3DisplayName = StrAux + " (" + itemContact.Email3Address + ")"
End If
itemContact.Save
Next
MsgBox "Your contacts have been refiled."
End Sub
*********************

Related

Wininet HttpSendRequest over GPRS

Hi
I wondered if anyone has any tips on using Wininet over GPRS. I'm currenct using eVc 4 to write an application that sends data to a web server using the Wininet HttpSendRequest or HttpSendRequestEx Functions. The problem I get is when I try to send more than about 10k of data I get a server timeout using the GPRS connection but everything seems fine when I have the XDAii in the cradle.
Ok so the problem seems to be GPRS being slow and unreliable but I have experimented with sending the data in 1k chunks and the problem comes when trying to end the http request with HttpEndRequest. I have checked the server timeouts on my IIS server and they are all set to 15 minutes.
Does anyone have any clues?
This is the code I use to do a similar thing with a photo which works quite well
Are you setting the response to nothing?
GPRS is very unreliable but I have managed to send 70k files over it.
==========
Private Function FileUpload(ByVal sURL As String, ByVal sFile As String) As String
On Error GoTo eh
Dim binReader As BinaryReader
Dim byteArray() As Byte
binReader = New BinaryReader(File.OpenRead(sFile))
byteArray = binReader.ReadBytes(binReader.BaseStream.Length)
Dim httpURI As New Uri(sURL & sFile)
Dim httpRequest As HttpWebRequest = httpRequest.Create(httpURI)
httpRequest.Method = "POST"
httpRequest.ContentLength = binReader.BaseStream.Length
Dim httpReqStream As Stream
httpReqStream = httpRequest.GetRequestStream
httpReqStream.Write(byteArray, 0, byteArray.Length)
httpReqStream.Close()
Dim httpResponse As HttpWebResponse
httpResponse = httpRequest.GetResponse
Dim sResponse As String
sResponse = CStr(httpResponse.StatusDescription)
FileUpload = "OK"
httpResponse.Close()
binReader.Close()
httpURI = Nothing
httpRequest = Nothing
httpReqStream = Nothing
binReader = Nothing
httpResponse = Nothing
byteArray = Nothing
Exit Function
eh:
MsgBox(Err.Description)
binReader.Close()
FileUpload = "ERROR"
httpURI = Nothing
httpRequest = Nothing
httpReqStream = Nothing
binReader = Nothing
httpResponse = Nothing
End Function
===================
My code seems to be fine as when I used my mates Vodafone sim in the Xda ii I was able to send a 40k file straight away. It seems there is a limit somewhere around the 8-9k mark in the O2 gprs apn. I have to now get on to 02 and find out how they will let me send more than 8k at a time.
There is a problem with O2. They had to give me a new username and password to log onto their network, which has different privileges, to get around it.
Good Luck

Wing Database Post

Wing for NOOBS like me.
All information in this thread was copied from other peopled, all I have done is put it in one place.. I will update this from time to time
For updates please check the site I have created for the wing.
DISCLAIMER:
I am in no way responsible the content listed below, most of this should work as the people of the community do help each other. Please be careful. And report any errors to me.
Adding Information, If you wish to add information to this post, please post it below, I will add the info, please provide me a link to the data if you have it, and the original writer of said info, I will give the credit to the writing and the provider of said info.
Part 1: useful thread Post.
Part 2: Random tweaks from HOFO.
Part 3: Rom’s Touch it Wing 2.3
3a Touch-IT for The Wing Full and Lite Ed.
Part 4: Random Info
Part 5: T-Mo Wing RUU for USA
Updated on December 17 2007
Part 1: Useful Threads
Cab install for the Wing
The Following is from zcink @ XDA
Original thread @ http://forum.xda-developers.com/showthread.php?t=341867
Great Wing Info Thread
The following is from Nyer78 @ XDA
Original Thread @ http://forum.xda-developers.com/showthread.php?t=326655
General HTC Cabs
The Following is from patr!k @ XDA
Original thread @ http://forum.xda-developers.com/showthread.php?t=344533
Part 2 tweaks.
The Following is from – Tater_Tot24 @ Howard forums
Original thread @ http://www.howardforums.com/showthread.php?t=1215155
Please Note that some of these entries only apply to the WING.
Add Side Button Functionality:
1. Using a registry editor go to HKLM\Software\Microsoft\Shell\Keys
2. In Keys, create a new Key named "40C7".
3. Copy the contents of 40C5 to to 40C7.
4. Edit the "Name" value replacing the "4" with a "5" (5 is Voice command button).
5. Close the registry editor.
6. In Settings\Buttons you should see the new "Button 5(Hold)" entry. If not, soft reset.
Note: I had to make voice command the hold function and screentoggle the non hold function for it to work correctly.
Camera Settings:
1. Open the camera, so you can see images thru the camera lens.
2. Go to bottom of screen & click on the "Y" at far left side.
3. Now move to the 4th icon at the bottom, and set the resolution on "L" and the quality on Super Fine (not Basic).
4. Move to the next icon on the right, and set the Capture Mode on either "Burst" or "Sports"
5. Next, click the icon at far left and set your Capture Speed to either Moderate or Fast, and "Snapshots" to at least 3.
6. Click on the next icon on the right and set it on Storage Card.
7. Finally, click the "Sun" and set the White Balance on Auto.
8. Click OK in the upper right, and you're almost set. Just go now to far left of camera screen and click either of the tiny > arrows until you come to 1/3 (or 1/5 or 1/7 or 1/10, depending on how you set "Snapshots.")
9. Now you're set to take some really great pictures. They will be sharp & clear all the way from about 12 inches to infinity.
10. For sharper pictures, leave the setting at 1x. Anything else is a "Zoom" shot.
Enhanced File System Performance:
Registry: HKLM\System\StorageManager\FATFS
Key: CacheSize (dWord)
Default: 0 (I am not sure what this equates to, the valid values I know about are 4096, 8192, 16384)
New Value: 8192
Hide SIM Contacts:
Registry: HKCU\ControlPanel\Phone
Key: ShowSim (dWord)
Default: 1 (show)
New Value: 0 (hide)
Active Sync Running in the Background Fix:
1. Create a “Fake Server”
Configure Server Menu  Activesync  Programs 2.Go to Start
3. In the following screens you can enter any old garbage. It does not matter, but just in case your unsure, just type the following in the indicated boxes:
4. Server Address: fake / User name: fake / Password: fake / Domain: fake. Then you are finished creating the fake server
5. Finally, UNCHECK the box in the time zones tab in the phone settings (This may sound silly, but it works! I promise!!)
MyFavs Missed Call Fix:
Registry: \HKLM\Security\Phone\NoLog
Key: List
Action: REMOVE
Hard Reset Instructions:
1. Hold down both of the “soft buttons”
2. Perform a soft reset with the stylus while still holding down the buttons
3. Push the green phone button to confirm that you do want to do a hard reset
DeBrand the Phone:
1. Perform a Hard Reset (instructions listed below)
2. Phone cycles through format, installs WM6, then prompts you to config touch screen
3. Install finishes and loads WM6
4. Then a prompt appears warning that EXT ROM will install extra contents (don't install! poke the soft reset button before EXT ROM install)
5. Hit soft reset button when EXT ROM prompt appears, you have 3 seconds!
6. Power on like normal
Send Large MMS:
Registry: HKLM\Software\Arcsoft\ArcSoft MMS UA\Config\UI\Size Limit
Key: wap2sendlimit1 (you can also change wap1sendlimit1)
Default: 307200
New Value: 1228800 (1200K)
Set the new value by going to Text/Multimedia --> Menu --> New --> MMS --> Menu --> Options --> MMS Options --> Servers --> T-mobile MMS
MMS Sending Issue Fix:
1. Due to incorrect Port setting for the MMS server, the phone may not be able to send MMS messages all the time.
2. Go to Text/Multimedia --> Menue --> New --> MMS --> Menu --> Options --> MMS Options --> Servers --> T-mobile MMS
3. Make sure the settings are set to: Gateway: 216.155.165.50 / Port Number: 8080 / Server: http://216.155.174.84/servlets/mms
Remap Soft Buttons:
For Calendar
Registry: HKCU\Software\Microsoft\Today\Keys\112
Key: Default
Default: Calendar
New Value: Internet (anything you want goes here)
Registry: HKCU\Software\Microsoft\Today\Keys\112
Key: Open
Default: HTCCalendar.exe
New Value: \Windows\iexplore.exe (again, anything you want goes here)
For Contacts
Registry: HKCU\Software\Microsoft\Today\Keys\113
Key: Default
Default: Contacts
New Value: (anything you want goes here)
Registry: HKCU\Software\Microsoft\Today\Keys\113
Key: Open
Default: \Windows\RSK\Contacts.lnk
New Value: (again, anything you want goes here)
Remove / Modify Startup Sound:
Registry: HKLM\SOFTWARE\HTC\StartupAnimation
Key: Enable (dWord)
Default: 1 (jingle on)
New Value: 0 (jingle off)
Registry: HKLM\SOFTWARE\HTC\StartupAnimation
Key: Volume (dWord)
Default: 127
New Values: 16 - 200
You can also modify the sound and animation by changing the WAV and GIF files in these two keys.
Registry: HKLM\SOFTWARE\HTC\StartupAnimation
Key: WAVFile (SZ String Value)
Default: \Windows\T-Mobile startup.wav
New Value: (whatever you want)
Registry: HKLM\SOFTWARE\HTC\StartupAnimation
Key: GIFFile (SZ String Value)
Default: \Windows\TMO_Startup.gif
New Value: (whatever you want)
Remove the Tray Icon from Today Screen:
Registry: \HKLM\init\
Key: Launch92
Action: DELETE
Note: If you want to keep some but not all of the icons:
Registry: HKLM\Software\HTC\TrayApplet
There you'll find listings for each icon (the folders are for the WinWap, MyFaves, and CommManager tray icons). Remove the ones you don't want and soft reset. If you remove the music player settings, you will then have to uncheck the plug-in from Today items.
Adding Slide Sounds:
1. First you are going to need two .wav files.
2. Once you have the two sounds that you want to use, Rename them to Slider3_in.wav and Slider3_out.wav and place them in the \Windows Folder on your phone.
3. Go to the Registry: HKLM\Software\HTC\SlidingSound\.
4. Once your there you should see 3 Folders (keys) that are labeled 0-2, and 2 Dword Files (ActiveSlidingSound and SlidingSoundEffect).
5. In that same directory, you need to make a new folder (key) and label it "3". Once that is made, you need to go inside that "3" which should be empty and have nothing inside.
6. Now you need to make a new String.Label the String "in" without quotes, and then set the string to "Slider3_in.wav". Now you should have one string inside folder (key) 3.
7. Now you need to make another String inside of folder (key) 3. Just follow step 5, but instead of using "in" use "out". So it should be labeled "out" and should be set to "Slider3_out.wav".
8. Next, create another String inside of folder and call it “Default” (no quotes). Now set that sting to whatever you want the new schema to be called (i.e. wind chimes, customer, etc).
9. Now head back to the registry: HKLM\Software\HTC\SlidingSound\, where you should now see folders (keys) 0-3 now and two Dwords files.
10. Now change Dword ActiveSlidingSound to 3, which is the new sound you created.
Disable the SMS Sent notification
Regisrty: HKLM\Software\Microsoft\Inbox\Settings\
Key: SMSNoSentMs (decimal)
Default: 0 (on)
New Value: 1 (off)
Note: Please note that the 'Settings' key may not exist in your device, and thus may have to be created first.
Storage Card Settings:
Mail Attachments
1. Go to Text/Multimedia --> Menu --> Tools --> Options --> Storage
2. Then check the box!
IE Storage
Registry: HKCU\Software\Microsoft\Windows\CurrentVersion\Exp lorer\Shell Folders
Key: Cache (string)
Default: Program Memory
My Value: \Storage Card\Internet Files\Temporary Internet Files
Key: Cookies (string)
Default: Program Memory
My Value: \Storage Card\Internet Files\Cookies
Key: History (string)
Default: Program Memory
My Value: \Storage Card\Internet Files\History
Note: Please see the “camera settings” to store pictures and video to the storage card.
Video from Portrait to Landscape:
Registry: HKLM\System\GDI\
Add key "Rotation"
Add Dword "LandscapeMode"=0
Move / Remove Startup Files:
1. make directory "\Windows\StartUpDisabled"
2. If you don't use MyFav5 Plan then copy "\Windows\StartUp\My5MsgCenter.lnk" to "\Windows\StartUpDisabled\My5MsgCenter.lnk"
3. If you don't use Voice Commands often (you can still manually start app) then copy "\Windows\StartUp\Voice Command.lnk" to "\Windows\StartUpDisabled\Voice Command.lnk"
Remove Services:
4. Go to "HKEY_LOCAL_MACHINE\Services"
5. If you don't use MyFav5 Plan (SMSCSend links to my5client.dll, I don't have My Fav plan, so I don't need this service)
a) save SMSCSend reg export somewhere for backup
b) delete "HKEY_LOCAL_MACHINE\Services\SMSCSend" from registry
6. Go to "HKEY_LOCAL_MACHINE\Services"
7. If you don't use Windows Live
a) save Windows Live reg export somewhere for backup
. b) delete "HKEY_LOCAL_MACHINE\Services\Windows Live" from registry
Other Services:
Other Services
"HKEY_LOCAL_MACHINE\Services\BTHIDSVC"
loads the Bluetooth Human Interface Device drivers and service
"HKEY_LOCAL_MACHINE\Services\BTAGSVC"
loads the Bluetooth Audio Gateway drivers and service
"HKEY_LOCAL_MACHINE\Services\BthAsPlugin"
loads Active Sync over BlueTooth service
"HKEY_LOCAL_MACHINE\Services\Trusted"
loads WSP Push, Push Router, SIM tool kit, SIM Init
"HKEY_LOCAL_MACHINE\Services\OBEX"
object exchange - protocol for data exchange between devices or syncing
"HKEY_LOCAL_MACHINE\Services\NOTIFY"
pop up notifications for events
"HKEY_LOCAL_MACHINE\Services\credsvc"
Credentials Manager
"HKEY_LOCAL_MACHINE\Services\CERTENROLL"
performs enrollment and renewal of certificates
"HKEY_LOCAL_MACHINE\Services\WirelessService"
Wireless Monitor Service
Increase voiceVolume:
Regisrty: HKCU\Control Panel\SoundCategories\InCall
Key: AttenuationCategory
Default: 2
New Value: 1
Regisrty: HKCU\Control Panel\SoundCategories\InCall
Key: InitVol
Default: 3
New Value: 10
Increase Voice Command Volume:
Registry: HKCU\Control Panel\SoundCategories\VoiceCommand1
Key: AttenuationCategory
Default: 3
New Value: 1
Registry: HKCU\Control Panel\SoundCategories\VoiceCommand1
Key: InitVol
Default: 5
New Value: 20
Better sound over A2DP
Registry: HKLM\Software\Microsoft\Bluetooth \A2DP\Settings
Key: MaxSupportedBitPool
Default: 30
New Value: 58
Registry: HKLM\Software\Microsoft\Bluetooth \A2DP\Settings
Key: BitPool
Default: 30
New Value: 58
Note: If not good enough, then delete: "MaxSupportedBitPool"=XXX &
"BitPool"=XXX.
Unlocks & Unhide the Extended Rom in Explorer:
Registry: HKLM\System\StorageManager\AutoLoad\TRUEFFS_DOC1
Key: bootphase
Default: 1
New Value: 2
Registry: HKLM\System\StorageManager\Profiles\TRUEFFS_DOC1
Key: mounthidden
Default: 1
New Value: 0
Registry: HKLM\System\StorageManager\Profiles\TRUEFFS_DOC1
Key: folder
Default: ?
New Value: Extended_ROM
GMail Settings:
You can access your Gmail messages from the Wing in three ways:
Set up Gmail as a POP3 account
Automatically forward Gmail
Access Gmail from the Internet
Set up Gmail as a POP3 Account
1. Log in to your Gmail account from your PC.
2. Select Settings at the top of any Gmail page.
3. Select the Forwarding and POP tab in the orange Mail Settings box.
4. Under POP Download, choose to Enable POP for all mail or Enable POP only for mail that arrives from now on.
5. Specify whether you want Gmail to keep a copy of messages in the Inbox when you access messages through POP.
6. Select Save Changes.
I. Auto-configure Gmail from your Pocket PC phone
1. Press Start --> Messaging.
2. Select New Email Account.
3. Enter your e-mail address and make sure the box is checked for getting the settings automatically
4. In the Auto configuration screen, wait until the Status changes from Connecting to Completed and then select Next.
5. Enter your name, user name, and password (DO NOT REMOVE the recent: from in front of the username that it automatically provides) and select Next.
6. Ensure Account type is set to POP3 and select Next.
7. Make sure that Incoming Mail is set to pop.gmail.com:995
8. Make sure that Outgoing Mail is set to smtp.gmail.com:465 and select Finish.
9. Select Yes to confirm that you would like to download mail for this new account now.
II. Automatically Forward Gmail to Another Account
1. Log in to your Gmail account from your PC.
2. Select Settings at the top of any Gmail page
3. Select Forwarding and POP in the orange Mail Settings box.
4. Select Forward a copy of incoming mail and enter the e-mail address to which you'd like your e-mail forwarded.
Now your Gmail will automatically be forwarded to this account.
III. Access Gmail from the Internet
If you don't subscribe to an unlimited data plan or need only occasional access to your Gmail account you may prefer to access your Gmail from your Pocket PC phone using Internet Explorer. To access your account through Internet Explorer, go to http://m.gmail.com.
Part 3 Touch it 2.3 for th wing
The Following is from itje
Original thread http://forum.xda-developers.com/showthread.php?t=340403
Touch it: a rebuilt rom for the wing
Part 3a Touch it Full and Lite
The Following is from itje
Original http://forum.xda-developers.com/showthread.php?t=332789&highlight=wing
Part 4 : Random Stuff
Wing as a Webcam
Found at XDA
http://forum.xda-developers.com/showthread.php?t=348187&highlight=WING+AS+A+WEBCAM
Part 5: T-Mo Wing RUU for USA!!
From xavier6303
Found http://forum.xda-developers.com/showthread.php?t=321717
This will reset your phone, basically reinstall windows and all the phone, heard it works as a decent unbricker,
How to enter boot mode
Restart the phone and hold the voice and camera button

Send a file from server to client via stream

hi,
I currently have a client server app which passes back and forth String data and it works great. but now i have the need to send non text files ie images from server to client (PPC). It is all based on system.net.sockets.
The client is making a request via the following
Dim sendBytes As [Byte]() = Encoding.ASCII.GetBytes(lData)
lnetworkStream.Write(sendBytes, 0, sendBytes.Length)
Dim bytes(ltcpClient.ReceiveBufferSize) As Byte
lnetworkStream.Read(bytes, 0, CInt(ltcpClient.ReceiveBufferSize))
Dim returndata As String = Encoding.ASCII.GetString(bytes, 0, bytes.Length)
The server code is responding via the following .
Private Sub sendmessage(ByVal s As Socket, ByVal message As String)
Buffer = New [Byte](message.Length + 1) {}
Dim length As Integer = ASCII.GetBytes(message, 0, message.Length, Buffer, 0)
s.Send(Buffer, length, 0)
End Sub 'sendmessag
Can any one one help, i can't seem to find any help on sending and receiving files via sockets.
thanks in advance

.Net C.F. 2.0: Sent SMS don't get stored in the PocketOutlook "SMS\Sent Items" contai

.Net C.F. 2.0: Sent SMS don't get stored in the PocketOutlook "SMS\Sent Items" contai
Hi,
let me begin by apologising if it's not appropiate to post programming questions in this forum.
I developped a small app using VisualStudio 2005, CF 2.0 C# that targets the Windows Mobile 6.0 Professional operating system.
It tries to send sms in 2 different ways:
Direct:
string NumTelefono = textBox1.Text;
string Messaggio = textBox2.Text;
if (Messaggio.Length > 255)
Messaggio = Messaggio.Substring(0, 255);
SmsMessage sendMsg = new SmsMessage();
Recipient recpt = new Recipient(NumTelefono);
sendMsg.Body = Messaggio;
sendMsg.To.Add(recpt);
sendMsg.RequestDeliveryReport = true;
sendMsg.Send();
Using Pocket Outlook:
string NumTelefono = textBox1.Text;
string Messaggio = textBox2.Text;
if (Messaggio.Length > 255)
Messaggio = Messaggio.Substring(0, 255);
using (OutlookSession session = new OutlookSession())
{
SmsAccount smsAccount = session.SmsAccount;
SmsMessage smsMessage2 = new SmsMessage(NumTelefono, Messaggio);
smsAccount.Send(smsMessage2);
}
I tried both with the emulator and a real device, the sms gets sent but it's not stored in the "SMS\Sent Items".
Is there a way to implement such functionality ?
Ciao
Marco
...I forgot!
Obvioussly once the PC SMS OUTLOOK app will be finished it will be released as freeware and given for free to all the forumers
yes yes, i also want to know...
any help?

(Solution) Enabling Exchange 2003 to receive HTML

PURPOSE
So the purpose of this thread is to explain how I got HTML working for Exchange 2003 servers which technically is not supposed to be possible This is me giving back to the community and I give full writes to use this code in whatever means necessary. I had to figure this out on my own with absolutely no help online so now I'm putting this here so no one else has to go through the hell that I did!
This means Hotmail via Activesync will also have full HTML support with this code patch I'm submitting.
First, AOSP Email is set up to request plain text emails from an Exchange 2003 server which is no good for us. First step is we need to request MIME messages which will contain the text/plain & text/html versions of an e-mail. So if a message was originally text/html then the MIME message will contain text/plain & text/html. If the original message was text/plain then the MIME message will only contain text/plain. No biggie there that's obviously ok.
EasSyncService.java
Code:
// Set the truncation amount for all classes
if (mProtocolVersionDouble >= Eas.SUPPORTED_PROTOCOL_EX2007_DOUBLE) {
s.start(Tags.BASE_BODY_PREFERENCE)
// HTML for email; plain text for everything else
.data(Tags.BASE_TYPE, (className.equals("Email") ?
Eas.BODY_PREFERENCE_HTML : Eas.BODY_PREFERENCE_TEXT))
.data(Tags.BASE_TRUNCATION_SIZE,
Eas.EAS12_TRUNCATION_SIZE)
.end();
} else {
if (className.equals("Email")) {
s.data(Tags.SYNC_MIME_SUPPORT, "2")
.data(Tags.SYNC_MIME_TRUNCATION, "7");
}
s.data(Tags.SYNC_TRUNCATION, Eas.EAS2_5_TRUNCATION_SIZE);
}
Explanation
The section in the if() block is for exchange 2007/2010 and basically is telling the Exchange server to send HTML for Email and plain text for anything else (ie: calendar events).
This says send me MIME messages for Exchange 2003
Code:
s.data(Tags.SYNC_MIME_SUPPORT, "2")
This says truncate the MIME message to 102,400 characters and is very important. If you don't set this then you WILL run into out of memory issues because some messages can be very large and since a MIME message contains duplicate copies of a message in two formats you're doubling the memory requirements.
Code:
.data(Tags.SYNC_MIME_TRUNCATION, "7");
Now let's get on to the part that will actually parse the MIME encoded message.
EmailSyncAdapter.java
Code:
public void addData (Message msg) throws IOException {
ArrayList<Attachment> atts = new ArrayList<Attachment>();
mimeAtts = new ArrayList<String>();
textBody = new StringBuffer();
htmlBody = new StringBuffer();
The new additions are mimeAtts, textBody, and htmlBody. We'll use these later in the code.
Code:
case Tags.EMAIL_MIME_DATA:
try {
MimeMessage mimeMsg = new MimeMessage(new ByteArrayInputStream(getValue().getBytes()));
if (mimeMsg.getBody() instanceof Multipart) {
MimeMultipart multipart = (MimeMultipart) mimeMsg.getBody();
parseMimeBody(multipart);
if (htmlBody != null && htmlBody.length() != 0)
msg.mHtml = htmlBody.toString();
else if (textBody != null)
msg.mText = textBody.toString();
else
msg.mText = "";
}
else {
InputStream in = mimeMsg.getBody().getInputStream();
ByteArrayOutputStream out = new ByteArrayOutputStream();
IOUtils.copy(in, out);
in.close();
in = null;
String charset = MimeUtility.getHeaderParameter(mimeMsg.getContentType(), "charset");
if (charset == null)
charset = "UTF-8";
String mimeTxt = out.toString(charset);
charset = null;
out = null;
if (mimeMsg.isMimeType("text/html"))
msg.mHtml = mimeTxt;
else
msg.mText = mimeTxt;
}
} catch (MessagingException e) {}
break;
This is a new case block that I added specifically for parsing MIME encoded messages. In a nutshell I'm creating the MimeMessage object, checking if it is a multi-part message or single-part message and parsing accordingly.
Code:
if (atts.size() > 0 && mimeAtts != null) {
for(Attachment att : atts) {
for (String contentId : mimeAtts) {
if (contentId == null)
continue;
if (att.mFileName != null && contentId.contains(att.mFileName))
att.mContentId = contentId;
}
}
msg.mAttachments = atts;
}
This is really important and is still in the same method as the above two code sections. The issue is when an attachment is downloaded the content-id isn't specified. So now that we have the MIME message we can actually grab that content-id out of there and update each attachment with the correct content-id. Later in MessageView.java it will use that value to display the embedded images correctly.
Code:
private void parseMimeBody(MimeMultipart multipart) {
try {
for (int i=0; i<multipart.getCount(); ++i) {
BodyPart part = multipart.getBodyPart(i);
if (part.isMimeType("text/plain"))
textBody.append(MimeUtility.getTextFromPart(part));
else if (part.isMimeType("text/html"))
htmlBody.append(MimeUtility.getTextFromPart(part));
else if (part.isMimeType("multipart/alternative"))
parseMimeBody((MimeMultipart)part.getBody());
else
mimeAtts.add(part.getContentId());
}
}
catch (MessagingException e) {}
}
This is a new method I added which handles parsing out the message bodies from a multi-part MIME message. It uses recursion if there are embedded multi-part messages in the original multi-part message.
The last part which I won't paste here is incorporating the support for viewing MIME messages into MessageView.java. I've taken the 3 files that were modified and I'm attaching them to this e-mail. These are straight from my paid email app so there are other additions in there that someone can diff out. If I get time I'll patch these changes into AOSP email but I'm swamped 24/7 with Enhanced Email so I'd suggest someone else do it and contact me with questions.
This is the same hack that iPhone uses to enable HTML for ex2003 and once again is undocumented ANYWHERE on the net except for here by me
So... with this zip file (I don't know much about unpacking it in android- I am a winmo 6.5 user). I will be able to use hotmail via exchange server and view attachments ...etc just like an regular email client would behave?
I want to migrate to Android so bad, but I don't want to give up my hotmail account. As of now this is how I am setup on winmo 6.5:
1. PH#s (contacts with PH#s) + Calendar - Gmail synced via microsoft exchange
2. Email (Hotmail) + Email contacts - synced via windows live email client
Any advise will be greatly appreciated. Also... I would like to combine somehow all my contacts in one directory that will be synced somehow between gmail (for google voice texts and calls) and hotmail (since I use this all over my PC's and add contacts from different locations. Thank you!!!

Categories

Resources