This is a step-by-step tutorial using a sample project for mobile SDK for Android and iOS.
Install Android Studio
Download and install Android Studio(IDE for Android development) from here.
After you complete the download, launch the app and finish installation.
Import the project
Choose File → New → Project from Version Control → Git.
After the dialog opens, type firstname.lastname@example.org:treasure-data/td-android-sdk.git in the URL field. Click Clone.
Then build begins automatically. After the build finishes, you can see the projects listed on the left.
Configure the parameters
From Navigate > Class menu, you can search for any files. Search DemoApp and click Enter.
The file opens in the editor. Modify the following parameters:
- API KEY
- DB Name
- Table Name
If you are going to send commands to regions other than the US region, add the following code to the onCreate function.
// set endpoint to Tokyo region.
Create virtual device
To run the sample app in the emulator, you need to create a virtual device at first. Follow the instructions for doing this here.
Run the demo app
Choose example project from the project select field, then click the Run button.
Choose the virtual device created in the preceding step and then click OK.
You can see the demo application running in your emulator.
By pushing the Upload button on the right upper side, the events are uploaded to TD. You can see the records on the TD console in minutes as the following example shows.
$ git clone email@example.com:treasure-data/td-ios-sdk.git
$ cd td-ios-sdk/TreasureDataExampleSwift
$ gem install cocoapods
$ pod install
Open the project in Xcode
Launch the Xcode app, and go to File → Open. Then choose the TreasureDataExampleSwift.xcworkspace file, not TreasureDataExampleSwift.xcodeproj.
Run the demo app
Click the Run button at the top of the screen. The simulator starts automatically.
Enter your configuration (APIKEY, DB etc...) on your app. Then add the event and upload.
The results are can be seen on the TD Console within a few minutes.