An Android application for an ordering service robot that assists customers with dine-in and takeaway orders, monitors battery status, navigates to locations, and communicates with a Google Apps Script backend.
- Robot Initialization β Ensures the robot is ready before starting service.
- Battery Monitoring β Automatically returns to charging station when battery is low.
- Navigation β Moves to standby, tables, takeaway counter, or alternative locations.
- Order Processing β Handles dine-in and takeaway workflows.
- Server Communication β Logs table status, order placement, and QR code selections to Google Apps Script.
- Table Status Manager β Fetches table availability from the server or uses a local fallback.
- Error Handling β Includes fallbacks for navigation, TTS, and server request failures.
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Temi Robot β β Android App β β Google Apps β
β βββββΊβ βββββΊβ Script β
β - Navigation β β - UI Control β β - Data Logging β
β - Speech β β - State Mgmt β β - Table Status β
β - Battery β β - API Calls β β - Order Mgmt β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
app/
βββ manifests/
βββ kotlin+java/
β βββ com.example.orderingservice/
β βββ adapters/
β β βββ TableAdapter
β βββ models/
β β βββ Table
β β βββ BatteryMonitorService
β β βββ Constants
β β βββ TableStatusManager
β β βββ TemiUtils
β βββ MainActivity
β βββ NavigationActivity
β βββ OrderingActivity
β βββ WebhookManager
βββ java/ (generated)
βββ res/
βββ Gradle Scripts
-
Initialization
- Robot readiness check
- Battery level monitoring
- Table status synchronization
-
Navigation
- Automatic movement to greeting position
- Fallback to current position if navigation fails
-
Customer Greeting
- Automated welcome message
- Present ordering options (Dine-in / Takeaway)
-
Order Processing
- Dine-in: Table selection β Order placement
- Takeaway: Direct order or QR code selection
-
Backend Integration
- Real-time table status updates
- Order number generation
- Data logging and analytics
Configure these locations on your Temi robot:
standby
: Primary greeting positionhome base
: Charging station- Additional fallback locations as needed
- Low Battery Warning: 25%
- Critical Battery: 15% (automatic return to charging)
- User Interaction: 60 seconds
- Auto Greeting Delay: 3 seconds
- Table Occupation Duration: 30 minutes
The app communicates with a Google Apps Script backend for:
POST /
: Send order and table status updatesGET /?action=get_table_status
: Fetch current table occupancy
- table_occupied: When customer selects dine-in table
- qr_selected: When customer chooses QR code ordering
- order_placed: When order is completed
- table_released: When dining session ends
- Navigation Failures: Fallback to current position
- Network Issues: Local caching with periodic retry
- Speech Synthesis Errors: Continue with visual interface
- Battery Critical: Automatic charging station return
- Server Unavailable: Local state management
The application provides comprehensive logging:
- Robot navigation status
- Table occupancy changes
- Server communication
- Error conditions
- Real-time battery display
- Table status indicators
- Server connectivity status
- Detailed error messages
- Robot Navigation: Test movement to all configured locations
- Battery Simulation: Test low/critical battery responses
- Network Interruption: Verify fallback behavior
- Table Management: Confirm accurate occupancy tracking
- Order Flow: Complete end-to-end ordering scenarios
- Controlled restaurant environment
- Multiple table configurations
- Network reliability testing
- Extended operation testing
- Temi Robot with SDK v1.136.0+
- Android Studio (Giraffe or later)
- ADB platform-tools installed and on your
PATH
- GitHub account for menu hosting (optional)
- Google Account for Google Sheets + Apps Script setup
-
Clone this repository:
git clone https://github.com/NNSyaz/Ordering-Service.git
-
Open the project in Android Studio.
-
Replace the following placeholders:
- Webhook URL in
WebhookManager.kt
- GitHub Pages menu URL in
OrderingActivity.kt
- Webhook URL in
-
Set up Google Sheet & Apps Script webhook:
- See sheet_setup.md
-
Configure Temi locations:
- Create
table1
,table2
, etc. in Temi locations - Set
standby
andhome base
locations
- Create
-
Build APK:
-
Android Studio: Build > Build Bundle(s) / APK(s) > Build APK(s)
-
CLI:
./gradlew assembleDebug
-
These steps incorporate your requested flow:
- Open Temi robot port in Developer settings
- Open the project in Android Studio; Clean and Rebuild after each change
- Use terminal:
adb connect xxx.xxx.xxx.xxx
(Temi IP + port)- Once connected, install the APK
-
On Temi tablet: Settings β About tablet (or About), tap Build number 7 times to enable Developer options (if not already enabled).
-
Go to Settings β Developer options and enable:
- USB debugging (recommended for first setup), and
- ADB over network / Wireless debugging.
-
Note the IP address of the Temi (Settings β WiβFi β the connected network details). The default ADB TCP port is usually 5555 unless specified otherwise by your Temi build.
-
Android Studio: Build β Clean Project, then Build β Rebuild Project.
-
Or via CLI:
./gradlew clean assembleDebug
From your development machine terminal:
# If you previously connected via USB, you can switch Temi to TCP/IP mode first:
adb tcpip 5555
# Connect to Temi (replace with Temi's IP and port if different)
adb connect 192.168.1.123:5555
# Verify device is listed
adb devices
You should see a device entry like 192.168.1.123:5555 device
.
Locate the built APK (typical path shown below) and install:
# Install fresh
adb install app/build/outputs/apk/debug/app-debug.apk
# Or update the existing app in-place
adb install -r app/build/outputs/apk/debug/app-debug.apk
If you need to uninstall first (replace with your actual applicationId from app/build.gradle
):
adb uninstall com.example.orderingservice
To check if the package exists:
adb shell pm list packages | grep orderingservice
device offline
/unauthorized
: On Temi, confirm the ADB authorization prompt; toggle ADB over network off/on, then reconnect.failed to connect
: Ensure Temi and your PC are on the same WiβFi; verify IP/port; check that wireless debugging is enabled.INSTALL_FAILED_VERSION_DOWNGRADE
: Uninstall the app first or bumpversionCode
.INSTALL_FAILED_ALREADY_EXISTS
: Use-r
to replace or uninstall before installing.- Slow transfer: Use USB once to run
adb tcpip 5555
, then switch to WiβFi.
You can host your menu using:
- GitHub Pages: How to deploy
- Firebase Hosting
- Or local assets:
file:///android_asset/menu.html
Make sure the menu supports window.Android.onOrderComplete(data)
to send real order data.
{
"session_id": "session_abc124",
"table_no": "Table 3",
"order_type": "Dine-in",
"menu_items": ["Nasi Goreng", "Teh Ais"],
"battery": 47,
"status": "order_placed",
"timestamp": 1722801600000,
"total_items": 2
}
- Inactivity timeout: Resets app if no action in 60s
- Navigation failure: Retries or returns to base
- Battery low (< 25%): Displays warning
- Battery critical (< 15%): Ends current task and docks
- Add real-time database (Firebase/Supabase)
- Multiple Temi coordination
- Staff-side dashboard
- Analytics dashboard for order patterns