MessageInterceptor NotifyAndDelete - message still comes through after delay - Windows Mobile Development and Hacking General

static void Main()
{
if (!MessageInterceptor.IsApplicationLauncherEnabled("aPush"))
{
MessageInterceptor rule = new MessageInterceptor(InterceptionAction.NotifyAndDelete,false);
MessageCondition condition = new MessageCondition(MessageProperty.Body,
MessagePropertyComparisonType.Contains,
"NEW EMAIL jjj123", true);
rule.MessageCondition = condition;
rule.EnableApplicationLauncher("aPush", @"\Program Files\push\push.exe", "EventFired");
}
OutlookSession session = new OutlookSession();
Microsoft.WindowsMobile.PocketOutlook.MessagingApplication.Synchronize(session.EmailAccounts["asu.edu"]);
Application.Exit();
}
The application is successfully launched, syncs my email, and exits, but the SMS message still comes through after a short delay - what am I doing wrong?
I hae also noticed that all other pending sms messages are delayed until this one comes through too which can be up to a minute... What gives?

Related

Problem: Compose SMS using MessagingApplication.DisplayComposeForm

Hello all,
I'm trying for some time to solve this problem. I want to open sms compose window in Pocket Outlook by clicking a
button but still get System.ComponentModel.Win32Exception. My code:
using Microsoft.WindowsMobile.PocketOutlook;
using Microsoft.WindowsMobile.Forms;
...
private void button2_Click(object sender, EventArgs e)
{
SmsMessage zprava = new SmsMessage();
MessagingApplication.DisplayComposeForm(zprava);
}
Can somebody help me with this please? Or at least advice me some good developers forum where I can get help with this?

Need help for Message Interception (WM6 / VB.Net)

I want to use the MessageInterception Handler, but when I add the following code:
Imports Microsoft.WindowsMobile.PocketOutlook
Imports Microsoft.WindowsMobile.PocketOutlook.MessageInterception
Public Class Form1
'---used for intercepting SMS messages---
Private msgInterceptor As MessageInterceptor
Click to expand...
Click to collapse
Visual Basic reports an error:
Error 1 Reference required to assembly 'Microsoft.WindowsMobile, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' containing the implemented interface 'Microsoft.WindowsMobile.IApplicationLauncher'. Add one to your project. C:\IPSMS\Form1.vb 63 31 IPSMS
Click to expand...
Click to collapse
Can someone help me with this?
Solved: I have forget to add Windows.Mobile as a reference.
It´s not working:
'---used for intercepting SMS messages---
Private msgInterceptor As MessageInterceptor
Private Sub SMSInterceptor_MessageReceived(ByVal sender As Object, ByVal e As MessageInterceptorEventArgs)
MsgBox("message received")
End Sub
Click to expand...
Click to collapse
If I send a SMS to the mobile the Sub isn´t executed.
edit: I have added
msgInterceptor = New MessageInterceptor(InterceptionAction.NotifyAndDelete, True)
AddHandler msgInterceptor.MessageReceived, AddressOf SMSInterceptor_MessageReceived
Click to expand...
Click to collapse
to the OnLoad Section. It´s working now.

Sprint MMS Block Workaround [Idea for Developers]

