c# windows mobile Text messaging - c#

I have mad an application for windows mobile which can do different mobile functions with the numbers the application has.
Anyway. I want to start the Text message application and send a phonenumber as an argument.
I have only found this:
SmsMessage sms = new SmsMessage();
sms.Body = "This is a message";
sms.To.Add(new Recipient(sNumber));
sms.Send();
But i want to use the text messaging application in the mobile device.
Any tip?
thanks in advance

As a start, have you looked to see if this discussion is relevant to what you want to do? One thing it mentions is using CE MAPI and COM interop. There's also the Mobile In The Hand library.
There are other links in that discussion too.

Take a look at the MessagingApplication class, in particular its DisplayComposeForm static method. You should be able to use a code snippet such as the following to get the built in messaging application to appear.
SmsMessage sms = new SmsMessage();
sms.Body = "This is a message";
sms.To.Add(new Recipient(sNumber));
MessagingApplication.DisplayComposeForm(sms);
I also have a blog post available with a sample application that in part demonstrates using this API - http://www.christec.co.nz/blog/archives/495.

Related

How to share attachments from user to agent (Human handoff) using Bot?

i have bot made using c#. It has the feature of human off. We have integrated the solution provide by tompanna of human handoff where a agent can talk to single user at a time.Here the link of solution we used for human handoff https://github.com/tompaana/intermediator-bot-sample. Our bot is working fine and able to talk with agent with the help of this solution but major issue come when a user want to share image or any kind of attachments from user to agent or from agent to user. The bot show that image is send but user is not able to see it. Simpler case happen in the case of agent.
Image of agent while sending a attachment to user.
And also the image of user ,unable to see the image send by agent.
The sample which you are using for Human HandOff has not been updated over a year, so it gets difficult to be able to find solutions for supporting various features pertaining to the same. However, going through the sample issues, there has been a similar issue in which the sample does not support emojis, images or files to the receiving user. If a user sends any of the above mentioned features, the receiver will get a blank message as it supports only text messages.
Th tentative solution suggested by a user is to create a simple method extension to send image/file messages.You could go ahead and give it a try to see if it works for your case.
Hope this helps.
You need to edit the source code of the library to achieve what you are trying.
In this MessageRouter file , method RouteMessageIfSenderIsConnectedAsync , you can access message.Attachments , then pass it as a parameter to SendMessageAsync in line 432, then from SendMessageAsync in line 160 , you can pass it to CreateMessageActivity method and then in file ConnectorClientMessageBundle , you can access the attachment and attach it to messageActivity.

C# .NET Core Discord Music Bot

so I'm looking to code in some music functionality to a bot that I'm making. I've tried a whole bunch of different search terms but can't seem to come up with anything.
I'm writing the bot in C# .NET Core
I've got the basics down. Connects to a voice channel etc. But I'm not sure how to interface it with YouTube/Spotify so that it could search for url's or song titles.
So for example I'd like to be able to give it a link like this (either youtube or spotify):
Or be able to search Youtube (or both) for a song title:
I'm sure there's some kind of library to download or a NuGet package or API that I can integrate, but I just can't seem to find the right search terms to use to find any tutorials or documentation on the topic.
Any help in this area would be appreciated
Well I have been in your shoes and the best solution is to abandon all native ffmpeg and all and just use Sharplink. It uses lavalink to send audio to discord without actually connecting to it.
DiscordSocketClient client = new DiscordSocketClient();
LavalinkManager lavalinkManager = new LavalinkManager(client, new LavalinkManagerConfig
{
RESTHost = "localhost",
RESTPort = 2333,
WebSocketHost = "localhost",
WebSocketPort = 2333,
Authorization = "YOUR_SECRET_AUTHORIZATION_KEY",
TotalShards = 1
});
This is how you would get started.
Once a LavalinkManager is set up it will need to be started. It is recommended you put this in the ready event.
client.Ready += async () =>
{
await lavalinkManager.StartAsync();
}
Real the docs at https://github.com/Devoxin/SharpLink
Good Luck
**EDIT: **
I made my music bot public so https://github.com/rishav394/Dota-Geek/ here it is. Look out for the music section.

Twilio mms from an Android phone within Canada using Unity3D

Target Platform : Samsung S6 - Android
Development base : Unity3D using C#
Intention :
Send a picture (MMS) shot within an app to any desired phone number within Canada. This app is supposed to be preloaded to a single Samsung S6.
Questions :
I was unable to find any Unity samples within you SDK, however I was wondering if anyone knows Unity samples for my intended use. However planned to use these scripts as first of reference.
Though the Android Phone number which is used to send MMS can be associated with Twilio the receiver would have no association with Twilio as the sender phone number is not something we would know until the photo is taken - hence is this a concern?
I see that from from the API call
// Send a new outgoing MMS by POSTing to the Messages resource */
client.SendMessage(
"YYY-YYY-YYYY", // From number, must be an SMS-enabled Twilio number
person.Key, // To number, if using Sandbox see note above
// message content
string.Format("Hey {0}, Monkey Party at 6PM. Bring Bananas!", person.Value),
// media url of the image
new string[] {"https://demo.twilio.com/owl.png" }
);
the fourth and final parameter is a URL link. Can link of the image be from any server or should it only be from twilio's server?
Thank you very much for time. Highly appreciate it.
Here you are. As far as I know this works like a charm.

