Skip to content

veeeanti/android_steamapi_example

Repository files navigation

Steam API Android Test App

This is a basic Android application that demonstrates how to integrate the Steamworks SDK to interface with a Steam account for testing purposes.

Prerequisites

  1. Android Studio - Install Android Studio with NDK support
  2. Android SDK - Make sure you have the Android SDK installed
  3. NDK - Install the NDK through Android Studio (SDK Manager)

Setup Instructions

1. Configure the Android SDK Path

Edit local.properties and set the path to your Android SDK:

# Windows example:
sdk.dir=C\:\\Users\\YourName\\AppData\\Local\\Android\\Sdk

# Mac/Linux example:
sdk.dir=/Users/YourName/Library/Android/sdk

2. Set Your Steam App ID

The app currently uses App ID 480 (Space War - the example game in Steamworks SDK). For your own testing, you can:

  • Keep 480 for basic testing (works but limited functionality)
  • Change it to your own App ID in:
    • app/src/main/assets/steam_appid.txt
    • app/build.gradle.kts (applicationId)

3. Open in Android Studio

  1. Open Android Studio
  2. File > Open > Select the androidSteamAPI folder
  3. Wait for Gradle to sync
  4. Build > Build APK

4. Install and Test

  1. Transfer the APK to your Android device
  2. Install the APK
  3. Important: Steam must be installed on your Android device
  4. The app will initialize the Steam API and display:
    • Whether Steam is initialized
    • Whether Steam is running
    • Login status
    • Your Steam username
    • Your Steam ID

Project Structure

androidSteamAPI/
├── app/
│   ├── src/main/
│   │   ├── assets/           # steam_appid.txt
│   │   ├── cpp/              # Native C++ code
│   │   │   ├── CMakeLists.txt
│   │   │   ├── steam_manager.h
│   │   │   ├── steam_manager.cpp
│   │   │   └── native_bridge.cpp
│   │   ├── java/com/steamtest/app/
│   │   │   ├── MainActivity.kt
│   │   │   └── SteamAPI.kt
│   │   ├── jniLibs/          # Native Steam library
│   │   └── res/              # Android resources
│   └── build.gradle.kts
├── SteamworksSDK/            # Your Steamworks SDK (already included)
├── build.gradle.kts
├── settings.gradle.kts
└── README.md

Important Notes

  1. Steam Required: The Steam client must be installed on the Android device for the API to work
  2. App ID: Using App ID 480 will work for basic testing. For full functionality, register your own app on Steam
  3. arm64-v8a: The app is currently configured for arm64-v8a devices. You can add more ABIs in app/build.gradle.kts
  4. Testing: This app is for testing purposes. For production, you'll need proper Steam partner account access

Troubleshooting

  • Steam not initialized: Make sure the Steam app is installed and running on your device
  • Build errors: Ensure Android SDK, NDK, and CMake are properly installed via Android Studio
  • JNI errors: Verify the native library is properly loaded in SteamAPI.kt

Features

  • Steam API initialization
  • Get Steam username
  • Get Steam ID
  • Check login status
  • Check persona state (Online, Away, Busy, etc.)
  • Refresh button to update information

About

Example Android application using the steam_api library for android found in the Steamworks SDK.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors