RJRYT/NewCityRP-Apk
Custom Android SA-MP client for the New City Roleplay server — server browser, favorites, native voice chat, and game file updates.
README.md
NewCityRP Launcher
A custom Android client for the New City Roleplay SA-MP (San Andreas Multiplayer) server.
Overview
NewCityRP Launcher is a purpose-built Android application that connects players to the New City Roleplay SA-MP server. It bundles a customized SA-MP client with native C++ libraries for networking, game integration, and in-game voice communication, wrapped in a modern Android UI built with Java and ViewBinding.
The app handles server discovery, server joining, game file updates, favorites, user settings, and background downloads—providing a streamlined mobile entry point into the New City Roleplay community.
Features
- Server Browser — Browse and filter available New City Roleplay servers with status indicators.
- Favorites — Bookmark preferred servers for quick access.
- One-Tap Join — Connect directly to a server from the app.
- Game File Management — Download and update required GTA: SA / SA-MP files via background workers.
- In-App Settings — Configure graphics, controls, audio, and network preferences.
- Native Voice Chat — Opus-encoded voice communication integrated into the SA-MP client.
- Background Downloads — WorkManager-based file downloads with progress and cancel support.
- App Updates — In-app update checks and APK update flows.
- Crash Reporting — Firebase Crashlytics integration for production stability monitoring.
- Analytics — Firebase Analytics for usage insights.
Tech Stack
| Layer | Technology |
|---|---|
| Language | Java (JDK 11 source/target compatibility) |
| Native Code | C / C++ (NDK r26.2.11394342, CMake 3.12+) |
| Build System | Gradle (Android Gradle Plugin 8.1.0) |
| Minimum SDK | API 26 (Android 8.0 Oreo) |
| Target / Compile SDK | API 34 (Android 14) |
| UI | Android Views + ViewBinding |
| Navigation | Bottom Navigation + Fragments |
| Dependency Injection | Manual / static helpers |
| Networking | RakNet (native), OkHttp/Gson (Java layer) |
| Voice Codec | Opus |
| Background Work | Android WorkManager |
| Crash Reporting | Firebase Crashlytics |
| Analytics | Firebase Analytics |
| Image Loading | Picasso |
| Native Hooking | Shadowhook |
Prerequisites
Before building, ensure you have the following installed:
- Android Studio (Giraffe or newer recommended)
- JDK 17
- Android SDK with:
- SDK Platform: Android 14.0 (API 34)
- Android SDK Build-Tools (latest 34.x)
- Android NDK: version
26.2.11394342(pinned inapp/build.gradle) - CMake (bundled with NDK or installed via SDK Manager)
- An Android device (API 26+) or emulator for testing
Getting Started
1. Clone the repository
git clone https://github.com/RJRYT/NewCityRP-Apk.git
cd NewCityRP-Apk
2. Open in Android Studio
- Launch Android Studio.
- Select Open and choose the
NewCityRP-Apkfolder. - Wait for Gradle sync to complete. Android Studio will prompt you to install any missing SDK components (platform, build-tools, NDK, CMake).
3. Configure local SDK path
Create or update local.properties in the project root to point to your Android SDK:
sdk.dir=/path/to/your/Android/Sdk
Note:
local.propertiesis local to your machine and should not be committed to version control.
4. Build
Debug build:
./gradlew assembleDebug
Output: app/build/outputs/apk/debug/app-debug.apk
Release build:
./gradlew assembleRelease
Output: app/build/outputs/apk/release/NCRP-Client-V1.8-beta(8).apk
The release APK filename is templated from app/version.properties.
5. Run on a device
# Install and launch the debug build
./gradlew installDebug
# Or manually via adb
adb install app/build/outputs/apk/debug/app-debug.apk
adb shell am start -n com.newcityrp.launcher/.SplashScreenActivity
Project Structure
NewCityRP-Apk/
├── build.gradle # Top-level Gradle configuration
├── settings.gradle # Includes :app module
├── gradle.properties # JVM, AndroidX, and build settings
├── gradlew / gradlew.bat # Gradle wrapper
├── LICENSE # MIT License
├── README.md # This file
└── app/
├── build.gradle # App module: signing, deps, NDK, CMake
├── version.properties # App version (major.minor-suffix, versionCode)
├── src/
│ ├── main/
│ │ ├── AndroidManifest.xml
│ │ ├── java/
│ │ │ ├── com/newcityrp/launcher/ # App activities, fragments, helpers
│ │ │ ├── com/wardrumstudios/utils/ # Shared utilities (HTTP, media, billing)
│ │ │ └── com/nvidia/devtech/ # NVIDIA device/APK helpers
│ │ ├── cpp/
│ │ │ ├── CMakeLists.txt # Native build (opus + samp)
│ │ │ ├── opus/ # Opus audio codec (voice chat)
│ │ │ └── samp/ # SA-MP client core (RakNet, pools, voice)
│ │ └── res/
│ │ ├── layout/ # XML layouts (fragments, dialogs, activities)
│ │ ├── values/ # Strings, colors, styles, themes
│ │ ├── font/ # Custom fonts
│ │ ├── drawable/ # Icons and drawables
│ │ ├── menu/ # Bottom navigation menu
│ │ ├── xml/ # Backup, paths, data extraction rules
│ │ └── mipmap-* / drawable-* # Launcher icons and density resources
│ └── test/ # (Not present) Add unit tests here
│ └── androidTest/ # (Not present) Add instrumented tests here
└── proguard-rules.pro
Key Source Files
| File | Purpose |
|---|---|
SplashScreenActivity.java | App entry point / splash screen |
MainActivity.java | Main shell hosting bottom navigation |
HomeFragment.java | Home screen UI |
ServersFragment.java | Server list UI |
FavoriteFragment.java | Favorites screen |
SettingsFragment.java | App settings |
InfoFragment.java | Info / about screen |
ServerListRepository.java | Server data source |
ServerJoinHelper.java | Server connection logic |
GTASA.java | GTA: SA integration |
DownloadWorker.java / DownloadHelper.java | Background file downloads |
AppUpdateManager.java | In-app update checks |
Firebase (via Gradle deps) | Crashlytics + Analytics |
Configuration
Versioning
Edit app/version.properties:
VERSION_MAJOR=1
VERSION_MINOR=8
VERSION_SUFFIX=beta
VERSION_CODE=8
The project provides custom Gradle tasks for version bumps:
./gradlew incrementVersion # Bump versionCode + minor version
./gradlew incrementMajorVersion # Bump major version, reset minor to 0
./gradlew setStableVersion # Set VERSION_SUFFIX=release
Signing
Both debug and release build types are configured to sign with the bundled keystore in app/build.gradle:
signingConfigs {
release {
storeFile file("newcityrp.jks")
storePassword "newcityrp"
keyAlias "newcityrp"
keyPassword "newcityrp"
}
}
Security Note: A release keystore with passwords is checked into this repository for convenience. For production use, remove
newcityrp.jks, generate your own keystore, and updateapp/build.gradlewith your secure signing configuration. Never commit real production signing keys to public version control.
Application ID
- Package / namespace:
com.newcityrp.launcher - Defined in
app/build.gradle(namespaceanddefaultConfig.applicationId).
Native Build (C++)
Native code is compiled with CMake and bundled into the APK:
- samp — SA-MP client core, networking via RakNet, entity pools, etc.
- opus — Audio codec for in-game voice chat.
To modify native code, edit files under app/src/main/cpp/ and rebuild:
./gradlew assembleDebug
CMake will automatically recompile changed native sources.
ABI filters are limited to armeabi-v7a and arm64-v8a.
Testing
There are currently no unit or instrumented tests in the repository. Verification is manual via emulator or physical device.
To run Android Lint:
./gradlew lint
To add tests in the future:
- Unit tests:
app/src/test/java/... - Instrumented tests:
app/src/androidTest/java/...
Available Gradle Tasks
| Task | Description |
|---|---|
assembleDebug | Build debug APK |
assembleRelease | Build signed release APK |
installDebug | Build and install debug APK on connected device |
clean | Delete build outputs |
lint | Run Android Lint |
incrementVersion | Bump version code + minor version |
incrementMajorVersion | Bump major version, reset minor |
setStableVersion | Set version suffix to release |
List all tasks:
./gradlew tasks --all
Contributing
- Fork the repository.
- Create a feature branch (
git checkout -b feature/your-feature). - Make your changes and test on a device/emulator.
- Commit with a descriptive message.
- Push and open a Pull Request.
Please follow the existing code style and keep changes focused. For native code changes, ensure the CMake build still succeeds.
License
This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). See the LICENSE file for details.
The AGPL is a strong copyleft license. If you modify this software and make it available over a network (e.g., as a hosted service), you must release your modified source code under the same license.
Credits
- RJRYT — Main Developer. Visit rjryt.com
- SA-MP Team — San Andreas Multiplayer client foundation
- Opus Codec — Audio encoding for voice chat
- Firebase — Crashlytics and Analytics
Support
For issues, feature requests, or questions, open a GitHub issue in this repository.
android-appandroid-clientcmakefirebase-crashlyticsgta-san-andreasjavandknew-city-roleplayopus-voice-chatroleplaysa-mp-clientsampsan-andreas-multiplayerworkmanager
Ta strona jest zbudowana z tego, co GitHub publikuje o repozytorium. samp.directory nie hostuje kodu. Zgłoś problem z tym wpisem