If you haven't already heard Sprint has denied access to the MMS service with PPC devices. We used to get around this by installing Arcsoft MMS but even that won't work anymore.
Since the only way to send MMS or PictureMail is through E-Mail I was wondering if it's possible to develop an application to make this an easier process. The application will ask for phone number or contact name, the carrier, the media to be sent, the subject, and the message. With all that information it'll compose an e-mail to [phonenumber]@[carrier'saddress].com
-- Edit --
no2chem is working on a workaround. see his post on ppcgeeks from more info.
http://forum.ppcgeeks.com/showthread.php?t=19122
A simple workaround...is to send the pic to urself...([email protected]) and once u receive it jus forward the url to people u wanna send it to. thaz wut they get anyway. that way you dont have to worry about different carrier mms addresses.
Others have a working MMS application installed through their carriers or none PPC Sprint phones. The beauty of MMS is the fact that it's so simple to send and retrieve the media. If it wasn't for that then we can just e-mail each other photos and skip the whole process.
this sounds like a great idea, until sprint lets us use it again, which i don't see happening
malibu_23 said:
A simple workaround...is to send the pic to urself...([email protected]) and once u receive it jus forward the url to people u wanna send it to. thaz wut they get anyway. that way you dont have to worry about different carrier mms addresses.
Click to expand...
Click to collapse
When you say send the pic to your self at [email protected] I am assuming you mean to your 10 digit phone #@sprint.pm.com
I sent a pic to myself via hotmail and I get the message returned to me...how did you do this?
you have the address wrong.
it's [email protected][B]pm.sprint.com[/B]
initial said:
you have the address wrong.
it's [email protected][B]pm.sprint.com[/B]
Click to expand...
Click to collapse
meh, im thinking about working on this. but believe me, i have a looooot of other things on my hands.
wouldn't be that hard though, a simple app where it just asks you the photo/audio/video you want to send and the destination number... and whisks it away....
no2chem said:
meh, im thinking about working on this. but believe me, i have a looooot of other things on my hands.
wouldn't be that hard though, a simple app where it just asks you the photo/audio/video you want to send and the destination number... and whisks it away....
Click to expand...
Click to collapse
Actually thats funny, because I have been working on this lol. Building the DB right now still. Do you happen to know of any third party MMS applications? Open source or the API's?
what language are you writing it in.. I would be more then Happy to help with the dev work.
I better start preparing to bow down to you guys if you crack this
fr0st said:
what language are you writing it in.. I would be more then Happy to help with the dev work.
Click to expand...
Click to collapse
Visual Basic
i developed a beta workaround,
see
http://forum.ppcgeeks.com/showthread.php?p=192013#post192013
COUNT ME IN.. I would rather c# but I would love to help. My roommate and I both are programmers and would love to assist? You looking for some help blue?
do you have any problems with sharing your code (which I am sure in in c++) no2chem
fr0st said:
do you have any problems with sharing your code (which I am sure in in c++) no2chem
Click to expand...
Click to collapse
Frost be more then happy. As I told u in pm my last post is still pending it will shed some nfo on this. NU said he wrote in C++ not sure if he is willing to help. As far as I go I haven't wrote C in 7yrs never took on ++ though there not far off.
NUC - I will go check out what you have.
Someone posted this
Someone over on the PPCGeeks forum posted this site:
http://pktpix.com/
Seems like it might be a workaround as well as no2chem's... Just like teleflip and other SMS Gateways, but this one is international (and free)...
fr0st said:
do you have any problems with sharing your code (which I am sure in in c++) no2chem
Click to expand...
Click to collapse
no problems really, but the code is very simple and is in c#...
c++ would have been too much time...
this code does nearly all the work...
OutlookSession os = new OutlookSession();
EmailAccount ea = os.EmailAccounts[0];
EmailMessage em = new EmailMessage();
em.BodyText = textBox1.Text;
em.To.Add(new Recipient(textBox2.Text + "@" + ((carrier)comboBox1.Items[comboBox1.SelectedIndex]).address));
em.Importance = Importance.Normal;
em.Sensitivity = Sensitivity.Normal;
if (imagename != null)
{
em.Attachments.Add(new Attachment(imagename));
}
ea.Send(em);
mapi.setAccountName(ea.Name);
if (mapi.forceSyncbyName())
{
MessageBox.Show("Message Sent");
}
else
{
MessageBox.Show("Forcing sync failed, message is in your outbox.");
}
Visual Basic, I could use help new to developing on a PPC platform.
This is the function. The idea is to build a small DB because most people only have a small group of people they MMS. Easily containable in a personal config. A DB of all the carriers MMS addresses on file where users also configure a parameter of numaric class carriers with exceptions for ported numbers. Look a little like this to give you a basic idea. Like local zone 850-532-XXXX = ATT and 850-543-XXX = Sprint.
User adds contact in send list. App verify value as.
Load contact in string as send_to but we will only load first 7 chars
Open DB config file
Load DB config file
If send_to is = to a char value in config we auto address sending address as textBox.Text = string_to + carrier match
Else
Prompt string carrier_db user selects a carrier from list load to string usr_carrier
Then textBox.Text = send_to + user_carrier
Write send_to+usr_carrier to DB config
call Send_btn
EndIf
Obviously more then 1 IF statement is needed lol just a concept idea so you know what I am doing. As well an exempt file is needed for ported numbers to reference before the DB carrier file is called. Then if number is not listed we can call an ElseIf statement to carry onto the above. The grab contacts reference is also still needed.
no2chem said:
no problems really, but the code is very simple and is in c#...
c++ would have been too much time...
this code does nearly all the work...
OutlookSession os = new OutlookSession();
EmailAccount ea = os.EmailAccounts[0];
EmailMessage em = new EmailMessage();
em.BodyText = textBox1.Text;
em.To.Add(new Recipient(textBox2.Text + "@" + ((carrier)comboBox1.Items[comboBox1.SelectedIndex]).address));
em.Importance = Importance.Normal;
em.Sensitivity = Sensitivity.Normal;
if (imagename != null)
{
em.Attachments.Add(new Attachment(imagename));
}
ea.Send(em);
mapi.setAccountName(ea.Name);
if (mapi.forceSyncbyName())
{
MessageBox.Show("Message Sent");
}
else
{
MessageBox.Show("Forcing sync failed, message is in your outbox.");
}
Click to expand...
Click to collapse
"EmailAccount ea = os.EmailAccounts[0];" So you change the 0 to whatever number the email account on your phone is right? 0 being outlook... and i'm guessing an autonumber from then on?
Also what namespaces and assembly references are you using?
fr0st said:
"EmailAccount ea = os.EmailAccounts[0];" So you change the 0 to whatever number the email account on your phone is right? 0 being outlook... and i'm guessing an autonumber from then on?
Also what namespaces and assembly references are you using?
Click to expand...
Click to collapse
well, that was code for the quick beta.
Microsoft.Windowsmobile namespace, look into it =) its quite nice.
EmailAccounts[0] would pick the first e-mail account, it only can use e-mail accounts in outlook. i used[0] as a quick hack and slash test, but now i let them choose which e-mail they want to use, , you would just enumerate thorugh all the email accounts,
foreach (EmailAccount ea in os.EmailAccounts)
{
....
}

