domingo, 15 de outubro de 2017

Frameworks to mobile development

You can have a team with iOS and Android developers to your apps, that is more expensive or you can use frameworks where you write once and compile to the desired platform.

To this kind the frameworks can be separated in other two types: hybrid mobile and native mobile.

Hybrid Mobile 
These frameworks use web technologies (HTML, CSS, JS) creating a layer before to render the app called web view that is essentially a web browser.
Ionic has a great integration with AngularJS or Angular+ making sense be used by Angular developers.
These frameworks are interesting when you already have a web app and need create mobile apps quickly with equal layout and features.

Native
NativeScript uses Angular+React Native uses React JS and Xamarin uses C#.
These frameworks do not render in web view and do not use HTML, can be use other web technologies such as: CSS, JS, Typescript.

Conclusion
Today new browsers implement some or all features of the HTML5 such as: web notification, camera, file system. Perhaps your app can be a web app instead mobile app, but of course that have a mobile app is a plus.

If hybrid app is the case, IMHO "reading" the market seems that Ionic make more sense.

Otherwise, depends of your expertise, in my specific case due my experience with AngularJS and Angular+NativeScript seems make sense but looking around seems React Native is more used. If my query is correct Google Trends proves my insight. And if you is a .NET developer Xamarin make more sense.


terça-feira, 10 de outubro de 2017

Java Opportunity - HCL São Leopoldo

CLT
Design, build, and maintain efficient, reusable, and reliable Java code
Proficient in Java, with a good knowledge of its ecosystems
Solid understanding of object-oriented programming
Familiar with various design and architectural patterns
Skill for writing reusable Java libraries
Knowledge of concurrency patterns in Java
Familiarity with concepts of MVC, JDBC, 
Identify bottlenecks and bugs, and devise solutions to these problems.
Experience with Agile methodology
Good communication skills
Portuguese speaker with fluency in English

send your resume with wage claim to: amanda.m@hcl.com


sábado, 30 de setembro de 2017

CSS Margin does not work equal in all browsers in some cases

I normally use firefox for development, and in a recent issue I used margin-top and ok but in safari and Google Chrome I not get the same layout. Normally margin works fine in all browsers.

I did not find the pattern for this situation but the solution is use the equivalent to margin attribute used. In my case margin-top and -webkit-margin-before was used to compensate the difference.


sexta-feira, 29 de setembro de 2017

sexta-feira, 22 de setembro de 2017

Focus and move cursor in Angular

HTML5 brings the autofocus attribute to the input tag.
This attribute works fine when the page is loaded the first time, but in some moments is necessary put the focus in runtime, e.g. after a validation.

In AngularJS I use the code below (unfortunately I did not save the link from where I copied it to thank):

function cursorToEnd(input) {
    input.focus();

    // If this function exists...
    if (input.setSelectionRange) {
        // ... then use it (Doesn't work in IE)
        // Double the length because Opera is inconsistent about whether a carriage return is one character or two. Sigh.
        var len = $(input).val().length * 2;

        input.setSelectionRange(len, len);
    } else {
        // ... otherwise replace the contents with itself
        // (Doesn't work in Google Chrome)
        $(input).val($(input).val());
    }

    // Scroll to the bottom, in case we're in a tall textarea
    // (Necessary for Firefox and Google Chrome)
    input.scrollTop = 999999;        
}

function focus(jQueryObject) {
    setTimeout(function() {
        cursorToEnd(jQueryObject);
    }, 500);
};

In my apps using Angular 4 I rewrite it to:

  cursorToEnd(input: ElementRef) {
    input.nativeElement.focus();

    if (input.nativeElement.setSelectionRange) {
      const len = input.nativeElement.value.length * 2;
      input.nativeElement.setSelectionRange(len, len);
    }

    input.nativeElement.scrollTop = 999999;
  }

  focus(input: ElementRef) {
      setTimeout(() => this.cursorToEnd(input), 300);
  }


Fast tip: App builded with Angular 4 does not works with Internet Explorer

This is because you need to import js files additional.
To work, check the polyfills.ts file and uncomment the required lines.


quinta-feira, 17 de agosto de 2017

AngularJSExample

I created a project using AngularJS and Bootstrap to present to customers the productivity it.

No is necessary server side. 

The project is like public in my GitLab's account: https://gitlab.com/fabio_silva/AngularJSExample

The idea is build the same project using jQuery and other with Angular 4.

The project is in portuguese. Is noted the idea to prepared it to internationalisation.