Development Tip: Internationalisation In AngularJS Apps With Angular Translate

angular-translate

Internationalisation is one of the must have feature when building global reach mobile apps. An Angular Translate module can be really helpful in translating your app UI. It can be included into an Appery.io app in a few quick steps:

  • Go to the Angular Translate page and download the latest release bundle. Inside this bundle you’ll find angular-translate.min.js file – the one that you need to upload.
  • Open your AngularJS Appery.io app, click CREATE NEW > JavaScript. Type angular-translate.min for the name and select Upload from file, and browse for this file on your PC. Also, change its Type to Angular module, check the Use shim check box and finally, type pascalprecht.translate for Shim exports: input. Click Create JavaScript once the file will be uploaded.
  • Now, another module should be created. It will be responsible for the Angular Translate configuration. Perform CREATE NEW > JavaScript, type AngularTranslate for the name, and choose Angular module for Type. Click Create JavaScript.
  • You’ll see an Angular module template and a lot of commented configuring options. First, this module requires pascalprecht.translate as dependency, so add it  to square brackets. Here is how it should look:
    var module = angular.module('AngularTranslate', ['pascalprecht.translate']);
  • Configuration logic should be added to the module.config function. Here is how your whole module should look when the configuration logic has been added:
    define(['require', 'angular'], function(require, angular) {
        
        var module = angular.module('AngularTranslate', ['pascalprecht.translate']);
        
        module.config(
            
            ["$translateProvider", function($translateProvider) {
                $translateProvider.translations('en', {
                    TITLE: 'Hello',
                    FOO: 'This is a paragraph.',
                    BUTTON_LANG_EN: 'english',
                    BUTTON_LANG_DE: 'german'
                });
                $translateProvider.translations('de', {
                    TITLE: 'Hallo',
                    FOO: 'Dies ist ein Paragraph.',
                    BUTTON_LANG_EN: 'englisch',
                    BUTTON_LANG_DE: 'deutsch'
                });
                $translateProvider.preferredLanguage('en');
            });
        
    }]);
  • The last step is to create a simple UI and check the translation engine. Go to any page in your app, place a Button on the page and provide {{ 'TITLE' | translate }} for its Text property. Launch the app!
  • If you see Hello on the button – you’re done.

One option is to customise the translation mechanism to initiate the language based on the browser or device language. For example, you can get the browser or device language like this:

$translateProvider.determinePreferredLanguage();

Try Ionic app backup with Angular Translate included if you facing some issues.

Read more Angular Translate possibilities in its docs, and make sure you check out all of our mobile development tips.

Do you want to build apps fast? Start developing with our trial plan!

Development Tip: Design Faster with New Copy and Paste Functions Inside the Visual App Builder

apperyio_context_menu

Component context menu

When building a mobile app in the Appery.io visual App Builder it’s very common to place the same component in multiple places. Before, you had to drag each component separately, now there is a simpler and faster to do this with our new copy and paste capabilities.

AngularJS projects in Appery.io use the standard copy and paste functionality that you are familiar with, plus you can clone (duplicate) a component. This means that you can copy your component via a context menu or hotkey (CTRL+C), and paste it even into a different AngularJS project! In order to open the context menu, select any component and click the cog icon.

You can find more information about UI components in Appery.io in our documentation, and make sure you check out all of our mobile development tips.

Do you want to build apps fast? Start developing with our trial plan!

Big Update: New Enterprise Components in API Express, Upgraded Push Notifications, New Ionic Version and More

This is our second major platform update in 2016, we are excited to share our new features and benefits to help you build enterprise apps fast.

New enterprise components in API Express

There are two new features of our API Express, these new service components are for creating advanced service logic using the visual builder. Our new features to API express are:  Script and ServerCode. Both components allow you to write custom service logic using JavaScript.

Screen Shot 2016-03-18 at 4.39.34 PM

API Express visual editor enterprise components

  • ServerCode component – allows call Server Code scripts from the API Express. This will be beneficial if your app relies on some server-side logic that is written as a Server Code script. Read more about this component here.
  • Script component – can be used for changing the body structure before passing the data to another component. Find more on Script component in documentation.

Read the rest of this entry »

Learn How to Copy and Reuse Pages Between Apps for Faster Development

Today we will show you how to copy pages into Appery.io projects. This very simple process is described in our documentation, but we are going to show you how to build apps faster by copying and re-using pages. 

First create a new app and add some components to the page which you would like to clone.

1

Page we want to clone

Read the rest of this entry »

What Does It Mean To Be “Mobile” In Your Organisation?

“Going mobile” is more than just having a website—it means a whole load of things. It’s about reaching and engaging with your members in a new way, and offering your members a different way to receive information; making information accessible at any time and in any place.

While a website may provide information for your members, you also want to have a way to get your members talking to each other and joining in events and activities. We are in a society where we are constantly looking for up-to-date information, mobile apps provide us with this and our phones are within reach at all times. There are numerous angles your non-profit can take when it comes to creating a mobile app, some opt for informational such as The Red Cross, which provides weather alerts to help citizens better prepare for potential natural disasters. But, for your non-profit organisation, being mobile can mean any of the following things:

  • Mobile Web—optimising your website, content, and donation forms for mobile devices.
  • Mobile messaging— increasing your communication with your members, co-workers, and donors via text messages.
  • Online donations/text-to-give—providing a way for your members to donate through their mobile devices via a mobile optimised online donation form or website, or by texting a donation directly to your organisation.
  • Mobile Apps—creating your own customised application for your members to download to their smartphones or tablets for easy access.

