Skip to content

Instantly share code, notes, and snippets.

View stephenquan's full-sized avatar

Stephen Quan stephenquan

View GitHub Profile
@stephenquan
stephenquan / appstudio-networkrequest-sample.qml
Last active March 23, 2018 05:27
appstudio-networkrequest-sample.qml
import QtQuick 2.7
import QtQuick.Layouts 1.3
import QtQuick.Controls 2.1
import ArcGIS.AppFramework 1.0
import ArcGIS.AppFramework.Networking 1.0
App {
id: app
width: 640
height: 480
@stephenquan
stephenquan / appstudio-sqldatabase-sample.qml
Created March 28, 2018 20:57
appstudio-sqldatabase-sample.qml
// This sample demonstrates creation, populating and querying a SQLite database.
// When run, a TextArea component, displays cities retrieved from the database:
//
// Melbourne, Australia - 4.2M - (-37.9717, 144.773)
// London, UK - 8788.0M - (51.5288, -0.24168)
// Paris, France - 2.2M - (48.859, 2.27702)
// New York City, USA - 8538.0M - (40.6977, -74.1198)
// Tokyo, Japan - 13.6M - (35.6735, 139.57)
import QtQuick 2.9
@stephenquan
stephenquan / appstudio-sqlquerymodel-sample.qml
Last active February 8, 2019 01:28
appstudio-sqlquerymodel-sample.qml
// This sample demonstrates creation, populating and querying a SQLite database.
// When run the TableView component is populated with a data from a join between
// Cities and Demographics.
//
// Melbourne, Australia, 4186000, -37.9716929, 144.7729583
// London, UK, 878000000, 51.5287718, -0.2416804
// Paris, France, 2241000, 48.8589507, 2.2770205
// New York City, USA, 8538000000, 40.6976637, -74.1197639
// Tokyo, Japan, 136170000, 35.6735408, 139.5703047
@stephenquan
stephenquan / appstudio-sqldatabase-drivername-sample.qml
Last active April 5, 2018 03:59
appstudio-sqldatabase-drivername-sample.qml
// This sample demonstrates connecting to a variety of different databases using SqlDatabase.
// It makes use of Sql.availableDrivers and SqlDatabase.driverName to present you a list of database types.
// QSQLITE is supported on all platforms (Android, iOS, Windows, macOS, linux)
// QODBC works best on Windows, but, somewhat difficult to work on macOS and Linux.
// QPSQL works best on macOS, but, somewhat difficult to work on Windows and Linux.
// QMYSQL should work okay on Windows, macOS and Linux.
import QtQuick 2.7
import QtQuick.Controls 2.1
import QtQuick.Layouts 1.3
@stephenquan
stephenquan / appstudio-sqlindex-sample.qml
Last active April 5, 2018 01:16
appstudio-sqlindex-sample.qml
// This sample demonstrates how we can programmatically extract the primary key and indexes for a table.
import QtQuick 2.7
import QtQuick.Controls 2.1
import QtQuick.Layouts 1.3
import ArcGIS.AppFramework 1.0
import ArcGIS.AppFramework.Sql 1.0
Item {
TextArea {
@stephenquan
stephenquan / appstudio-devices-sample.qml
Last active April 9, 2018 21:24
appstudio-devices-sample.qml
import QtQuick 2.7
import QtQuick.Layouts 1.3
import QtQuick.Controls 2.1
import ArcGIS.AppFramework.Devices 1.0
Item {
property DeviceListModel deviceListModel: discoveryAgent.devices
property Device currentDevice
ColumnLayout {
@stephenquan
stephenquan / appstudio-nmeasource-sample.qml
Last active April 6, 2018 04:10
appstudio-nmeasource-sample.qml
import QtQuick 2.7
import QtQuick.Layouts 1.3
import QtQuick.Controls 2.1
import ArcGIS.AppFramework.Devices 1.0
import ArcGIS.AppFramework.Positioning 1.0
Item {
property DeviceListModel deviceListModel: discoveryAgent.devices
property Device currentDevice
@stephenquan
stephenquan / appstudio-positionsource-sample.qml
Last active April 6, 2018 05:35
appstudio-positionsource-sample.qml
import QtQuick 2.7
import QtQuick.Layouts 1.3
import QtQuick.Controls 2.1
import ArcGIS.AppFramework.Devices 1.0
import ArcGIS.AppFramework.Positioning 1.0
Item {
property DeviceListModel deviceListModel: discoveryAgent.devices
property Device currentDevice
property Position currentPosition
@stephenquan
stephenquan / hockget.sh
Created April 10, 2018 04:41
hockget.sh
#!/bin/bash
currentDir="$(pwd)"
scriptsDir="$(cd $(dirname $0); pwd)"
datestamp=$(date +%Y%m%d)
function showUsage {
cat <<+
HockInstall.sh -name Name of app
-appId HockeyApp App Id
@stephenquan
stephenquan / appstudio-datasource-senddata-sample.qml
Created April 11, 2018 03:04
appstudio-datasource-senddata-sample.qml
import QtQuick 2.7
import QtQuick.Layouts 1.3
import QtQuick.Controls 2.1
import ArcGIS.AppFramework.Devices 1.0
Item {
property DeviceListModel deviceListModel: discoveryAgent.devices
property Device currentDevice
ColumnLayout {