[Q][VB] Sending an SMS as a background task - Windows Mobile Software Development

Hello chaps,
Part of the app I'm writing sends SMS messages to those in a contact list that the user chooses. I could select as many in a list as possible, and I've got the list in a ListView component on a form.
In another form, I've got the function to send the SMS, and it all works well - sending SMS's is quite easy!
But the trouble is that it takes a while, and stops my application from operating while its working. It may take something like 5-10 seconds to send two text messages.
I'm not so worried about the time it takes, but I would like to send the SMS as a background task - perhaps start a thread going with the function to send the SMS. This *almost* works, but I've now got the problem that I'm trying to access this ListView component from a thread inside another form - it doesn't work. I since realise that threads treat global variables as local.
Has anyone come across this problem? Has anyone found a way of sending SMS's as a background task?
This is all using VB.net.
Many thanks in advance,
Paul.

Thanks to all that replied...
I've managed to work it out, and it now sends as a background task. The solution was to have the functionality of the SMS sending as a new class, with all the data it requires within the class as public variables. Then, when you create a new class of that SMS sending functionality, you then populate all the stuff it needs to run, like the text message itself and so on, and set the thread going as before.
If anyone wants any more information, I would recommend this site which was most helpful:
http://www.devx.com/DevX/10MinuteSolution/20365/1954
MrPloppy.

Related

How to postpone SMS sending

Is there any solution for postponing SMS sending when the GSM signal is not strong enough?
In other words - on the symbian platform the SMS is taken into the queue like Outbox and the system or app then performs a signal check on regular basis and send out the SMS once the signal is at adequate level. So you no longer have to worry about the SMS once you hit the SEND button. Is there something like that available on WM platform too?
id love to see a solution for this one too!
also if there's any programable sms sender so that you can send the date and time for an sms to be sent.. i think this one also falls under the category of sms postponing
Come on guys, no one knows a solution? What about sophisticated 3rd party applications supporting SMS scheduling like AdvancedSMS or InfoSharp are, (actually had no chance to try them out), anyone expirienced who can advice?
Hope this helps guys!
@xan:
how will this help?
http://www.freewareppc.com/communication/rahsmsii.shtml

Select from a list of recent SMS recipients when sending a text?

Hi
I have a Touch Diamond. I was wondering if anyone can help me. Does anyone know of an inbox extender (or feel like writing one) that will enable me to:
Open a new(blank) SMS message, write it, and when I press "send" (or even "to") it will show me a list of , say, the last 10 people I sent SMS messages to? I have another app which I bought to allow me to group message (PowerSMS) which has a feature which calls up (lightning fast) your SMS history on the stats page, so I assume it is at least possbile to call up SMS history quickly without having a performance impact.
My old Nokia used to have this, and it's dead handy. Otherwise I find myself having to scroll through the 20+ Pauls or Andy's in my contacts list to find the particular Paul or Andy that I always text.
Any suggestions much appreciated.
Thanks
Stoatie
hmmm ... have I posted this in the wrong forum section??

Messaging (SMS and email) on TP2

Hi to All,
I have few questions to you regarding messaging – sending SMS and emails. I miss form my previous phones confirmation that SMS was delivered to the recipient. In Nokia it works like that the info is being displayed 5 seconds and then disappears. Quite similar it works in Sony Ericsson. In TP 2 I’ve manage to have so called report that the message was delivered which has form of SMS, which must be deleted like a regular SMS. Is there any other option to know that the message was successfully sent or was delivered?
Next issue I have encountered is lack of progress bar while I’m sending emails. If the email has attachment the sending process might take a while. In all phones I used to have there was some kind of progress bar while I can’t find anything like that in TP2 email application. This is annoying because I don’t know if there is progress of sending. Anyone has solved that problem?
And the last thing which I have noticed when using email application is attaching files. If the file is located in subfolder of the main folder it’s impossible to get access to it. Then it’s necessary to start operation with File Explorer (with which I have access to all folders) and use of Send as email function and then edit the email content. Not very logical.
All you thoughts and ideas are very welcome!
Have a nice day!
Max
PS. I’ve started to thinking about switching to Nokia N900 which seems to be more logical and intuitive in terms of software.

[Q] Raise "Message" Recipients Limit

