Tips for Using the Sample Applications
Here are some tips for using the sample applications:
If you build with Gradle, use the provided gradlew or gradlew.bat files instead of the Gradle that may be installed on your system.
The sample projects are based on API 22 of the Google Android SDK. If you do not have v.5.1 (API 22) of the Android SDK, Android Studio notifies you that it is missing and displays a dialog box where you can select to install it. Install it.
If you have an Android phone and want to deploy to it, attach it to your computer using a USB cable. The phone must be placed into developer mode. These instructions vary by phone. The page, Using Hardware Devices, on the Android Developers site, may provide a good starting point for enabling developer mode.
The log output level for the ThingWorx Edge Android SDK ships set at ERROR. You can change this log level to DEBUG or TRACE to get as much detailed information as possible in your log output. Note that increasing your log level will have a significant effect on your application's perfromace so remember to reset your log level to error before deploying your application. Logged information is displayed in your Android Monitor tab in Android Studio. This setting is intended to help a new developer to get started. To change your current logging level, edit your logback.xml configuration file, which is located in the directory, examples/android-steam-thing/src/main/assets/ of the ThingWorx Android SDK installation.
Proxy servers are now supported. Refer to Proxy Server Support for Android.
All sample Android applications provided with the Java SDK have a preference settings like the one shown here:
If the Use Proxy Server setting is set, the proxy preferences below are used.
* 
The SteamSensor example now requires named arguments. The table below describes them.
SteamSensor Preferences Settings
Argument
Description
-c <arg>
Count, the number of steam sensors to create.
-d
Disable HTTPS error checking
-f
Force the user of HTTPS on the selected port.
-g <arg>
Gateway Name. If not given, no gateway is created.
-h <arg>
Host name of the ThingWorx Platform
-j <arg>
Proxy Host Name. If not provided, no proxy is used.
-k <arg>
The application key used to authenticate with the ThingWorx Platform.
-l <arg>
The logging level. One of the following::
1=TRACE
2=DEBUG
3=INFO
4=WARM
5=ERROR
6=FORCE
7=AUDIT
-n <arg>
The Thing Name defaults to SteaamSensor.
-p <arg>
The port used by the ThingWorx Platform. The default port is 8080.
-q <arg>
The password for the proxy server. This argument is optional.
-r <arg>
The port for the proxy server. This argument is optional.
-u <arg>
The user name for the proxy server. This argument is optional.
Was this helpful?