Message:

Android (29 posts)

Register and Login with Google Code Generation App

Today we are going to walk you through the process of allowing users to register and log into your app using their Google account. The best way to showcase this is to walk though the Registration and Login example app available in the Code Generation section of your Backendless Console.

Continue reading
Posted in Android, Examples

Using Asynchronous Callbacks with Java/Android

From time to time, we see some developers struggle with understanding the principles of asynchronous work with Backendless. In this post we’ll try to shed more light on this aspect: describe what async calls are, why you need them and how to properly perform such calls and process the results. This post will be specific to Java and Android, but most of the principles apply to any language and environment.

Continue reading

How to Enable Push Notifications in a React Native Android App

React Native helps you build a real native mobile application using JavaScript (for more information about React Native, you can check out the documentation on Github here). The Backendless JavaScript SDK (JS-SDK) already has full compatibility with React Native – just install it from NPM, require in your code, and go. But since the release of Backendless 5.2.x, having only the JS-SDK is not enough to access all the Backendless features; in some cases, we need to have access to native modules for working with certain features such as Push Notifications. We’ve therefore decided to create another module on JS for using exactly in a React Native environment. It’s a patch of sorts for JS-SDK.

In this article series, I’m going to show you how to use this additional JS module. There are will be a total of 3 articles:

  • How to enable Push Notifications using Backendless in a React Native App (Android)
  • How to enable Push Notifications using Backendless in a React Native App (iOS) (coming soon)
  • How to customize Push Notifications using Backendless (coming soon)

Today, we get started with creating a simple Android application on React Native for receiving Push Notifications. Alright, let’s do it.

Continue reading

Dropsource is an online platform for developing Android and iOS applications without coding. The platform also lets you download the source code for your app so you can make any changes to it and subsequently publish into the app store (note: downloading the source code is a paid option). If you’re looking to add support for push notifications to your Dropsource apps, Backendless fits right in with a relatively simple integration. When you add Backendless Push Notifications, you can instantly benefit from the following features:

  • Personalized push notification content – each recipient of your push notifications can see customized content.
  • Programmable action buttons with support for inline replies.
  • Customizable images and icons in the payload and rendering of push notifications.
  • Automatic push notification cancellation – self-destructed notifications.
  • Dynamic audience targeting – the audience of the published notifications can be customized with a query.

The video below includes a demonstration of an Android Dropsource app integrated with Backendless Push Notifications followed by a detailed overview of the actual integration process. The integration instructions are outlined in detail in this post following the video.

Continue reading

We are happy to announce the new release of Backendless, version 5.2.0. The new release delivers completely redesigned support for push notifications. With the new release you can create highly visual, dynamic and interactive push notifications for Android and iOS devices. The content in the notifications can be personalized for each individual user, you can greet the users of your apps by name, provide content and information in the context of user’s location or any other related user properties. You can configure your push notifications to include sounds, images, configurable buttons (with inline reply) and custom vibration patterns. You can easily schedule push notifications to be delivered automatically, alternatively you can send them out with Backendless console or using the API. The video below provides an overview and a demo of the new functionality:

Development of mobile applications generally requires two parts: the Backend and the Frontend.  Of course, you could limit it only to the client-side, but if there is some data which must be stored on the server, there is no way to get around having a backend. In this series of articles, you will create a native mobile client-server application – a basic ToDo app. Backendless will take care of the backend, it gives you everything you might expecting from the server-side (user management, data persistence and scalability to name a few). And for the client side you will use the Dropsource service.  In case if you are not familiar with this service, you can learn more about that from their website, but in short, it is an awesome service which lets you build native mobile apps without any coding. At the end of this series, your will have a native mobile application with the User Registration/Login screen, a screen with a listing of the ToDo items and a screen to create a new ToDo Item. Here’s a brief preview of the app along with real-time changes in the Backendless database:
todo-demo-codeless

Let’s go!

Continue reading
Posted in Android, Codeless, iOS

What does  “mobile-to-web cross login with a QR code” mean ? It is one of the approaches for the two-factor authentication. Suppose that a user is already authenticated in your application (in my example it would be an android app) and the user wants to use it’s actual session to perform an automatic authentication in another application (in my case it’s a web app). There are several examples of popular apps which use this approach. For example, to login into a web session with WhatsАpp, you must login on your phone and then scan a QR code in the web interface.login-with-qr1

Continue reading

Since Backendless does not have native APIs to download files, today we’ll talk about how to implement this function in your Android application. In order to do that, we’ll need to combine Backendless file listing API and android.app.DownloadManager. There are several alternatives to this approach, but the selected one requires less code to write and has a well-thought structure.

Once a developer uploads files to the Backendless Files system, each file gets a public URL which can either be obtained using the Backendless Console or calculated using the following URL scheme:


publicURLThis public URI is the full path to the file in your Backendless file system. Directory listing API returns a list of the  FileInfo objects representing the files located in the directory, where each element in the collection contains the following properties:
Continue reading

All available APIs for creating, updating and deleting objects in the Backendless database operate on single objects. It means when you need to store multiple objects in the database, each object requires a separate API call. This increases the number of API calls your app makes. While it is great for us (hey, our billing is based on the API calls), it is not that great for your app as it results in longer processing times and substandard user experience. Starting today, with the release of Backendless version 4.5.0 we’re introducing the new APIs which will allow you to create, update or delete multiple objects with a single API call.

Bulk Create

Saving multiple new objects in the database is now as simple as passing an array of objects to the server. The server responds with a collection of objectId values (which, for example, can be used in the createRelation  API). The bulk create API is supported in all SDKs as well as the REST interface.

Bulk Update

To update objects in the database, the API accepts a condition (where clause) which identifies a group of objects. In addition to the condition, the client must also provide an object containing the changes which should be applies to the selected objects.

Bulk Delete

Similar to “Bulk Update”, this API receives a condition which identifies a group of objects to be deleted.

All of the APIs can be extended using custom business logic’s before/after events.

You can find the documentation for these APIs in the developer guides:

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:

Find us in facebook