Message:

Android (21 posts)

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:

If you’re starting an Android project with Backendless and import our SDK library from Maven, please pay attention to the version number of the library. We have published a beta version of the 4.0 SDK into Maven central. When referencing Backendless in Android Studio, version 4 is the default one to popup. Unless you’re building with Backendless version 4 (which will be the default backend in the Cloud very soon), make sure to reference version 3.0.25 of the library as shown in the screenshots below:

Continue reading

google signin backendless - Google Sign in for your Backendless AppWe supported Google Sign in for a while, however, the feature was not properly documented. Not anymore )) The documentation has been updated for Android and iOS SDKs. Using the “Login with Google” function, an app can provide a way for the users to login using their Google credentials. Once a user is authenticated, Backendless creates an internal account and starts a logged-in session.

See Backendless documentation for details:

Android SDK

iOS SDK

The recording of the “Push Notifications” webinar which we conducted earlier this month is now available in our YouTube channel. You watch the webinar below or on the Webinars page on our website. In the webinar we reviewed the process of setting up an Android and an iOS apps as well as the backend to be able to register device and receive push notifications.

We conducted a webinar titled “Backendless Core Concepts” for ex-Parses last week. A recording of the webinar is now available. The video should be helpful not only if you’re coming from Parse, but for anyone who is starting their journey with Backendless. The webinar reviewed the concepts of Backendless User and Data services. Specifically, we focused on:

  • user properties
  • setting up user relations
  • registering a user
  • registering a user with custom properties
  • configuring a data model
  • code-driven schema creation
  • data relations
  • a brief overview of Cloud Code

In my previous post I reviewed the user registration API. Now that you know how to use the registration API and have a registered user, the next step is to review the login functionality. The video below focuses on the apps’ login screen and the Backendless Login API.

In the video below I review the code for the User Registration screen of the RestaurantToGo sample app. Additionally, I discuss the usage of the Backendless Registration API. In the previous post and video, I reviewed the process of setting up the development environment for the application.

Whether you develop with IntelliJ IDEA, Eclipse or Android Studio, the Backendless library (jar) for Java/Android must be referenced as a dependency. The library includes all the APIs which provide access to the backend functionality. The library is deployed to the centralized Maven repository which makes it trivial to import it to any Backendless-powered app. Below are the instructions for referencing it in Android Studio:

Continue reading

Earlier this year I wrote about building a sample to demonstrate various APIs of the platform. There is also a post describing the database schema and app’s storyboard. The application is now ready and I will be posting a video tutorial detailing every step of building an app, including the following:

  1. Development environment setup
  2. User registration screen and API
  3. Login screen and API
  4. Using Backendless code generation for Android
  5. Retrieving and displaying data (listing of restaurants, locations and menus)
  6. Order summary and order confirmation

At the end of the tutorial, you will know how to build a data-driven app with Backendless, how to use the User Service APIs (registration, login, email confirmation), with with the relational persistent data, use Backendless console to manage data objects.

Below is an introductory video where you can see the complete app in action.

Posted in Android, Examples

The feature 2 in this series (registering app users using Backendless API) talks about how to create user accounts. If your application uses the user registration API, odds are you will need to use the Login API as well. The API is rather trivial – it requires two parameters: a value which uniquely identifies the user and his password.

Continue reading