Creating a mobile app with BuildServer (remote generation)
IoTize provides two different ways to generate mobile apps:
either remotely, using the IoTize BuildServer. For beginners, we strongly recommend using this solution that requires to install on your computer IoTize Studio only. This guide describes how to use the BuildServer soution.
or locally, after having installed the required tools on your computer. We provide a command line interface tool to help you generate IoTize apps. It can be used from a command interpreter or within IoTize Studio. For using the 'local generator' please refer to the dedicated guide.
The main advantage of using the BuildServer solution is to avoid the multiple installation of the CLI, its depencies, Android Studio:
- Buildserver can generate a complete project that you can download (in order to modify or to complete it manually).
- Buildserver can build the project and generate an APK version (debug mode) of the generated project (Android app).
- Buildserver does NOT allow to generate an IPA for iOS. However, the project could be downloaded to be built locally within Xcode (see the guide for the local generation).
NOTE: The present information concerns both TapNLink AND TapNPass
Install the latest version of IoTize Studio available from the IoTize website.
Note that the remote generation is available by the version 2.1.17+ of IoTize Studio.
You need also to create a personal account on the IoTize Buildserver Webapp and to sign in.
Once you created your account, you need to register at least one TapNLink (or TapNPass):
- Click on the 'menu' icon located on the upper left corner,
- Click on + REGISTER A DEVICE NOW
To register a device (either TapNLink or TapNpass), you need to enter its serial number and its unique Product key. This information is contained into your TapNLink (even after a factory reset). There are three ways to read it:
- Connect to your Tap from the current web page and read the requested information automatically. At the moment, this way is ONLY possible:
- with BLE if you are using CHROME as browser on a Windows10 or Mac computer that features a BLE transceiver.
- with MQTT (note that the initial settings of the Primers in 'Access Point mode' do not provide any MQTT access).
- Connect with the mobile app "Tap Manager" and find the information in the 'Info' page.
- Connect from IoTize Studio and run the 'Configuration | Check in Tap' command. The information will be displayed in the output window.
Note: we do not describe here how to connect from IoTize Studio or Tap Manager. We assume that you already play with these tools and that connecting is not an issue anymore.
Once you specified the serial number and the product key in the form, click on +Register to declare your Tap:
Note: the serial number and the product keys are pre-registered in the BuildServer database at the manufacturing time. Only pre-registered data will be accepted.
Once your Tap has been registered, you can check for your allowed build time in Apps > Plan Detail on the IoTize Cloud website.
Creating a new project Application Generation from IoTize Studio
Open your project in IoTize Studio, and go to IoTized Application > Mobile App. If your project is ready for app generation, follow through.
NFC application ID: AAR
Android allows your app to start automatically when your phone detects a properly configured NFC Tap. On creation, your application gets an ID. This ID is registered in the NFC Tap as an AAR (Android Application Record), which, on detection, asks the phone to launch the corresponding application if it is installed on the phone (Otherwise it will try to find the app on the default application store of the phone)
This AAR is part of the configuration: you can find and modify it in IoTize studio: IoTized Application > Mobile App > App reference stored on NFC Tag > App AAR for Android
Android App IDs are written as reversed URL (e.g. com.iotize.sensordemo.app). Note that this ID needs to be unique if you want to publish your app on the PlayStore. Although it is not mandatory to have a unique ID for your local testing, conflicts may occur on your testing devices if you use the same ID for several apps. Therefore, it is recommended to choose a new unique ID for every new app.
Build Server configuration
In Generated App Settings > Generation System Mode, select Build Server. Then, click on Generate App. This will open the following popup:
Click on Create a new Id Project. If you are not logged to the cloud in IoTize Studio, this will open a login popup:
Enter your IoTize Cloud credentials and click on Sign In
Note: You can also login from the toolbar Project > login before clicking on Generate App.
The new project name appears in Generated AppSettings > IoTize Cloud Project Id. The project is also uploaded to the IoTize Cloud website, and the server starts to build your app. Once the app generated, you will receive a download link at your IoTize Cloud account's email address.
Note: you can also see the build status and download the APK directly from the IoTize Cloud website.
You can now download the APK on your android device and install it. You can also download the generated project source files from the IoTize Cloud website.