Showing posts with label Google Cloud Messaging. Show all posts
Showing posts with label Google Cloud Messaging. Show all posts

Sunday, August 10, 2014

Google App Engine and Google Cloud Message - Send-to-sync messages

Code snippet for sending a Send-to-sync messages in GAE


//API_KEY is a public API key created for application in Google Developers Console

Sender sender = new Sender(API_KEY);
  
Message msg = new Message.Builder()
 .addData("New message received", message)
 .collapseKey("key1").build();
 
Result result = sender.send(msg, gcmid),5);

Sunday, July 27, 2014

Calling GCM by using ASP classic

function sendToGCM(regIds, metaData)

'http://developer.android.com/google/gcm/http.html

Dim DataToSend

DataToSend = DataToSend & "registration_id=" & regids
DataToSend = DataToSend & "&collapse_key=location"
DataToSend = DataToSend & "&data.location=" & metaData

Dim key
key = "AdisfbsisP5MwE389fjnsidsslpx10fm2siusbi8bwc" 'Generated server key for the application

url = "https://android.googleapis.com/gcm/send"

set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP")
    xmlhttp.open "POST", url, false
xmlhttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded;charset=UTF-8"
'Public API Server Key
xmlhttp.setRequestHeader "Authorization", "key=" & key
xmlhttp.send DataToSend
    returnString = xmlhttp.responseText
    set xmlhttp = nothing

sendToGCM = returnString

end function

Applying SMA10/20, SMA20/50 as trading signals

This is the comparison for results before and after applying SMA10/20 and SMA20/50 in the stock trader. Background Trading 3 stock ma...