Read the rest of this entry »

Development Tip: Using The Bootstrap Grid In Appery.io

grid

Popular Bootstrap Grid is available in Appery.io’s Bootstrap project as an UI component that can be dragged and dropped to the page. The following steps show how to change grid cell sizes for different screen resolutions:

  1. First open the AngularJS / Bootstrap project and place the Grid component to the page.
  2. Now, if you will look at top right corner of the grid you’ll see a green plus button, this button will add a new row to your grid. If you don’t need to add a new row, but want to add new cells to existing row click on one of the grid cells and then choose GridRow through the breadcrumbs:
    new_cell
  3. A green “+” sign now will add a new cell to an existing row.
  4. You can configure the size for each cell for the four screen sizes. Click on the grid cell and the expand Columns properties in the PROPERTIES to the right of the screen. Type a number from 1 to 12 to define how it will look on the screen:
    cell_sizes

Don’t forget that you can emulate page size directly inside the editor, and when testing the app in browser by clicking XS, SM, MD and LG buttons.

Make sure to check out all of our mobile development tips.

Do you want to build apps fast? Start developing with our trial plan!

Looking To The Future – What Is 5G?

150518144020-5g-wireless-table-780x439

It doesn’t seem that long ago when the first 4G smartphone hit the market, yet the wireless industry is already preparing for 5G. As each of the four worldwide mobile phone carriers are getting ready to bring us 5G, smart phone chipmakers, and major network equipment companies are joining the race to provide their customers with the “ultra-fast” 5G network.

However there are numerous hurdles which the industry will have to jump over before we will be seeing the 5G symbol on our smartphones any time soon. The reasoning for this? It has yet to be decided what 5G even means, let alone what it will look like when it finally arrives. What we do know is that 5G will soon become a necessity.

Read the rest of this entry »

Development Tip: Validating Forms in AngularJS Projects

validation

Validating inputs in mobile is very popular. Thanks to AngularJS, it can be quickly completed in one simple and convenient form. In the following example, you will learn how to create a required Input via ng-required directive, and how to resolve this issue in case the Input is not filled (show a message and disable the button):

  1. First of all, there is a model with the following structure:
    • user (Object)
      • name (String)
  2. In the scope, there is a user variable type of user (based on model described in step 1)
  3. init function of the scope has a single line of code:
    $scope.user.name = 'Joe';
  4. On the page, there is a HTML component with a Container property = form (there is no such option in a dropdown so simply type it).
  5. Next add name property and set its value to myForm.
  6. Inside the HTML component, there are Input and Text components.
  7. Set the Input components to the following properties:
    • ng-model = user.name
    • name = userName
    • ng-required = true
  8. For the text component set it to the following:
    • Color = assertive
    • text = Required (or any text you want)
    • ng-show = myForm.userName.$error.required
  9. And finally, place the button below the HTML, and add a ng-disabled property with myForm.userName.$error.required value.

If you try to remove text from the input you will see that button becomes disabled, and a Required message will appear. This way you can produce more complex validations according to your needs. You can see how the example above is built by creating an app from this backup.

Make sure to check out all of our mobile development tips.

Do you want to build apps fast? Start developing with our trial plan!

Development Tip: Adding Custom Logic to REST API Invocation

editing_mapping

This blog post shows how to add a custom logic to a REST API invocation for jQuery Mobile apps.

You may often need to modify data for a services request or a services response. You may want to launch a dedicated JavaScript function to do this. This is useful when you need to rewrite the response data with filtered/edited values, instead of doing this each time for each mapping. For example, your service response has an unneeded first value that you want to remove from the response:

  1. Add new Run JavaScript action for Success event of your datasource.
  2. Using the drag and drop, move this action to the very beginning, so the Mapping action will be right to the Run JavaScript. This way, it’s guaranteed that the JavaScript code will be executed before the mapping.
  3. Click on Run JavaScript action and write your code. You have a data parameter in this JavaScript function – that is your response value.
  4. Write your custom logic to modify the response data. For example, to remove the first item of the response array (works only for arrays, not for JSON objects) use the following code:
    data.splice(0, 1);

Read more about Mapping in jQuery Mobile projects here and make sure to check out all of our mobile development tips.

Do you want to build apps fast? Start developing with our trial plan!

Development Tip: Quick Android App Debugging On The Device With Chrome

chrome-debuggingDebugging your JavaScript apps that are made with Appery.io can be performed in a several ways, but today we would like to share with you another method. This approach has been available before, but for a some reason not many people know about it. The flow is looks really simple:

  1. Connect the device to a PC with a cable.
  2. Export the Appery.io app as an Android binary (.apk).
  3. Scan the QR code to install the app.
  4. Launch Chrome and open the app on the device.
  5. That’s all! Now you have a really quick debugging tool to test your app with.

You should do a few steps to makes it work, but luckily they are not complicated and you can be ready-to-go in a few minutes.  A detailed guide about this feature and how to set it up you can found here.

Read more about the testing and debugging options here and make sure to check out all of our mobile development tips.

Do you want to build apps fast? Start developing with our trial plan!