Connect to spark via

I just got a new spark and I want it to replace my garden arduino- bluetooth project.
I wrote an app on that display the sensors value and control the valve, with commands like SerialPort1.Write(β€œ1”) , SerialPort1.ReadLine().
How can I replace those commands to communicate with the spark cloud?
Even if you don’t know the syntax can you explain the logic I need to use?
Thank you.

I think some resources here might be helpful: :smiley: