SlideShare une entreprise Scribd logo
1  sur  23
Arief Bayu Purwanto
       R&D App Manager
         PT. Integra ASP.
http://about.me/ariefbayu
 JavaScript on both Client and Server code
 Server Code using Node.js API
 Server Storage using Redis.io
 Client code using proprietary API
 Project-dir
  • controller/ => javascript untuk setiap page
  • res/ => semua resources aplikasi (gambar, music, etc)
  • views/ => definisi setiap page, berupa .json
  • backend.js => berisi kode2 server
  • bootstrap.js => kode yang dijalankan pertama kali
  • metadata.json => detail informasi aplikasi


   Satu controller HARUS ada 1 pasangan views:
         -controller/main.js
         -views/main.json
 Handle       client methods:
  var _ = require('common/util');

  _.extend(exports, {
     ':load': function() { console.log('View was loaded'); },

    ':resized': function(width, height) {
          console.log('View was resized to ' + width + 'x' + height);
    },

    ':keydown': function(key) { console.log('Key down: '+ key); },

    ':keyup': function(key) { console.log('Key up: ' + key); },

    ':keypress': function(key) { console.log('Key press: ' + key); },

    ':active': function() { console.log('View is active'); },

     ':inactive': function() { console.log('View is inactive'); }
  });
Linear Layout
 var LinearLayout = require('ui').LinearLayout;

 new LinearLayout(
     {
         style:{ orientation: orientationDefinition }
     }
 );                orientationDefinition: horizontal // vertical


  Class turunan:
  * Hlayout => LinearLayout.orientation = “vertical”
  * Vlayout => LinearLayout.orientation = “horizontal”
Cell Layout
 var CellLayout = require('ui').CellLayout;

 new CellLayout(
     {
         columns: columnCount,
         cellSize:
             {
                 width: theWidth,
                 height: theHeight
             }
         }
     }
 );
Panel Layout
 var Panels = require('ui/panels').Panels;

 var p = new Panels();

 p.add('first', 'firstView');
 p.add('second', 'secondView');
TextView
 var TextView = require(‘ui’).TextView;

 new TextView();

 new TextView(
     {
         label: theLabel
     }
 );
TextInput
 var InputBox = require(‘ui’).InputBox;

 new InputBox();

 new InputBox(
     {
         constraint: theConstraint,
         label: theLabel,
         'multi-line': flag
     }                        Constraint: normal // password
 );                           „multi-line‟: true // false
ImageView
 var ImageView = require('ui').ImageView;

 var ui = require('ui');
 var ImageView = ui.ImageView;

 new ImageView();
 new ImageView({
     src: srcUrl,                     Load: direct // lazy
     load: loadStrategy,              retain: true // false
     retain: shouldRetain
 });
      src => for images in res/
      resource => for images from outside.
         Need companion app.setResourceHandler() on backend.js
SceneView
 var SceneView = require(‘ui’).SceneView;
 var scene = new SceneView();
 scene.setLayers();
 sceneView.defineSpritesheet('anim',
     app.imageURL('anim.png'), 25, 25);
 scene.add(
     {
         sprite: 'anim',
         x: 100, y: 100,
         layer: 0, frame: 0
     }
 );
app.setResourceHandler:
app.setResourceHandler(function(request, response) {
      function sendReply(response, error, imageType, data) {
          if (error) {
              app.warn('Failed to load image: ' + error);
              response.failed();
          } else {
              app.debug('Loaded image.');
              response.reply(imageType, data);
          }
      }
      scaling.scale(request.id, 120, 120, 'image/jpeg',
          function(err, data) {
              sendReply(response, err, 'image/jpeg', data);
      });
});
Step one: client send command to server
 Client:
 app.msg(‘commandMessage', {parameter});
 Server:
  app.message(
      function(client, action, param){
          if(action === ‘commandMessage’){
               //Do whatever you want
          }
      }
  );
Step two: server send back result to client
 Server:
    app.message(
        function(client, action, param){
            if(action === ‘commandMessage’){
                client.msg( action, { parameter } );
            }
        }
    );
   Client (on „:load‟ handler):
    app.on(‘commandMessage',
      function(action, param)
      {
        //do whatever you want with returning parameter
      });
 Initialize   Storage Variable:
  var storage = app.storage('storage-name');
 Get Stored Data:
  var data = storage.get('object-name');
 Set Stored Data:
  storage.set('object-name', daa);
   Initialize Storage Variable:
    var storage = require('blaast/simple-data');
   Get Stored Data:
    storage.get(key, function(err, value) {
        if (value && value.data) {
            self.data = value.data;
        } else {
            //failed to get server storage
        }
    });
 Set    Stored Data:
    storage.set(key, data, function(err, oldData) {
        if (err) {
            //failed to set server storage
        } else {
            //server storage successfully stored
        }
    });
   Removing Stored Data:
    storage.remove(key);
 client.id=> unique device id
 client.user.id => name of currently logged in user
 app.realtime()
  app.realtime(function(client, event) {
    if (event === 'CONNECTED') {
      clients[client.id] = client;
      clients[client.user.id] = client;
    } else if (event === 'DISCONNECTED') {
      delete clients[client.id];
      delete clients[client.user.id];
    }
  });
 app.user.id   => name currently logged in user
Pengenalan blaast platform sdk

Contenu connexe

Tendances

Angular js routing options
Angular js routing optionsAngular js routing options
Angular js routing optionsNir Kaufman
 
Big Data for each one of us
Big Data for each one of usBig Data for each one of us
Big Data for each one of usOSCON Byrum
 
Upgrading from Angular 1.x to Angular 2.x
Upgrading from Angular 1.x to Angular 2.xUpgrading from Angular 1.x to Angular 2.x
Upgrading from Angular 1.x to Angular 2.xEyal Vardi
 
jQuery and Rails, Sitting in a Tree
jQuery and Rails, Sitting in a TreejQuery and Rails, Sitting in a Tree
jQuery and Rails, Sitting in a Treeadamlogic
 
Advanced jQuery
Advanced jQueryAdvanced jQuery
Advanced jQuerysergioafp
 
WordCamp Montreal 2015: Combining Custom Post Types, Fields, and Meta Boxes t...
WordCamp Montreal 2015: Combining Custom Post Types, Fields, and Meta Boxes t...WordCamp Montreal 2015: Combining Custom Post Types, Fields, and Meta Boxes t...
WordCamp Montreal 2015: Combining Custom Post Types, Fields, and Meta Boxes t...allilevine
 
How I started to love design patterns
How I started to love design patternsHow I started to love design patterns
How I started to love design patternsSamuel ROZE
 
AngularJS Compile Process
AngularJS Compile ProcessAngularJS Compile Process
AngularJS Compile ProcessEyal Vardi
 
Introduction to CQRS and Event Sourcing
Introduction to CQRS and Event SourcingIntroduction to CQRS and Event Sourcing
Introduction to CQRS and Event SourcingSamuel ROZE
 
(PHPers Wrocław #5) How to write valuable unit test?
(PHPers Wrocław #5) How to write valuable unit test?(PHPers Wrocław #5) How to write valuable unit test?
(PHPers Wrocław #5) How to write valuable unit test?RST Software Masters
 
Symfony CoP: Form component
Symfony CoP: Form componentSymfony CoP: Form component
Symfony CoP: Form componentSamuel ROZE
 
Knockoutjs UG meeting presentation
Knockoutjs UG meeting presentationKnockoutjs UG meeting presentation
Knockoutjs UG meeting presentationValdis Iljuconoks
 
Angular 1.x vs. Angular 2.x
Angular 1.x vs. Angular 2.xAngular 1.x vs. Angular 2.x
Angular 1.x vs. Angular 2.xEyal Vardi
 
AngularJS $http Interceptors (Explanation and Examples)
AngularJS $http Interceptors (Explanation and Examples)AngularJS $http Interceptors (Explanation and Examples)
AngularJS $http Interceptors (Explanation and Examples)Brian Swartzfager
 
Magento Dependency Injection
Magento Dependency InjectionMagento Dependency Injection
Magento Dependency InjectionAnton Kril
 
AngularJS Directives
AngularJS DirectivesAngularJS Directives
AngularJS DirectivesEyal Vardi
 
Template syntax in Angular 2.0
Template syntax in Angular 2.0Template syntax in Angular 2.0
Template syntax in Angular 2.0Eyal Vardi
 

Tendances (20)

Angular js routing options
Angular js routing optionsAngular js routing options
Angular js routing options
 
Big Data for each one of us
Big Data for each one of usBig Data for each one of us
Big Data for each one of us
 
Upgrading from Angular 1.x to Angular 2.x
Upgrading from Angular 1.x to Angular 2.xUpgrading from Angular 1.x to Angular 2.x
Upgrading from Angular 1.x to Angular 2.x
 
jQuery and Rails, Sitting in a Tree
jQuery and Rails, Sitting in a TreejQuery and Rails, Sitting in a Tree
jQuery and Rails, Sitting in a Tree
 
Advanced jQuery
Advanced jQueryAdvanced jQuery
Advanced jQuery
 
WordCamp Montreal 2015: Combining Custom Post Types, Fields, and Meta Boxes t...
WordCamp Montreal 2015: Combining Custom Post Types, Fields, and Meta Boxes t...WordCamp Montreal 2015: Combining Custom Post Types, Fields, and Meta Boxes t...
WordCamp Montreal 2015: Combining Custom Post Types, Fields, and Meta Boxes t...
 
How I started to love design patterns
How I started to love design patternsHow I started to love design patterns
How I started to love design patterns
 
AngularJS Compile Process
AngularJS Compile ProcessAngularJS Compile Process
AngularJS Compile Process
 
Introduction to CQRS and Event Sourcing
Introduction to CQRS and Event SourcingIntroduction to CQRS and Event Sourcing
Introduction to CQRS and Event Sourcing
 
Bacbkone js
Bacbkone jsBacbkone js
Bacbkone js
 
Javascript - Beyond-jQuery
Javascript - Beyond-jQueryJavascript - Beyond-jQuery
Javascript - Beyond-jQuery
 
(PHPers Wrocław #5) How to write valuable unit test?
(PHPers Wrocław #5) How to write valuable unit test?(PHPers Wrocław #5) How to write valuable unit test?
(PHPers Wrocław #5) How to write valuable unit test?
 
Symfony CoP: Form component
Symfony CoP: Form componentSymfony CoP: Form component
Symfony CoP: Form component
 
Knockoutjs UG meeting presentation
Knockoutjs UG meeting presentationKnockoutjs UG meeting presentation
Knockoutjs UG meeting presentation
 
Sane Async Patterns
Sane Async PatternsSane Async Patterns
Sane Async Patterns
 
Angular 1.x vs. Angular 2.x
Angular 1.x vs. Angular 2.xAngular 1.x vs. Angular 2.x
Angular 1.x vs. Angular 2.x
 
AngularJS $http Interceptors (Explanation and Examples)
AngularJS $http Interceptors (Explanation and Examples)AngularJS $http Interceptors (Explanation and Examples)
AngularJS $http Interceptors (Explanation and Examples)
 
Magento Dependency Injection
Magento Dependency InjectionMagento Dependency Injection
Magento Dependency Injection
 
AngularJS Directives
AngularJS DirectivesAngularJS Directives
AngularJS Directives
 
Template syntax in Angular 2.0
Template syntax in Angular 2.0Template syntax in Angular 2.0
Template syntax in Angular 2.0
 

En vedette

A little bit of my family & i
A little bit of my family & iA little bit of my family & i
A little bit of my family & iDTurnerBanks
 
mMobile Unli Call To All Networks and Business Opportunity
mMobile Unli Call To All Networks and Business OpportunitymMobile Unli Call To All Networks and Business Opportunity
mMobile Unli Call To All Networks and Business OpportunityJimuel Jedi Dancel
 
Vmobile presentation fritz dec 2011 (www.vmobileelite.com)
Vmobile presentation fritz dec 2011 (www.vmobileelite.com)Vmobile presentation fritz dec 2011 (www.vmobileelite.com)
Vmobile presentation fritz dec 2011 (www.vmobileelite.com)Kathleen Cañada
 
IOSN ASEAN+3 Promoting Free and Open Source Software in the ASEAN Region
IOSN ASEAN+3 Promoting Free and Open Source Software in the ASEAN RegionIOSN ASEAN+3 Promoting Free and Open Source Software in the ASEAN Region
IOSN ASEAN+3 Promoting Free and Open Source Software in the ASEAN RegionAriel Betan
 
팟캐스트
팟캐스트팟캐스트
팟캐스트q Park
 

En vedette (7)

A little bit of my family & i
A little bit of my family & iA little bit of my family & i
A little bit of my family & i
 
mMobile Unli Call To All Networks and Business Opportunity
mMobile Unli Call To All Networks and Business OpportunitymMobile Unli Call To All Networks and Business Opportunity
mMobile Unli Call To All Networks and Business Opportunity
 
Vmobile presentation fritz dec 2011 (www.vmobileelite.com)
Vmobile presentation fritz dec 2011 (www.vmobileelite.com)Vmobile presentation fritz dec 2011 (www.vmobileelite.com)
Vmobile presentation fritz dec 2011 (www.vmobileelite.com)
 
Windows Mobile Training
Windows Mobile TrainingWindows Mobile Training
Windows Mobile Training
 
Thesis
ThesisThesis
Thesis
 
IOSN ASEAN+3 Promoting Free and Open Source Software in the ASEAN Region
IOSN ASEAN+3 Promoting Free and Open Source Software in the ASEAN RegionIOSN ASEAN+3 Promoting Free and Open Source Software in the ASEAN Region
IOSN ASEAN+3 Promoting Free and Open Source Software in the ASEAN Region
 
팟캐스트
팟캐스트팟캐스트
팟캐스트
 

Similaire à Pengenalan blaast platform sdk

node.js and the AR.Drone: building a real-time dashboard using socket.io
node.js and the AR.Drone: building a real-time dashboard using socket.ionode.js and the AR.Drone: building a real-time dashboard using socket.io
node.js and the AR.Drone: building a real-time dashboard using socket.ioSteven Beeckman
 
前端MVC 豆瓣说
前端MVC 豆瓣说前端MVC 豆瓣说
前端MVC 豆瓣说Ting Lv
 
Stop Making Excuses and Start Testing Your JavaScript
Stop Making Excuses and Start Testing Your JavaScriptStop Making Excuses and Start Testing Your JavaScript
Stop Making Excuses and Start Testing Your JavaScriptRyan Anklam
 
Dpilot Source Code With ScreenShots
Dpilot Source Code With ScreenShots Dpilot Source Code With ScreenShots
Dpilot Source Code With ScreenShots DeepAnshu Sharma
 
Dpilot - Source Code with Snapshots
Dpilot - Source Code with SnapshotsDpilot - Source Code with Snapshots
Dpilot - Source Code with SnapshotsKritika Phulli
 
Source Code for Dpilot
Source Code for Dpilot Source Code for Dpilot
Source Code for Dpilot Nidhi Chauhan
 
Understanding backbonejs
Understanding backbonejsUnderstanding backbonejs
Understanding backbonejsNick Lee
 
Bonnes pratiques de développement avec Node js
Bonnes pratiques de développement avec Node jsBonnes pratiques de développement avec Node js
Bonnes pratiques de développement avec Node jsFrancois Zaninotto
 
Creating the interfaces of the future with the APIs of today
Creating the interfaces of the future with the APIs of todayCreating the interfaces of the future with the APIs of today
Creating the interfaces of the future with the APIs of todaygerbille
 
Silex meets SOAP & REST
Silex meets SOAP & RESTSilex meets SOAP & REST
Silex meets SOAP & RESTHugo Hamon
 
JavaScript para Graficos y Visualizacion de Datos
JavaScript para Graficos y Visualizacion de DatosJavaScript para Graficos y Visualizacion de Datos
JavaScript para Graficos y Visualizacion de Datosphilogb
 
JavaScript para Graficos y Visualizacion de Datos - BogotaJS
JavaScript para Graficos y Visualizacion de Datos - BogotaJSJavaScript para Graficos y Visualizacion de Datos - BogotaJS
JavaScript para Graficos y Visualizacion de Datos - BogotaJSphilogb
 
WordPress Realtime - WordCamp São Paulo 2015
WordPress Realtime - WordCamp São Paulo 2015WordPress Realtime - WordCamp São Paulo 2015
WordPress Realtime - WordCamp São Paulo 2015Fernando Daciuk
 
Virtual Madness @ Etsy
Virtual Madness @ EtsyVirtual Madness @ Etsy
Virtual Madness @ EtsyNishan Subedi
 
Developing web-apps like it's 2013
Developing web-apps like it's 2013Developing web-apps like it's 2013
Developing web-apps like it's 2013Laurent_VB
 
SenchaTouch 2 and Sencha.io
SenchaTouch 2 and Sencha.ioSenchaTouch 2 and Sencha.io
SenchaTouch 2 and Sencha.ioNils Dehl
 

Similaire à Pengenalan blaast platform sdk (20)

Express JS
Express JSExpress JS
Express JS
 
node.js and the AR.Drone: building a real-time dashboard using socket.io
node.js and the AR.Drone: building a real-time dashboard using socket.ionode.js and the AR.Drone: building a real-time dashboard using socket.io
node.js and the AR.Drone: building a real-time dashboard using socket.io
 
前端MVC 豆瓣说
前端MVC 豆瓣说前端MVC 豆瓣说
前端MVC 豆瓣说
 
Stop Making Excuses and Start Testing Your JavaScript
Stop Making Excuses and Start Testing Your JavaScriptStop Making Excuses and Start Testing Your JavaScript
Stop Making Excuses and Start Testing Your JavaScript
 
Dpilot Source Code With ScreenShots
Dpilot Source Code With ScreenShots Dpilot Source Code With ScreenShots
Dpilot Source Code With ScreenShots
 
Dpilot - Source Code with Snapshots
Dpilot - Source Code with SnapshotsDpilot - Source Code with Snapshots
Dpilot - Source Code with Snapshots
 
Source Code for Dpilot
Source Code for Dpilot Source Code for Dpilot
Source Code for Dpilot
 
Understanding backbonejs
Understanding backbonejsUnderstanding backbonejs
Understanding backbonejs
 
Bonnes pratiques de développement avec Node js
Bonnes pratiques de développement avec Node jsBonnes pratiques de développement avec Node js
Bonnes pratiques de développement avec Node js
 
Reduxing like a pro
Reduxing like a proReduxing like a pro
Reduxing like a pro
 
Creating the interfaces of the future with the APIs of today
Creating the interfaces of the future with the APIs of todayCreating the interfaces of the future with the APIs of today
Creating the interfaces of the future with the APIs of today
 
Silex meets SOAP & REST
Silex meets SOAP & RESTSilex meets SOAP & REST
Silex meets SOAP & REST
 
Rails is not just Ruby
Rails is not just RubyRails is not just Ruby
Rails is not just Ruby
 
JavaScript para Graficos y Visualizacion de Datos
JavaScript para Graficos y Visualizacion de DatosJavaScript para Graficos y Visualizacion de Datos
JavaScript para Graficos y Visualizacion de Datos
 
JavaScript para Graficos y Visualizacion de Datos - BogotaJS
JavaScript para Graficos y Visualizacion de Datos - BogotaJSJavaScript para Graficos y Visualizacion de Datos - BogotaJS
JavaScript para Graficos y Visualizacion de Datos - BogotaJS
 
WordPress Realtime - WordCamp São Paulo 2015
WordPress Realtime - WordCamp São Paulo 2015WordPress Realtime - WordCamp São Paulo 2015
WordPress Realtime - WordCamp São Paulo 2015
 
Virtual Madness @ Etsy
Virtual Madness @ EtsyVirtual Madness @ Etsy
Virtual Madness @ Etsy
 
Developing web-apps like it's 2013
Developing web-apps like it's 2013Developing web-apps like it's 2013
Developing web-apps like it's 2013
 
SenchaTouch 2 and Sencha.io
SenchaTouch 2 and Sencha.ioSenchaTouch 2 and Sencha.io
SenchaTouch 2 and Sencha.io
 
Angular Workshop_Sarajevo2
Angular Workshop_Sarajevo2Angular Workshop_Sarajevo2
Angular Workshop_Sarajevo2
 

Dernier

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 

Dernier (20)

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 

Pengenalan blaast platform sdk

  • 1. Arief Bayu Purwanto R&D App Manager PT. Integra ASP. http://about.me/ariefbayu
  • 2.  JavaScript on both Client and Server code  Server Code using Node.js API  Server Storage using Redis.io  Client code using proprietary API
  • 3.  Project-dir • controller/ => javascript untuk setiap page • res/ => semua resources aplikasi (gambar, music, etc) • views/ => definisi setiap page, berupa .json • backend.js => berisi kode2 server • bootstrap.js => kode yang dijalankan pertama kali • metadata.json => detail informasi aplikasi Satu controller HARUS ada 1 pasangan views: -controller/main.js -views/main.json
  • 4.  Handle client methods: var _ = require('common/util'); _.extend(exports, { ':load': function() { console.log('View was loaded'); }, ':resized': function(width, height) { console.log('View was resized to ' + width + 'x' + height); }, ':keydown': function(key) { console.log('Key down: '+ key); }, ':keyup': function(key) { console.log('Key up: ' + key); }, ':keypress': function(key) { console.log('Key press: ' + key); }, ':active': function() { console.log('View is active'); }, ':inactive': function() { console.log('View is inactive'); } });
  • 5.
  • 6. Linear Layout var LinearLayout = require('ui').LinearLayout; new LinearLayout( { style:{ orientation: orientationDefinition } } ); orientationDefinition: horizontal // vertical Class turunan: * Hlayout => LinearLayout.orientation = “vertical” * Vlayout => LinearLayout.orientation = “horizontal”
  • 7. Cell Layout var CellLayout = require('ui').CellLayout; new CellLayout( { columns: columnCount, cellSize: { width: theWidth, height: theHeight } } } );
  • 8. Panel Layout var Panels = require('ui/panels').Panels; var p = new Panels(); p.add('first', 'firstView'); p.add('second', 'secondView');
  • 9. TextView var TextView = require(‘ui’).TextView; new TextView(); new TextView( { label: theLabel } );
  • 10. TextInput var InputBox = require(‘ui’).InputBox; new InputBox(); new InputBox( { constraint: theConstraint, label: theLabel, 'multi-line': flag } Constraint: normal // password ); „multi-line‟: true // false
  • 11. ImageView var ImageView = require('ui').ImageView; var ui = require('ui'); var ImageView = ui.ImageView; new ImageView(); new ImageView({ src: srcUrl, Load: direct // lazy load: loadStrategy, retain: true // false retain: shouldRetain }); src => for images in res/ resource => for images from outside. Need companion app.setResourceHandler() on backend.js
  • 12. SceneView var SceneView = require(‘ui’).SceneView; var scene = new SceneView(); scene.setLayers(); sceneView.defineSpritesheet('anim', app.imageURL('anim.png'), 25, 25); scene.add( { sprite: 'anim', x: 100, y: 100, layer: 0, frame: 0 } );
  • 13.
  • 14. app.setResourceHandler: app.setResourceHandler(function(request, response) { function sendReply(response, error, imageType, data) { if (error) { app.warn('Failed to load image: ' + error); response.failed(); } else { app.debug('Loaded image.'); response.reply(imageType, data); } } scaling.scale(request.id, 120, 120, 'image/jpeg', function(err, data) { sendReply(response, err, 'image/jpeg', data); }); });
  • 15. Step one: client send command to server  Client: app.msg(‘commandMessage', {parameter});  Server: app.message( function(client, action, param){ if(action === ‘commandMessage’){ //Do whatever you want } } );
  • 16. Step two: server send back result to client  Server: app.message( function(client, action, param){ if(action === ‘commandMessage’){ client.msg( action, { parameter } ); } } );  Client (on „:load‟ handler): app.on(‘commandMessage', function(action, param) { //do whatever you want with returning parameter });
  • 17.
  • 18.  Initialize Storage Variable: var storage = app.storage('storage-name');  Get Stored Data: var data = storage.get('object-name');  Set Stored Data: storage.set('object-name', daa);
  • 19. Initialize Storage Variable: var storage = require('blaast/simple-data');  Get Stored Data: storage.get(key, function(err, value) { if (value && value.data) { self.data = value.data; } else { //failed to get server storage } });  Set Stored Data: storage.set(key, data, function(err, oldData) { if (err) { //failed to set server storage } else { //server storage successfully stored } });  Removing Stored Data: storage.remove(key);
  • 20.
  • 21.  client.id=> unique device id  client.user.id => name of currently logged in user  app.realtime() app.realtime(function(client, event) { if (event === 'CONNECTED') { clients[client.id] = client; clients[client.user.id] = client; } else if (event === 'DISCONNECTED') { delete clients[client.id]; delete clients[client.user.id]; } });
  • 22.  app.user.id => name currently logged in user