Wednesday, June 13, 2012

Niagara Ax App short cut on Android

App Inventor for Android is an application originally provided by Google and now maintained by the Massachusetts Institute of Technology.It is a free app that can be downloaded at http://beta.appinventor.mit.edu

Part of App Inventor runs on the web (the Designer) and part of it on your local computers (the Blocks Editor).Before you continue:
  1. Log onto the App Inventor website.
  2. Obtain and installing Java.
  3. Download and install the part of App Inventor that runs locally.
  4. Run the Emulator (a cute but fake virtual smartphone on your local computer for testing apps).
  5. Find and download device drivers (for your phone or other Android device).
  6. Configuring your device to work with App Inventor.
Once you set up your working environment—that is, you have an App Inventor account, Java and the local part of Google App Inventor on your local machine, and either an emulator (virtual Android device) or your phone connected via USB cable—you are ready to begin.

  1. Click My Projects, then the New button and create a new project.This will be the name of  the application, there can not be any spaces or special characters other than an under score in this name.I have named my project NiagaraAx 
  2. Click on the name of your project to open it in designer view.
  3. From the Components pane select Screen 1.Then in the Properties pane click in the Icon dialog box to upload the icon for your application.Your icon needs to be a png image that is 72px by 72px.
  4. At the bottom of the Properties pane is Title click on the dialog box and type Niagara Ax Launcher to give the app screen a title.
  5. From the palette under Screen Arrangement drag three Vertical Arrangement component onto screen 1 , placing component two and three in side component one. In the Component panel select each of the Screen Arrangement  objects and set the width properties to Fill parent.
  6. In the Palette panel under Basic drag a Label object onto Screen 1 placing it inside Screen Arrangement two .With the Label object selected in the properties set the text property to LOADING...\nInternet connection
  7. From the Palette under Basic drag a Clock object onto Screen1
  8. From the Palette under Other stuff drag a ActivityStarter object onto Screen1.In the Components panel select ActivityStarter and then in the Properties column for the ActivityStarter, put android.intent.action.VIEW in the Action field ( this is how your app calls the phone's web browser, and the way it's entered is case-sensitive).
Okay: now the Blocks Editor
    We need only one small block group. Everything is in the Clock1.Timer block to connect to the site and then, job done, gracefully exit.

     

  1. Inside the clock timer frame, we put four blocks, which accomplish the following logic:
  2. In our ActivityStarter1.DataUri goes the web address of the Jace website login: http://jaceIp
  3. The ActivityStarter1.StartActivity block calls the phone's web browser and passes the address to it.
  4.  Clock1.TimerAlwaysFires set to false tells AI, "Stop, don't do anything else."
Finally, the close application block (which we should always be nice and include somewhere in our apps) removes the app from the phone or other Android device's memory, releasing those always scarce resources.
Testing Niagara Ax Launcher app with emulator shot 1
Testing Niagara Ax Launcher app with emulator shot 2

Testing Niagara Ax Launcher app with emulator shot 3


notes for YouTube video @  LearnNiagaraAx and building-smarter.com 
released date for video 6/25/2012

Tuesday, June 12, 2012

Niagara Ax: How to increase workbench client request timeout


When a Niagara workbench is connected to a remote supervisor, chances are there when client makes a request to the server, requests will be timed out after 1 minute or 60 seconds, because the server was taking more than 60 seconds to service the request.

Although Tridium will not encourage this, but we can increase the time out for clients in certain known scenarios. The file to be changed is %NIAGARA_HOME%/lib/system.properties
?#UnComment the line below and provide a new value instead of 60000
niagara.fox.requestTimeout=60000