Skip to content

Instantly share code, notes, and snippets.

@lbrenman
lbrenman / MyUser.js
Last active November 27, 2017 23:10
Appcelerator Arrow Two Factor Authentication
var Arrow = require("arrow");
var Model = Arrow.createModel("MyUser",{
"fields": {
"username": {
"type": "String",
"required": true
},
"password": {
"type": "String",
@lbrenman
lbrenman / README.md
Last active June 3, 2016 17:11
Appcelerator Arrow - Encrypt Data in Transit

Arrow Encryption for Data in Transit

Appcelerator mobile applications use Secure Sockets Layer (SSL) for encrypting and decrypting all data transmitted and received by the device. However, for certain applications, one may want to add another layer of encryption for added security. This post describes how to programmatically add additional encryption for data in transit between an Appcelerator application and an ArrowDB as illustrated below.

Background

The basic idea is to add a pre block to your Arrow model for decrypting data on a POST or PUT from the client app. This will decrypt data sent by the client app. Also, add a post block for encrypting data being sent to the client app on a GET.

@lbrenman
lbrenman / blogpost.md
Last active December 21, 2015 15:20
Arrow SOAP Connector Simple Example

Arrow SOAP Connector Demo

SOAP (Simple Object Access Protocol) is a messaging protocol that allows programs that run on disparate operating systems to communicate using Hypertext Transfer Protocol (HTTP) and its Extensible Markup Language (XML). Even though REST web services are growing in popularity, if you are building a mobile application that connects to Enterprise Data sources most likely that data is exposed as a SOAP web service. Arrow's SOAP connector makes it very easy to expose SOAP services as mobile optimized REST API's that mobile devices prefer.

This blog post is a short demonstration of the Arrow SOAP Connector. You can find information about the connector at software.appcelerator.com.

For this demo, we will use the CDYNE SOAP Weather Service. The WSDL for this service can be found here:

[http://wsf.cdyne.com/WeatherWS/Weather.asmx?wsdl](http://wsf.cd

@lbrenman
lbrenman / README.md
Last active March 15, 2017 16:28
Arrow Web Scraping Example using x-ray

Arrow Web Scraping

Web scraping is technique of extracting information from websites. For mobile applications, it should be considered a last resort. Instead try to get access to the inderlying data via a documented REST web service API.

However, you may find that an REST or SOAP API is not available and you may need to web scrape in order to get the web site data into your mobile application.

If you are going web scrape, then don't do it in the mobile app. Instead, use a microservices platform, like Arrow. By implementing the screen scraping in an Arrow middle tier server, then when the web site changes, you can change your scraping algorithm without needing to publish a new mobile application.

This blog post will show a simple example of using Arrow Builder to build an API that utilizes web scraping.

@lbrenman
lbrenman / MyAccount.js
Last active October 14, 2015 04:02
Arrow Basic (Server Assisted) Sync Example - Custom API With error reporting, Block for setting dates on POST
var Arrow = require("arrow");
var Model = Arrow.createModel("MyAccount",{
"fields": {
"name": {
"type": "String",
"required": true
},
"type": {
"type": "String"
@lbrenman
lbrenman / readme.md
Last active August 4, 2016 17:11
Appcelerator Arrow - Connecting to Multiple Instances of the Same Back End Data Source

Arrow - Connecting to Multiple Instances of the Same Back End Data Source Type

Arrow makes it extremely easy to connect to various back end data sources through Appcelerator provided connectors, such as REST, SOAP, Salesforce, MySQL and MS SQL and expose mobile optimized REST APIs. A complete list of connectors can be found here. One can also build their own connector following the instructions here.

Simply install a connector into your Arrow project, edit the connector configuration file and you are ready to go.

But, what if you want to connect to multiple instances of the same data source type. For example, what if you have two MySQL databases that you want to create mobile optimized web services for. Well, Arrow makes that easy too.

Install the Base Connector

@lbrenman
lbrenman / queryArrayExample.md
Created September 2, 2015 15:54
Appcelerator Arrow - How to query data that contains an array of elements

#Appcelerator PDF Viewer Demo

Viewing a PDF file in a mobile application is a fairly common use case. However, how you do this on Android and iOS are very different. iOS has a built-in document viewer capability so you can view the PDF in your application. On Android, you open the PDF file in an external application that has support for PDF viewing. This blog post demonstrates how to view a PDF file downloaded from the web and a PDF file stored as an application resource.

The following links to the Appcelerator online documentation will be useful as background information:

  1. Filesystem Access and Storage
  2. Titanium.UI.iOS.DocumentViewer
  3. Android Intents
@lbrenman
lbrenman / README.md
Created July 22, 2015 21:21
Appcelerator PDF Viewer Demo
@lbrenman
lbrenman / README.md
Created July 22, 2015 02:26
Appcelerator Titanium PDF Viewer Demo 2 - If not already copied, then retrieve PDF from resource directory and store in file system and view

#PDF Viewer demo - Application Resource

  1. For Android check if PDF has been copied to SDCard
  2. if not, then copy to SDCard and open
  • use docviewer on ios and exernal app (via intent) on android
  1. if so, then open pdf
  • use docviewer on ios and exernal app (via intent) on android

Note that Android, the file is stored in the externalStorageDirectory (SDCard) so deleting the application will not remove the pdf form the SDCard. Use a File Manager app (pn Android) to delete the file