Backend as a service with marmalade - How?

Home / Forums / Marmalade Archive / General Development Questions / Backend as a service with marmalade - How?
5 replies [Last post]
by: mita
Status: Offline
Joined: 2012-04-27
Points: 200

Hi.

I need to use one of the baas services such as StackMob / Kinvey etc. to store a very small amount of data per user, and they all supply standard android and iOS libraries. How do I use them in my Marmalade C++ app?

I'm guessing a lot of Marmalade developers use such services but I can't find anything about it in the forums.

by: waheyluggage
Status: Offline
Joined: 2011-07-22
Points: 2810
Check out the EDK section

Check out the EDK section under the documentation. I've not used but I believe that's how they approach it. There's a sample on getting a 3rd party library working.

by: mita
Status: Offline
Joined: 2012-04-27
Points: 200
Yes, I thought so but since I

Yes, I thought so but since I'm not a java developer (which is one of the reasons I'm looking into Marmalade), I don't know what to do with this whole "bin, gen, libs, src, res etc." folders under the sdk tree I was given.

I tried looking at the EDK messagebox example but it is built much much simpler than the sdk.

by: DGuy
Status: Offline
Joined: 2011-04-06
Points: 4210
Hi Mita,

Hi Mita,

Great thing about StackMob, Parse & Kinvey is they all provide REST APIs so you can use Marmalades' CIwHTTP to work with them, no EDK stuff required.

Here's one of the StackMob examples to POST some data:

CIwHTTP *_pHttp = new CIwHTTP();
_pHttp->SetRequestHeader( "Accept", "application/vnd.stackmob+json; version=0" );
_pHttp->SetRequestHeader( "Content-Type", "application/json" );
_pHttp->SetRequestHeader( "Authorization", "OAuth realm=<...snip...>" );
 
static char *reqBody = (char *)"{\"content\":\"Hello Word!\"}";
 
_pHttp->Post( "http://api.mob1.stackmob.com/message", reqBody, strlen(reqBody), _httpGotHeaders, NULL );

The most challenging part was becoming familiar with CIwHTTP and json_parser (as the responses you'll get back are in JSON format).

-David

by: mita
Status: Offline
Joined: 2012-04-27
Points: 200
Thanks, David!

Thanks, David!

This seems like a great option, also eliminating the need to use different SDKs for different OSs.

Right now the code you supplied is very foreign to me, but as you said, I need to learn CIwHTTP and json_parser.

Thanks,
Mita

by: mita
Status: Offline
Joined: 2012-04-27
Points: 200
Update:

Update:

Using Davids example above, the IwHTTP example and the cJSON port instead of the pre-supplied json_parser I've been able to access and parse a Parse database in almost no time.

Mita

Latest Posts

Latest Comments

Top Contributors

  • Chris D : 27,010
  • MonRoyals : 26,970
  • Salman : 26,720
  • Jez Hammond : 20,130
  • pjan : 11,150
  • gjw : 10,350
  • Paolo Oliverio : 9,640
  • Beaker_2 : 8,390
  • Kite : 8,210
  • bluescrn : 7,810