Problem with C#: Reading content of SMS

Hi,
a friend of mine is developing a little tool to read out content of SMS. For example when he gets a SMS notification about a missed call (when the phone was turned off) he reads out the number and displays a default windows-notification (like task-reminder).
The problem he´s got is with "MessageInterceptorEventHandler". He managed to catch the message, but he cannot read the messages content.
Has anybody experience with C# / CompactFramework or this scenario ?
regards,
Martin
IIRC, one of the arguments passed into the MessageInterceptorEventHandler is a Message object, which can be casted to an SmsMessage object, which has a String Body property that has the text of the message.
zaijian said:
IIRC, one of the arguments passed into the MessageInterceptorEventHandler is a Message object, which can be casted to an SmsMessage object, which has a String Body property that has the text of the message.
Click to expand...
Click to collapse
thanks, it worked ! Maybe we release this app here, if anybody wants the same for his mobile operator.
regards,
Martin

Saving a message as Draft (far from easy!)

I'm trying to save a message ad draft. I know, its an undocumented API, but it would be nice to see the messaging in any application.
Here is the code
Code:
Uri drafts= Uri.parse("content://sms/draft");
values = new ContentValues();
values.put("body", "Draft Body");
values.put("type",3);
values.put("address","+1234567890");
long date = System.currentTimeMillis()-60000; //just to test
values.put("date", date - date % 1000);
values.put("read", 1);
//values.put("status", -1);
//values.put("seen", 0);
//values.put("modified", 1);
contentResolver.insert(drafts, values);
I'm testing on android 2.2 froyo and the message get saved but in the standard messaging application no label "Draft" is shown. as you try to reply you get a message with the same address but empty body. Now, when pressing the return button and you get back to the conversation list the message disappear.
-- in my LG Optimous One the type get changed to MMS, date is set to 1/jan/1970 and CANNOT BE DELETED!
-- in the emulator the message simply gets deleted.
I tried other apps for testing and none was successful in saving a draft on my phone: (ChompSMS, [SMSdroid], Handcent SMS, GO SMS). The draft they save is seen in the standard application but the same problem applies when opening the standar application.
-- In Android 2.1 using the emulator everything works like a charm!
I'm really unpleased to see that basic messaging functionalities are so problematic and NOT OFFICIALY SUPPORTED in Android.
Anyone experienced similar problems? Did you managed to solve this issue?
Best Regards,
Marco

Categories

Resources