Message:

  • Home
  • Articles by: markpiller

Author Archives

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

mudasar 150x150 - Case study: a young entrepreneur discovers Backendless and a builds a social network for gamersHappy New Year, everyone!

Here at Backendless we hear a lot of cool and interesting stories about people using our technology to build awesome things. Every now and then we come across some truly inspiring ones. Here is a story of Mudasar Javed, a 16 year old developer from Australia who launched a social network app for gamers. It was quite exciting to learn about his path of learning about programming and how Backendless could help him with getting the app off the ground.

Click below to read the case study:

https://backendless.com/platform/ra1n-entertainment-case-study/

Posted in Case Study

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

This is Part 2 of the article about developing an Amazon Alexa skill without any coding. In Part 1 you learned the following:

  • How to create a Codeless API Service responsible for handling Amazon Alexa requests. The service completely removes the need for adding AWS Lambda functions, it also runs without any cost in the free plan of Backendless.
  • How to create a Codeless custom function which composes a response back to Alexa.
  • How to create a basic Alexa Skill and test it from the Amazon developer console.
  • How to invoke the skill on Alexa, process the invocation in your Codeless Backendless API service and get a response back on Alexa.

In this part of the article, you will learn the following:

  • Creating voice interaction model with “slots” – special placeholders for the “dynamic” parts of the requests for your skill
  • Processing slots in the Codeless API service in Backendless.
  • Executing codeless logic to do something useful and generate a meaningful response.

It is recommended (more like required) to go through Part 1 just so you have the basic environment setup. Also, make sure to watch the “Developing an Alexa Skill without any coding” video which shows the entire process in action.

Continue reading
Posted in Alexa, Codeless

backendless pro v4 - Backendless Pro version 4 is released

Backendless Pro, the standalone version of Backendless, is now officially released and is available for download. The new release includes the latest version of the Backendless Platform. Version 4, which was originally launched only for the Backendless Cloud product is a major improvement over the previous version.

The version 4 release includes:

  • Completely redesigned Backendless Console;
  • Support for both Java and JavaScript business logic;
  • Codeless Programming;
  • Significantly improved data querying capabilities;
  • Redesigned code generators;

The new Backendless Pro includes a free trial mode. See the Backendless Pro product page for details.

Performing a calculation on a group of database objects may be a complex task. For example, to calculate the sum of all orders for a customer would require retrieving all customer’s orders, iterating over them to calculate the mathematical sum of all amounts. This was yesterday! As of Backendless 4.4.0, you can use aggregate functions to calculate the average, sum, maximum and minimum values for a collection of objects without retrieving them from the server. Additionally, the system supports calculating object count for all records in the database or a record subset.

To use an aggregate function, simply request a property in a data retrieval request in the following format (the example below is for calculating the sum for the orderAmount  column):

The returned object includes the sum  property with the calculated value:

The name of the property can be modified by assigning an alias (using %20  to replace the spaces in the URL):

The result contains a value for the property named after the alias:

Grouping Results

Results can be grouped by a column. The column could be either in the same table or a related one. For example, the following request retrieves the sum of all orders grouped by related country:

Unlike the response above, the result for this query includes a collection of objects, each containing the sum for a related country:

It is also possible to apply a filter on the grouped values. This can be done using the having  clause. For example, the request below retrieves only the groups of countries where the total order amount is greater than 10000:

For more information about aggregate functions see the Backendless API documentation:

As we have announced earlier, we have discontinued the free plan in 3.x. We have written about it on our blog as well email newsletters. If your application was on the free plan in Backendless 3.x, you can either migrate it to Backendless 4 (which has a free plan and that is not going anywhere) or you can choose to upgrade the pricing plan in Backendless 3.x. To upgrade the pricing plan in 3.x, you need to:

  1. Login to Backendless console (https://develop.backendless.com/3.x) and select your app.
  2. Click the Manage icon and then select Billing.
  3. Add a credit card and then select a billing plan. Once a plan is selected, the API calls for the app will be automatically unblocked.

If you have any questions, please contact us on the support forum.

Posted in Status Update

Backendless Push Notifications are getting a much-needed facelift. Today, with the release of version 4.3.0 you will start noticing some improvements. Specifically, you will see the  DeviceRegistration data table:

devicereg table - Rethinking Device Registrations for Push Notifications

Continue reading

Backendless supports two approaches for saving data objects in the database: class-based approach and map/dictionary approach. With the class approach, you declare a class, instances of which represent individual objects stored in the database. With the introduction of Swift 4, it is important to add a new attribute to your Swift 4 classes. For example:

Notice the @objcMembers  attribute declaration in the class. The attribute allows Backendless SDK (which is written in Objective-C) to access object’s property values. If you do not add the attribute, objects retrieved from the server will not have properties initialized with the values.

It is also possible to set a project-wide configuration property. When you do that, you do not need to add @objcMembers  attribute, however, you will see warnings when the project is built. To set the project property, open “Build Settings” for the project target, locate “Swift 3 @objc inference” and set it to “On”.

swift3 prop inference - Declaring data classes in Swift 4

For additional information on the @objcMembers attribute, see the “inheriting from Objective-C Classes” section in the Swift 4 programming guide.

 

 

Posted in iOS

Data retrieval in Backendless has gotten significantly more powerful with the release of version 4.2.0. We added support for subquery into the syntax of whereClause . The improvement allows your apps to run two queries in the context of one request. The first query identifies a set of objects which is fed into the second query. Consider the following data schema:

users blogpost comment - Announcing Subqueries - advanced data retrieval from Backendless mBaaS Database

Suppose your app needs to get all blog posts where the person who posted a comment has a specific email address (say @backendless.com ). Using subqueries, it can be done with the following whereClause sent to the BlogPost table:

Let’s review how this whereClause is processed by Backendless:

  1. Backendless detects that the query at the top level uses the in()  operator.
  2. It checks if the contents of the  in()  operator have the format of a subquery and if so, evaluates it accordingly.
  3. The subquery contains an “internal whereClause”, which is:
    author.email LIKE '%@backendless.com'
    The internal whereClause is applied to the objects in the Comment table.
  4. For all found  Comment objects, Backendless gets a list of values for the blogPost.objectId column.
  5. The resulting set is fed into the  in()  operator which fetches the final set of objects from the  BlogPost table.

General SubQuery Syntax

The general syntax for subqueries is:

How it works:

  1. If internalWhereClause  is present, it is executed in the table identified by TableName.
  2. In the resulting set of records, values must be selected for the column identified by columnOrRelatedColumnName.optionalColumnName.
  3. If internalWhereClause is not present, the contents of the IN operator have the following syntax. It represents the entire set of values identified by the specified column: TableName.columnOrRelatedColumnName.optionalColumnName 
  4. The resulting set of values is used in the  IN operator, thus the final query ends up being:
    searchColumnOrRelatedColumnName IN ( value1, value2,, valueN ) 

Additional Examples

Consider the following data schema:

customer order items - Announcing Subqueries - advanced data retrieval from Backendless mBaaS Database

  1. Get all OrderItem  objects for a customer from New York :
    objectId in (Order[customer.address = 'New York'].items.objectId)
  2. Get all Customer  objects who spent more than 1.99 on an item:
    objectId in (Order[items.itemPrice > 1.99].customer.objectId )

Please let us know if you can think of additional examples you would like us to demonstrate.

Enjoy!