BlueVia Launches Android SDK

 

We’re delighted to announce the new Android SDK is available on BlueVia.com, which will help Android developers to integrate with our network APIs easily. The Android SDK joins our current BlueVia SDK portfolio: .NET, Java, PHP and Ruby.

The Android SDK works with the complete set of BlueVia APIs.  Developers will also be able to use the HTTP REST API, reducing the complexity of working directly with the API and allowing developers to speed up their integration with BlueVia.

The Android SDK is based on the client-server paradigm, using all the necessary elements and functionality to make client HTTP requests to network APIs on BlueVia. This means that developers only need to use the public interface of the SDKs, using client objects to implement requests.

This new Android SDK lets developers use the following BlueVia APIs:

The Android SDK – as with the others ones – includes a “Getting Started” guide, which includes guides for the public interface and the object model structure, most of which is generated in Doxygen. The Android SDK also includes some demos that use the API, including the configuration files needed to execute the demos inside a development environment.

The Android SDK includes an easy interface based on an object model structure, hiding the complex HTTP REST requests implementation, so that any developer can write simple calls-to-objects instead of implementing complete HTTP requests. This includes the generation of XML /JSON for requests parameters and the processing of XML/JSON responses.

Here’s an example:

//———————————————–

// Send an SMS

// 1. Create the client (you have to choose the mode (HTTP/Mock) and include the OAuth authorization values)

Token accessToken = new Token(“my_oauth_token”, “my_oauth_token_secret”);     BlueviaSmsClient smsClient = new BlueviaSmsClient(getApplicationContext(), AbstractRestClient.Mode.HTTP, “my_consumer_key”,”my_consumer_secret”,

accessToken);

// 2. Build the message

// The address and the origin address are UserId Objects

SmsMessage sms = new SmsMessage();

sms.setMessage(“This is the text to be sent”);

sms.addAddress(new UserId(Type.PHONE_NUMBER,”600010101″)); sms.setOriginAddress(new UserId(Type.ALIAS,”702319a6ab2270cf3d42a09a3f4c49bd”)); String result = null;

// 3. Send the message. try {

result = smsClient.sendSms(sms);

……

……

} catch (OtafClientException e) {

Log.e (TAG,”Error sending SMS”, e);

}

// 5. Finally close the client

smsClient.close();

The Android SDK includes a parameter checking system (the validation component shown in the above code) that avoids launching incorrect HTTP requests made by the developer due to incorrect input parameters, in order to save developer time :)

The Android SDK also supports a Debugging Mode, to allow developers to test their Android applications directly through the Android SDK. The Debugging Mode is very useful for the early stages of development to debug code without using network traffic.

Using the Debugging Mode, the library responds to developer calls with a set of predefined responses, instead of making real HTTP connections. The set of responses includes the most common error cases and the “OK” response. Developers can also use this mode by modifying just one line of their production code, as follows:

BlueviaSmsClient smsClient = new BlueviaSmsClient(getApplicationContext(),                     AbstractRestClient.Mode.TEST_OK , “my_consumer_key”, “my_consumer_secret”,                     accessToken);



We hope that you enjoy this new SDK and if you have any feedback, please let the BlueVia team know through the forum, by sending us an email to support@bluevia.com, or tweet us @bluevia.

- Ruben Mellado (BlueVia Head of Product & Technology)
- Enrique Velez (BlueVia SDK Development Team)

BlueVia - Facebook BlueVia - Twitter BlueVia - Vimeo BlueVia - SlideShare BlueVia - LinkedIn