Click here to Skip to main content
15,917,454 members
Home / Discussions / C#
   

C#

 
AnswerRe: Time of action in [Date] [Time] [Action] Pin
Mycroft Holmes23-Jul-16 14:20
professionalMycroft Holmes23-Jul-16 14:20 
AnswerRe: Time of action in [Date] [Time] [Action] Pin
BillWoodruff23-Jul-16 15:41
professionalBillWoodruff23-Jul-16 15:41 
QuestionSave Physical File using MySQL Pin
Jassim Rahma22-Jul-16 23:29
Jassim Rahma22-Jul-16 23:29 
AnswerRe: Save Physical File using MySQL Pin
OriginalGriff23-Jul-16 0:31
mveOriginalGriff23-Jul-16 0:31 
GeneralRe: Save Physical File using MySQL Pin
Jassim Rahma23-Jul-16 7:19
Jassim Rahma23-Jul-16 7:19 
GeneralRe: Save Physical File using MySQL Pin
Pete O'Hanlon23-Jul-16 7:49
mvePete O'Hanlon23-Jul-16 7:49 
GeneralRe: Save Physical File using MySQL Pin
Mycroft Holmes23-Jul-16 14:25
professionalMycroft Holmes23-Jul-16 14:25 
QuestionHow to send Images in notification in Android using C#! Pin
Member 1158380322-Jul-16 3:23
Member 1158380322-Jul-16 3:23 
Hi!

I am able to send text messages to android using Google GCM by C# code.

But I am unable to send Images along with the text message.

Can anyone help in the same with some code.
--------------------------------
My code for sending message:

C#
RegId = Id;
                            //SENDER_ID = dt.Rows[i]["imeie"].ToString();
                            SENDER_ID = "1234567";
                            ApplicationID = "Google ID";
                            var value = txtnotofication.Text; //message text box

                            WebRequest tRequest;
                            tRequest = WebRequest.Create("https://android.googleapis.com/gcm/send"); tRequest.Method = "post";
                            tRequest.ContentType = "application/x-www-form-urlencoded;charset=UTF-8";
                            tRequest.Headers.Add(string.Format("Authorization: key={0}", ApplicationID)); tRequest.Headers.Add(string.Format("Sender: id={0}", SENDER_ID));
                           

                            string postData = "collapse_key=score_update&time_to_live=108&delay_while_idle=1&data.message= {\"message\" : \"demo msg\",\"imgUrl\": \"http://justcash.co.in/img/logo0011.png \"}&data.time=" + System.DateTime.Now.ToString() + "&registration_id=" + RegId + "";

                                                        Console.WriteLine(postData);

                            Byte[] byteArray = Encoding.UTF8.GetBytes(postData);
                            tRequest.ContentLength = byteArray.Length;
                            Stream dataStream = tRequest.GetRequestStream();
                            dataStream.Write(byteArray, 0, byteArray.Length);
                            dataStream.Close();
                            WebResponse tResponse = tRequest.GetResponse(); dataStream = tResponse.GetResponseStream();
                            StreamReader tReader = new StreamReader(dataStream);
                            String sResponseFromServer = tReader.ReadToEnd();  //Get response from GCM server 
                           // Response.Write("tReader");
                            //label_Result.Text = sResponseFromServer; //Assigning GCM response to Label text

                            tReader.Close(); dataStream.Close();
                            tResponse.Close(); 

AnswerRe: How to send Images in notification in Android using C#! Pin
Ravi Bhavnani25-Jul-16 5:40
professionalRavi Bhavnani25-Jul-16 5:40 
Questionx86 and x64 in one project Pin
po_saa21-Jul-16 21:33
po_saa21-Jul-16 21:33 
AnswerRe: x86 and x64 in one project Pin
Rob Philpott21-Jul-16 21:46
Rob Philpott21-Jul-16 21:46 
GeneralRe: x86 and x64 in one project Pin
po_saa21-Jul-16 22:15
po_saa21-Jul-16 22:15 
AnswerRe: x86 and x64 in one project Pin
Richard MacCutchan21-Jul-16 21:52
mveRichard MacCutchan21-Jul-16 21:52 
GeneralRe: x86 and x64 in one project Pin
po_saa21-Jul-16 22:11
po_saa21-Jul-16 22:11 
GeneralRe: x86 and x64 in one project Pin
Richard MacCutchan21-Jul-16 22:21
mveRichard MacCutchan21-Jul-16 22:21 
AnswerRe: x86 and x64 in one project Pin
Pete O'Hanlon21-Jul-16 22:05
mvePete O'Hanlon21-Jul-16 22:05 
GeneralRe: x86 and x64 in one project Pin
po_saa21-Jul-16 22:13
po_saa21-Jul-16 22:13 
GeneralRe: x86 and x64 in one project Pin
OriginalGriff21-Jul-16 22:32
mveOriginalGriff21-Jul-16 22:32 
GeneralRe: x86 and x64 in one project Pin
po_saa21-Jul-16 23:19
po_saa21-Jul-16 23:19 
GeneralRe: x86 and x64 in one project Pin
OriginalGriff21-Jul-16 23:36
mveOriginalGriff21-Jul-16 23:36 
GeneralRe: x86 and x64 in one project Pin
po_saa22-Jul-16 0:12
po_saa22-Jul-16 0:12 
GeneralRe: x86 and x64 in one project Pin
Rob Philpott21-Jul-16 23:48
Rob Philpott21-Jul-16 23:48 
GeneralRe: x86 and x64 in one project Pin
po_saa22-Jul-16 0:19
po_saa22-Jul-16 0:19 
QuestionInheritance Pin
sunsher20-Jul-16 15:11
sunsher20-Jul-16 15:11 
GeneralRe: Inheritance Pin
PIEBALDconsult20-Jul-16 16:47
mvePIEBALDconsult20-Jul-16 16:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.