Message:

Java (4 posts)

Easy Web Services with Backendless

Have you ever wondered why is it often so tedious so make your simple Java app a web server, with the methods becoming the endpoints? You need to add libraries, write additional “web” wrappers, set up a server and a hosting, configure load balancing and much, much more. Do you really have to go through all these things when you just want this piece of code be available via the Web so that others can invoke it and get some fancy results?

The good news is that nowadays this is much less of a problem: with services like Backendless, it is easy to transform your custom code into a real REST service available via both REST and JS/iOS/Android/Java APIs. If needed, authentication also comes available out-of-the-box. It is worth noting that this is all for no charge except for the number of API services you may have and the number of API calls you’ll make to the service in a month.

In this article, we’ll show you how to make your HelloWorld app really say Hello to the whole World.

Continue reading

Low Priority Tasks in JS and Java CodeRunner

Today we are going to talk about a very valuable feature available for Managed Backendless and Backendless PRO users called Low Priority Tasks. In this article, we’ll look at how it works and what is it best used for.

Backendless custom business logic (custom event handlers and custom API services) tasks are put into a single queue and executed by a dedicated service called CodeRunner. In Backendless Cloud, these tasks do not have any kind of priority and are executed according to the task’s position in the queue. But there are cases when the CodeRunner queue is spammed with “heavy” requests which take 10 or even 20 seconds to execute, i.e. getting hundreds or even thousands of records with multiple relations, utility requests to delete thousands outdated records in a table, etc.

Continue reading

Today we are going to demonstrate how to create a simple event handler to track subscriber statistics on your various messaging channels. This gives you the ability to easily track the number of subscribers for each of your channels to help you manage channel load and gauge user interest in specific topics. Used in combination with API usage tracking, you will have a great sense of what your users are doing within your app.

Tracking Messaging Subscribers

To start, we will create a new application and call it Messaging_Statistics.

Continue reading
Posted in Examples, Java, Messaging

How to Use Code Generation to Work with Backendless Data

In Java, entity objects are classes that represent data from your table. From an object-oriented perspective, these objects are built to encapsulate your data in the real-world problem domain. There are two different ways you can work with entity objects:

  • Using the HashMap approach (like plain representation of column names and their values);
  • Using the data binding approach, where the particular type is used for every table.

The first approach is more flexible, but it doesn’t offer security for the type values. Also, it’s possible to make a mistake setting the data. It also requires you to remember the names of the columns. 

The second approach is much more appealing in terms of the readability and understandability of the code. It also offers type safety.

The main drawback here is the necessity to write data binding objects (or entity objects if you prefer) that will represent the particular table. And what if you have a very large number of tables in your application, and every table consists of many columns? The amount of such tedious work could be significant. But don’t fret, Backendless is already doing it for you!

Continue reading
Find us in facebook