samp.directory
← Skripte und Bibliotheken

RJRYT/NewCityRP-Apk

Custom Android SA-MP client for the New City Roleplay server — server browser, favorites, native voice chat, and game file updates.

Tool★ 0aktualisiert gesternAGPL-3.0C
Auf GitHub öffnen

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

LayerTechnology
LanguageJava (JDK 11 source/target compatibility)
Native CodeC / C++ (NDK r26.2.11394342, CMake 3.12+)
Build SystemGradle (Android Gradle Plugin 8.1.0)
Minimum SDKAPI 26 (Android 8.0 Oreo)
Target / Compile SDKAPI 34 (Android 14)
UIAndroid Views + ViewBinding
NavigationBottom Navigation + Fragments
Dependency InjectionManual / static helpers
NetworkingRakNet (native), OkHttp/Gson (Java layer)
Voice CodecOpus
Background WorkAndroid WorkManager
Crash ReportingFirebase Crashlytics
AnalyticsFirebase Analytics
Image LoadingPicasso
Native HookingShadowhook

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 in app/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

  1. Launch Android Studio.
  2. Select Open and choose the NewCityRP-Apk folder.
  3. 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.properties is 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

FilePurpose
SplashScreenActivity.javaApp entry point / splash screen
MainActivity.javaMain shell hosting bottom navigation
HomeFragment.javaHome screen UI
ServersFragment.javaServer list UI
FavoriteFragment.javaFavorites screen
SettingsFragment.javaApp settings
InfoFragment.javaInfo / about screen
ServerListRepository.javaServer data source
ServerJoinHelper.javaServer connection logic
GTASA.javaGTA: SA integration
DownloadWorker.java / DownloadHelper.javaBackground file downloads
AppUpdateManager.javaIn-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 update app/build.gradle with 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 (namespace and defaultConfig.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

TaskDescription
assembleDebugBuild debug APK
assembleReleaseBuild signed release APK
installDebugBuild and install debug APK on connected device
cleanDelete build outputs
lintRun Android Lint
incrementVersionBump version code + minor version
incrementMajorVersionBump major version, reset minor
setStableVersionSet version suffix to release

List all tasks:

./gradlew tasks --all

Contributing

  1. Fork the repository.
  2. Create a feature branch (git checkout -b feature/your-feature).
  3. Make your changes and test on a device/emulator.
  4. Commit with a descriptive message.
  5. 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

Diese Seite wird aus dem erstellt, was GitHub über das Repository veröffentlicht. samp.directory hostet den Code nicht. Ein Problem mit diesem Eintrag melden

RJRYT/NewCityRP-Apk: SA-MP Tool | samp.directory