Windows phone sdk send email with XNA game engine

I am making a game for my windows phone, using Visual Studio 2012 for Windows Phone and it went good from there, I wrote a few classes, and added assets but I encountered a problem.
I wanted to make a bug request / idea method, but no-where could I find where to email with XNA. I searched on Google but it came up with stuff like "How to use XNA game studio" and at the bottom it said stuff like "email us" so I never found it out. Basicley I couldn't find it. Can anyone help me out?
You can send an email out using the EmailComposeTask class in WP8. But it not totally automatic, the user has to select the account to send the email with then the Email display pops up then they have to click on send button. You can try it like this:
How to use the email compose task for Windows Phone 8
using Microsoft.Phone.Tasks;
// do this when the page has load completely (not in the constructor)
EmailComposeTask emailComposeTask = new EmailComposeTask();
emailComposeTask.Subject = "message subject";
emailComposeTask.Body = "message body";
emailComposeTask.To = "recipient#example.com";
emailComposeTask.Cc = "cc#example.com";
emailComposeTask.Bcc = "bcc#example.com";
emailComposeTask.Show();
However, I don't think this is what you want. What I would do instead because it's difficult to do the email thing silently is create a webpage, that you can POST to. You then can just open a WebClient and POST the data that you need to that website. Then on the website's back end, just decode the POST[DATA] into a database.
Hope this helps you, good luck.
As mentioned in the other answer, you may want to consider just opening a web page with a form for them to fill out, rather than writing emails within your app.
If so, here is the code to open a webpage on Windows Phone from an XNA game (using http://www.google.com/ as an example.:
WebBrowserTask browser = new WebBrowserTask();
browser.Uri = new Uri("http://www.google.com/", UriKind.Absolute);
browser.Show();

Windows Phone - link to the publisher in the app store

I have created several windows phone apps and I would like to link to my publisher's page to show all of the apps that I publish. Note that I am developing my app for Windows Phone 7.x and up using C# and XAML.
UPDATE
What I would like to do is show the following publisher page: From within Windows Phone, navigate to the Windows Phone store, then select any app, then select the "more from <Publisher>" link. This displays a nice mobile view of all of that publisher's apps. But I can't figure out how to bring up that publisher page directly from within my app. Any help would be appreciated!
Option 1) Link directly to the URL for my publishers page (using a WebBrowserTask)
Issue) All links to the store seem to require the en-US language embedded in the URL. I'm concerned about what will happen to users in other countries/languages.
Example: http:/www.windowsphone.com/en-US/store/publishers?publisherId=Microsoft%2BCorporation
Is there a language independent way to link to a publisher in the store?
Option 2) Use the MarketplaceDetailTask to link to the publisher
Issue) From what I've seen, this can only be used to link to an app. I tried using my publisher GUID and got: Marketplace Error - We're sorry, but we can't complete your request right now.
MarketplaceDetailTask marketplaceDetailTask = new MarketplaceDetailTask();
marketplaceDetailTask.ContentType = MarketplaceContentType.Applications;
marketplaceDetailTask.ContentIdentifier = <My Publisher GUID>;
marketplaceDetailTask.Show();
Option 3) Use the MarketplaceSearchTask to link to the publisher
Issue) This allows searching the store with any string. The problem is, when I put my publisher name in the search string, other apps are shown in addition to mine. My publisher name includes a common word and any app with that word shows up.
MarketplaceSearchTask searchTask = new MarketplaceSearchTask();
searchTask.ContentType = MarketplaceContentType.Applications;
searchTask.SearchTerms = "<My Publisher Name>";
searchTask.Show();
Any thoughts or suggestions would be appreciated!
Thanks.
As you're targeting WP7+, unfortunately using the zune:search URI only works on WP8 as it relies on URI Schemes, which was not backported to WP7. Based on these two posts, I tried the following on your behalf:
zune://search/?publisher=Henry%20Chong;
And a bunch of other things, but it seems that only zune://navigate is available on Windows Phone 7 and that only allows you to load a specific app. (Perhaps someone who feels like opening reflector or on the Phone teams could comment here...)
Two other things I've come across that you can look into:
1) There used to be an undocumented Zune api that you could query the marketplace against; it looks like this has been replaced by the Marketplace Edge Service, which you could try and dig around for:
http://social.msdn.microsoft.com/forums/windowsapps/en-US/f5294fcb-f4b3-4b19-9bda-f49c6a38b327/marketplace-edge-service-query
2) You could add a specific unique keyword to all your apps and use the MarketplaceSearchTask, as suggested here by Matt.
Personally, I'd go with #2 because:
you never know when the Marketplace Edge Service will change
1 is not technically supported by Microsoft
you won't have to replicate the page you're trying to display
Of course, there's also nothing stopping you from creating your own "Apps by X" page for your app and maintain it yourself manually.
Best of luck!

Categories