Try bluemix android SDK with jruby


Install the SDK

Create the project


ruboto gen app -t 14 --package org.ruboto.example.bluemix

Download SDK

The Web page javascript failed to download in Chrome browser, but open the console, and you can see the download link is: http://mbaas-catalog.ng.bluemix.net/sdk/ibm-baas-sdk-android.zip

copy all jars into libs directory

copy the configuration.json to libs or assets dirtctory?

then add the application id into configuraton.json

import in the ruby source code


#in xx_activity.rb
java_import com.ibm.mobile.services.data.IBMDataException
java_import com.ibm.mobile.services.data.IBMDataObject
java_import com.ibm.mobile.services.data.IBMObjectResult
java_import com.ibm.mobile.services.data.IBMQuery
java_import com.ibm.mobile.services.data.IBMQueryResult

Usage of the classes


record = IBMDataObject.new 'record'

Upload data using Rest way


 curl -v
 "https://mobile.ng.bluemix.net/data/rest/v1/apps/{app_id}/uploads" -X POST -H "Content-Type: application/json" -d '[{"className": "MyPeople","objectId":"123","attributes":{"name":"BBB"}}]''
comments powered by Disqus