Skip to content

Tap-Payments/TapGLKit-Android

Repository files navigation

TapGLKit Integration Guide

This guide explains how to add TapGLKit to other Android projects. Choose the option that matches your workflow.

1. Options overview

  • Remote dependency (Maven/Central/Private repo)
  • Local module (include source module)
  • AAR file (local binary)

2. Using as a Gradle dependency

Replace group/artifact/version with the published coordinates.

Project-level settings (if needed)

// settings.gradle
// ...existing code...
// No changes required for hosted artifacts

Module-level dependency:

// app/build.gradle (module)
dependencies {
    // Replace with actual coordinates
    implementation "com.example:tapglkit:1.0.0"
}

3. Adding as a local module

  1. Copy the TapGLKit module folder into your project (e.g., libs/tapglkit).
  2. Edit settings.gradle:
include ':app', ':tapglkit'
project(':tapglkit').projectDir = file('libs/tapglkit')
  1. Add dependency:
dependencies {
    implementation project(':tapglkit')
}

4. Using a local AAR

  1. Put tapglkit.aar in app/libs/.
  2. In app/build.gradle:
repositories { flatDir { dirs 'libs' } }
dependencies {
    implementation(name:'tapglkit', ext:'aar')
}

5. Initialization

Call the library init code in your Application class (if the library exposes an init). If no init exists, skip this step.

class App : Application() {
    override fun onCreate() {
        super.onCreate()
        // If TapGLKit exposes an init:
        // TapGLKit.init(this)
    }
}

Register Application in AndroidManifest if needed.

6. Layout and basic usage

Add a GLSurfaceView or the provided view component to your layout:

<!-- res/layout/activity_main.xml -->
<!-- ...existing code... -->
<com.example.tapglkit.TapGLSurfaceView
    android:id="@+id/tap_gl_view"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />
<!-- ...existing code... -->

Activity sample:

class MainActivity : AppCompatActivity() {
    private lateinit var glView: View // replace with actual view type

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        glView = findViewById(R.id.tap_gl_view)

        // If library requires a renderer / setup:
        // (glView as TapGLSurfaceView).setRenderer(MyRenderer())
    }

    override fun onResume() {
        super.onResume()
        // forward lifecycle if required:
        // (glView as TapGLSurfaceView).onResume()
    }

    override fun onPause() {
        // (glView as TapGLSurfaceView).onPause()
        super.onPause()
    }
}

7. ProGuard / R8

If the library requires rules, add them to proguard-rules.pro (replace with actual rules):

# Keep library entrypoints
-keep class com.example.tapglkit.** { *; }

8. Resources & manifest

If the library includes resources or AndroidManifest entries, ensure merging is enabled (default) and check for duplicate attributes or permission requirements.

9. Troubleshooting

  • "Class not found" -> verify dependency coordinates or local module/AAR inclusion.
  • "Renderer not called" -> ensure GLSurfaceView is attached and lifecycle methods are forwarded.
  • Check Logcat for library-specific tags.

10. Versioning & updates

  • Update dependency version in build.gradle to upgrade.
  • Test on target API levels and devices using hardware acceleration and OpenGL ES level required by TapGLKit.

11. Contact / Issues

If integration fails, open an issue in the TapGLKit repo with:

  • Gradle config
  • The exact dependency line used
  • AndroidManifest and relevant code snippets
  • Logcat errors

Keep this guide next to your consumers' README for quick copy-paste examples.

About

Kit with GL views for Android

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors