porting javinp / bigml-java

26 views
Skip to first unread message

XiangCheng He

unread,
Dec 2, 2013, 5:58:57 AM12/2/13
to bi...@googlegroups.com
Hi, ALL

Anyone ever try to use this binding in a android application ?
Any steps I have to follow ?
What is the error code 500 ?

I have the code snippet in my code to test the porting result:
try {
            JSONObject listing = BigMLClient.getInstance(true).listDatasets("Iris");
            System.out.println(listing);
} catch (AuthenticationException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
}

I "move" some major class/java file into my android application project, always got following message.

{"error":{"status":{"message":"The resource couldn't be listed","code":500}},"objects":null,"meta":null,"code":500}

Thanks.

Oscar Rovira

unread,
Dec 2, 2013, 7:11:39 AM12/2/13
to XiangCheng He, bi...@googlegroups.com
Hi XiangCheng,
It looks like you don't have set a valid binding.properties file in src/main/resources/binding.properties (you have a sample file here in the project repo https://github.com/javinp/bigml-java/blob/master/src/main/resources/binding.properties), there you need to set your BIGML_USERNAME and BIGML_API_KEY:

BIGML_URL=https://bigml.io/andromeda/
BIGML_DEV_URL=https://bigml.io/dev/andromeda/
BIGML_USERNAME=<your username here>
BIGML_API_KEY=<your api_key here>

You can get your api_key in your account at https://bigml.com/account/apikey and as a tip you have available a "shortcut" to make queries directly to BigML's API (bigml.io) on each screen of the web page. See the attached picture to she what I'm talking about.

By the way, the listDataset(…) method expects a query string like parameter. So, I think that you want to retrieve your datasets with the name "Iris", then the string parameter should be something like "name=Iris". But if you want to be less strict in the query, you may want to include the "icontains" parameter in the query string, then the listDatasets(…) call would be:

JSONObject listing = BigMLClient.getInstance(true).listDatasets( "name__icontains=iris" );

Please, let us know if that fixes your issue.

Oscar Rovira
Software Engineer | BigML Inc.

--
You received this message because you are subscribed to the Google Groups "BigML" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bigml+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages