Message:

API Services (8 posts)

Images displayed in your app often may be responsible for the bandwidth consumed by the device, which has a direct impact on the performance, battery level and the amount of memory which the app allocates. As a result, optimizing images can often bring noticeable performance improvements for your app: the fewer bytes it needs to download, the smaller impact is on the client’s bandwidth and the faster app will download and render content on the screen.

Let’s imagine you have an app where you store pictures to show them to your app’s users. But what happens if the resolution of these images is high and they are taking a lot of space? Download of these files is time-consuming and, as a result, it slows down your app making the user experience substandard.

A recommended approach is to create image thumbnails with lower resolutions relative to the original one. These thumbnails can be used to preview the image in the application.

The thumbnails can be generated using Backendless API Services (the Business Logic section). If you are not familiar with how to create your own API Service, please check the How to generate a QR code with Backendless API Service post, which describes the process of API service creation in greater detail.

In this article, we will focus on the task of generating thumbnail images with different resolutions.

Continue reading

Suppose your app logs in a user. As a result, the app gets user-token  which uniquely identifies the user’s session with Backendless. If your app uses our SDK for Android, iOS, JS or .NET, the user-token  value is managed directly by our libraries. Specifically, it is added to every API call to maintain the session and tell the server about the user’s identity. There are situations when you need to get the user object when your app has only user-token. This could happen if you used persistent login in the application, which stores user-token on the device. The implementation does not save the user object, however, there is a way to retrieve the user based on the user-token value (assuming the token is still valid). In this article, I will show you how to do this.

The technique for retrieving the user object is creating an API service which accepts a  user-token in the header and retrieves the current user. I will use Codeless to create the API service because it has an intuitive interface and allows you to solve these tasks very quickly, just by building the algorithms instead of writing code:

Continue reading

Backendless Marketplace is a specialized store for backend functionality. Our vision for the marketplace is to make it a community driven store for algorithms and API services. We also use the Marketplace for various  Backendless”extenders” to help developers to increase the limits of the Backendless Cloud pricing plans. However, most importantly, the Marketplace can be used for sharing your API services with other developers.

By publishing your Cloud Code to the Marketplace, you can share your business logic components (e.g.: API services, event handlers and/or timers) with other Backendless developers. Once your Cloud Code is published, it becomes a Marketplace product and will be visible to all Backendless users (developers). In the upcoming releases, we’ll add a possibility to set a price for your products allowing you to charge a fee for every successful installation.

Backendless Marketplace   Backend as a Service Platform Google Chrome 2018 05 31 21.54.32 1024x568 - How to publish a service to Backendless Marketplace

Continue reading

In this article, we will learn how to create QR codes with a custom Backendless API Service. For the sample code reviewed later in the article we will use Java and the ZXing library (https://github.com/zxing).

What is a QR code?

A QR code is a computer generated image with some information encoded in a graphical way. The information may include text, numbers, a URL – pretty much anything your app may need to represent in an encoded manner. What makes QR codes very useful is the encoded information can be then decoded by any device with a camera.

Below is an example of a QR code with the encoded link to Backendless Console: https://develop.backendless.com:

pasted image 0 4 - How to generate a QR code with Backendless API ServiceYou can ‘read’ it with an iPhone (just use the standard camera app) or with an Android device if you install a QR Code reader app (check out Google Play, there is a ton of QR reading apps). Once the code is scanned, the encoded URL will be opened automatically in your web browser.

(For more details, click here: https://en.wikipedia.org/wiki/QR_code)

Continue reading

If you have any smart IoT devices in your home or office and tried controlling them with Alexa, you might wonder how it actually works. In this guide you will learn about building a custom Alexa skill which will let you control a wi-fi enabled light bulb with Alexa. You will be able to turn the light on/off and change the light colors. You can see a demo of the completed project as well as an overview of its components in the video below:

The solution consists of the following components:

  • Amazon Alexa-enabled device (Amazon Echo)
  • A custom Alexa skill, which is an API service running in Backendless
  • An API service which contains the logic of controlling the light bulb
  • A wi-fi enabled light bulb, for this we used a LIFX bulb.
Continue reading

This post describes the process of developing an API Service in Backendless with JavaScript. You will learn:

  • how configure your development environment
  • include NPM dependencies
  • run the service in the debug mode and test it using the Backendless console
  • deploy the service to Backendless

The service you will develop in this guide will provide APIs for controlling a LIFX wi-fi enabled light bulb. This very service is used in the article describing how to integrate Amazon Alexa with an IoT device using Backendless. This article references IntelliJ IDEA as the IDE, however, it is not required, you can use any code editor. Make sure to create a Backendless account and create an app in Backendless Cloud (the free tier or the trial option will be plenty to proceed).

Continue reading

Codeless Programming is a general approach for creating programs without writing any code. When combined with the power of the Backendess mBaaS, Codeless becomes a powerful and super-efficient tool. In this post, I will describe how to use Codeless to create a custom Amazon Alexa skill. In the first part, you will develop a basic Alexa skill which replies with a static greeting to a voice command. The second post will delve into a more complex implementation.

You can see a demo of what you will build over the course of both posts in the video below:

Continue reading

Backendless 4 is a powerful platform that can instantly turn your JS code into an API service. Every declared method (unless it is excluded) gets a dedicated API endpoint accessible via REST and native libraries, which Backendless automatically generates for you. As a developer, you can easily specify what the REST route must look like for every method and you can define the schema for the arguments.

Generated services can be used for multiple purposes. For example, they make it very easy to centralize the business logic for your Backendless app. IoT apps can use the services as the integration points.

Backendless Console gives you a test drive for invoking the services and inspecting requests and responses. Best of all the service code can be written and deployed right from the console. Check out the video below for an overview of Backendless API Services written in JS:

The service code shown in the video is:

Enjoy!

Find us in facebook