Running the File Browser Example
To build and run the file browsing example, follow these steps:
1. Start Android Studio and when the Welcome to Android Studio window opens, select Import project. Alternatively, if you already have a project open, select New... > Import project.
2. If prompted, select android-file-browser, and then select Gradle project to import.
3. If you have already imported another ThingWorx project, continue to step 5. If you are importing a ThingWorx project for the first time, in the Import Project screen:
a. If given the option, choose to use the gradlew command that is provided with the ThingWorx Edge Android SDK.
b. Leave the default setting for Project format (.idea).
c. Click Finish.
4. If prompted, use gradlew, which is provided in the examples directory.
5. During this process, you may be asked to install or choose an Android SDK version. This project targets Android SDK 5.1, also called API 22. The project should import cleanly and be ready to use.
6. In ThingWorx Composer, import the Entity file, examples/android-file-browser/entity/Android_Browser_Entities.xml. As a result, in Composer, you should see a TestFileRepository and the AndroidRemoteRepository thing that this example requires.
7. In Android Studio, select Run > android-file-browser to start the application.
8. In the application, choose the Launch Emulator option and click the ellipsis button (...).
9. Select the Create Virtual Device button on the bottom of the next window.
10. Choose a device from the list. If given the option, choose an x86 device over an ARM device to get better performance, If you do not have any x86 choices, consider clicking the Show downloadable images button to find one. The file browsing application should start in the simulator.
11. If the application is starting for the first time, the settings page appears. You must provide the following information:
A URI of the form ws://hostname:8080/Thingworx/WS for HTTP access.
A URI of the form wss://hostname:443/Thingworx/WS for HTTPS access.
An Application Key (appKey) that has been generated on your ThingWorx platform in the Application Keys section.
* 
You can also build the application from the command line, as explained in Building an Example Project from the Command Line.
Was this helpful?