Hi I've searched around in different Android sense areas and can't seem to find an answer so I'm asking it, please if I missed it point me in the right direction.
I have a new Droid Incredible, just switched over from a Touch Pro 2, and I love it except for the fact that SMS Recipients is capped at 10. On the WinMo phone you could go in a tweak the registry to allow however many you wanted. On Android is there a way to do this? I plan on rooting it so that won't be a problem if I need too. I've read to use Handcent (has been giving me annoying pop-ups) or ChompSMS but I'd prefer just be able to use Messages.
I dont have a sense rom anymore, but if I remember correctly, it's as simple as going into messages..pressing menu..pull up settings, and then think with storage settings. You should be able to adjust the limit per thread and conversation numbers. Let me know if I am delusional..but I'm pretty sure that's it.
I've found that and theres a place where I can limit the amount of sms and mms's however nothing about recipients anywhere Any other ideas?
Anyone else have ideas? I'm using Handcent but after I send one message it acts like my group is empty and I have to restart the phone. Chomp was sending double messages, are there any other programs or methods out there? The group has 58 members

SMS Notifications

What are folk using to read or reply to SMS messages on their units?
I did some searching on the old thread and TabletTalk looks exactly what I'm looking for but it unexpectedly crashes whenever I open it on my HU and I'm not sure if there are any logs I can check to see why? Anyone else having that issue?
I also seen that another option is Tasker with a few plugins but does that use 3G to sync the messages? Ideally I want something that does it all over Bluetooth. I'm not really fussed about WhatsApp messages or that, just SMS.
Cheers
I was using mightytext (needed to get apk from my tablet as hu is not supported in google play) and it used mobile data. Added bonus of being able to reply...however can't do so when driving, which negates it a bit
I'm in the middle of setting up tasker/autoremote/autovoice. The plan is for message to be received, sent to hu, seneder read out, yes/no option to read message, yes reads message, no ignores message (possibly third input for reminder in x minutes). Gives a bit more privacy when others are in the car
Autoremote works over any data connection; mobile, wifi, Bluetooth. It's easy enough to transfer messages (sender, body) using autoremote and getting it to appear as a notification on hu (instead of my more complex goal)
Also pushbullet works fine (but might be mobile data only)
Brendo said:
I was using mightytext (needed to get apk from my tablet as hu is not supported in google play) and it used mobile data. Added bonus of being able to reply...however can't do so when driving, which negates it a bit
I'm in the middle of setting up tasker/autoremote/autovoice. The plan is for message to be received, sent to hu, seneder read out, yes/no option to read message, yes reads message, no ignores message (possibly third input for reminder in x minutes). Gives a bit more privacy when others are in the car
Autoremote works over any data connection; mobile, wifi, Bluetooth. It's easy enough to transfer messages (sender, body) using autoremote and getting it to appear as a notification on hu (instead of my more complex goal)
Also pushbullet works fine (but might be mobile data only)
Click to expand...
Click to collapse
Thanks mate
I seen mightytext as well actually, didn't like the fact that it was over data as well though and assuming your texts will be stored on a server.
Ahh I didn't realise Autoremote worked over Bluetooh, the tasker/autoremote/autovoice sounds like a great option thanks :good:
dc5daft said:
Ahh I didn't realise Autoremote worked over Bluetooh, the tasker/autoremote/autovoice sounds like a great option thanks :good:
Click to expand...
Click to collapse
I think there is a fallback order to determine which protocol to use (haven't had time to use in a while). I like that it'll use Bluetooth when no data as when I have my wifi obd device connected, it takes over wifi and turns data off
I've been using mysms on my PC and phone for the last few years, an alternative to mightytext. Mysms has annoyed me though so I think I'll be checking out mightytext even though I have a paid sub to mysms. It sometimes leaves a message that the phone might have not had the reception to send in a limbo zone, where you can't resend it for 15-30 minutes until it officially fails. Plus it's freaked me out with display problems sometimes, showing me I sent messages to people not that I intended.
Thanks for all the replies
I had a quick look at tasker and automate but had some trouble getting the URL on the start page and it does seem like a bit of hassle to set up.
I've been happy with the stock rom but I might just flash Malaysk's rom and see if tablet talk works on that.
Sorry to bump an old thread, just thought I'd mention I now have texts from my phone displaying on my HU and I can reply from the HU.
I'm using Tasker, AutoRemote and AutoNotification. It took me a while to get my head around working them, if anyone wants me to export my tasks etc so they can text from their head unit let me know and I'll do so
From my searching before I posted I remembered a few people had asked about it so just thought i'd mention in case anyone wants it. I only have mine set up for SMS which talks to the HU through Bluetooth but I'd imagine its pretty much the same for WhatsApp etc.
dc5daft said:
Sorry to bump an old thread, just thought I'd mention I now have texts from my phone displaying on my HU and I can reply from the HU.
I'm using Tasker, AutoRemote and AutoNotification. It took me a while to get my head around working them, if anyone wants me to export my tasks etc so they can text from their head unit let me know and I'll do so
From my searching before I posted I remembered a few people had asked about it so just thought i'd mention in case anyone wants it. I only have mine set up for SMS which talks to the HU through Bluetooth but I'd imagine its pretty much the same for WhatsApp etc.
Click to expand...
Click to collapse
Sure, would be interested in seeing how you've done it
Ditto. Avid Tasker user so would lurve to see your tasks ?
Sent from my BN NookHD+ using Tapatalk
I'm at work just now (working hard clearly ) so can only upload my phone profiles/tasks, I'll upload the HU ones later.
I had been testing on my tablet which is why the recipient may be different but I suppose if you wanted to use it you would need to change it anyway. Any questions or suggestions fire away, its been a while since Ive done any programming type of stuff so if there are more efficient ways of doing things I'd be glad to know
For folk with little experience with Tasker, AutoRemote and AutoNotification, here's how it works:
1) On the phone: If I receive a text and my bluetooth is on, set a variable to 1.
2) On the Phone: When the variable equals 1, start the AutoRemote Bluetooth service and send the SMS details to the HU then set the variable back to 0. (Messages are sent one at a time so it sends the recipient's name, then number, time received and text body separate)
3) On the HU: When one message is received, add 1 to a variable to count each message received.
4) On the HU: When all messages are received (the counter equals 4) use the AutoNotification to show a new notification that you have received a text.
6) On the HU: On the notification there is a reply button and a discard button. Discard button runs a task to just close the notification and reset all variables. Reply button runs a task that closes the notification and then opens a tasker scene (a sort of window)
7) On the HU: The scene shows the name and number the SMS is from and a text box to type a reply. Buttons on the scene are an exit button, send button, car button and call button. Exit obviously closes the scene and then clears all variables. Send button will send the details back to my phone, close the scene and clear the variables. The car button I have set to send a template message "I'm driving just now sorry, I'll call you later" then it clears variables and closes scene. I want the call button to call the contact through the built-in bluetooth app on the HU, although I'm still working on this to see if its possible. This is one of the main reasons I went to the hassle of doing this myself rather than use an app since most apps deal with calls too and use your phone mic which I didn't like since my phone will most likely be in my pocket and I have my mic all wired up in my car.
8) On the Phone: The phone waits for the number and text message to be received. I used separate tasks and a counter like before to make sure both parts are received.
9) On the Phone: When the counter equals 2 (both the number and message have been received) then it sends the SMS from the phone, clears all variables and stops the AutoRemote Bluetooth service since I dont want this running all the time.
Hopefully it makes sense but like I said, happy to help other people get it set up I'll get the HU XML's uploaded tonight when I'm home and get some screenshots as well. Its still at very early stages so I may make some tweaks, I've actually yet to test it in my HU but its all working on my tablet so I dont see an issue. I'll get a better feel for how functional it is as well once Ive imported it into my car but I suppose its down to personal preference and people can add or change what they want.
Cheers guys
Here are the HU exported XMLs and a few screenshots taken from my tablet from texts I was sending to myself.
Its at early stages so go easy on me
Nice approach. In autoremote you can send multiple parameters by using =:= between them like " SMSSendTo=:=number=:=body=:=time"
And then access them by %arcomm1 %arcomm2...
That way you can do it a bit more efficient.
I have edited your profiles and tasks. I will upload them later today so you can se how it can be done.
I used Tablet Talk years ago so I had paid for it already. Unfortunately, I was unable to get the HU to connect with my phone with bluetooth or wifi. I just purchased Tasker for the first time and the amount of options is incredible not to mention the plugins. I just don't have the time to learn the ins and outs of it all at this time. I look forward to seeing how this develops. Thanks for sharing your work!
Thanks guys
Yeh I had trouble getting tablet talk working on mine too which is why I decided to do something myself. Glad I did though sice tasker is such a great app, now using it for some other stuff too
By the way, I got a few notifications for messages on my tablet so someone must have used the project and forgot to change the receiptient device. That might be why it's not working you can change it by opening the scenes then editing the buttons that send messages. In the "tap" tab I think it is, click on the tasks that send the messages and make sure you select your device from there. You will have to have added it already though in AutoRemote by clicking on the devices tab, then add and use the URL from the device you are adding. Any other questions fire away, I'm still quite new to tasker though but I'll try my best.
Here are the example on how you can do it a bit more efficiant.
Dont forget to change the receiptient device in the "Send_Tther_Device" task on phone and in "SMS_Reply" scene on hu.
I've been trying out the tasker files you listed nanab. It definitely works but only once in a while. Autoremote seems extremely delayed or never sends the message. I tried forcing the connection between wifi/bt but it seems to not make a difference. Long texts from the HU back to the phone seem to anger it as well. Messages and notification reach the HU well but from HU to phone has issues. I will usually be able to send one and then it stops working. Any suggestions or tweaks I can make?
This has been helping me learn some tasker stuff so thanks again.
tutorial
dc5daft said:
I'm at work just now (working hard clearly ) so can only upload my phone profiles/tasks, I'll upload the HU ones later.
I had been testing on my tablet which is why the recipient may be different but I suppose if you wanted to use it you would need to change it anyway. Any questions or suggestions fire away, its been a while since Ive done any programming type of stuff so if there are more efficient ways of doing things I'd be glad to know
For folk with little experience with Tasker, AutoRemote and AutoNotification, here's how it works:
1) On the phone: If I receive a text and my bluetooth is on, set a variable to 1.
2) On the Phone: When the variable equals 1, start the AutoRemote Bluetooth service and send the SMS details to the HU then set the variable back to 0. (Messages are sent one at a time so it sends the recipient's name, then number, time received and text body separate)
3) On the HU: When one message is received, add 1 to a variable to count each message received.
4) On the HU: When all messages are received (the counter equals 4) use the AutoNotification to show a new notification that you have received a text.
6) On the HU: On the notification there is a reply button and a discard button. Discard button runs a task to just close the notification and reset all variables. Reply button runs a task that closes the notification and then opens a tasker scene (a sort of window)
7) On the HU: The scene shows the name and number the SMS is from and a text box to type a reply. Buttons on the scene are an exit button, send button, car button and call button. Exit obviously closes the scene and then clears all variables. Send button will send the details back to my phone, close the scene and clear the variables. The car button I have set to send a template message "I'm driving just now sorry, I'll call you later" then it clears variables and closes scene. I want the call button to call the contact through the built-in bluetooth app on the HU, although I'm still working on this to see if its possible. This is one of the main reasons I went to the hassle of doing this myself rather than use an app since most apps deal with calls too and use your phone mic which I didn't like since my phone will most likely be in my pocket and I have my mic all wired up in my car.
8) On the Phone: The phone waits for the number and text message to be received. I used separate tasks and a counter like before to make sure both parts are received.
9) On the Phone: When the counter equals 2 (both the number and message have been received) then it sends the SMS from the phone, clears all variables and stops the AutoRemote Bluetooth service since I dont want this running all the time.
Hopefully it makes sense but like I said, happy to help other people get it set up I'll get the HU XML's uploaded tonight when I'm home and get some screenshots as well. Its still at very early stages so I may make some tweaks, I've actually yet to test it in my HU but its all working on my tablet so I dont see an issue. I'll get a better feel for how functional it is as well once Ive imported it into my car but I suppose its down to personal preference and people can add or change what they want.
Cheers guys
Click to expand...
Click to collapse
can you make a tutorial step by step thank you
At the first try it works for me but after restarting the engine i don't get any message to the car unit anymore
My Phone tolds me that the message was successfully send to the Car Unit but it doesn't get them.
After a lot of reconnecting in Autoremote it works again but only until the car unit was restarted.
Has anybody found out another solution?
dc5daft said:
Here are the HU exported XMLs and a few screenshots taken from my tablet from texts I was sending to myself.
Its at early stages so go easy on me
Click to expand...
Click to collapse
Wonder if this still works?
pushbullet ! works well !

Categories

Resources