Flutter or android native (kotlin or java) support?

Hi,

I am working on a Flutter project and in this project Flutter app communicates with VR headset via Bluetooth we want to replace Bluetooth with Photon.

But I couldn't find any help related to flutter or If I can find any resources on how to use photon in native android app I can write native android code and link it with flutter.

Looking forward to your response.

thanks

Answers

  • Kaiserludi
    Kaiserludi admin
    edited August 22

    Hi @Awais.


    Photon does not offer a Client for Flutter, for Kotlin or for Java.

    We do provide a C++ Client for Android NDK (see https://developer.android.com/ndk for more information on what the Android NDK is - in short it's Googles SDK for developing Android apps in the native languages C++ and C (unlike the Android SDK, which only permits development in the managed languages Java and Kotlin)).

    You can download it at https://www.photonengine.com/en-US/sdks#android-sdkrealtimeandroid.


    PS:

    Please do not cross-post. Doing so will not result in faster answers.

    I have just deleted your other 2 identical threads in different sections of the forum.

  • Thanks for responding.

    I want to achieve sending real-time messages between vr unity app and Android how can I achieve this?

  • Hi @Awais.


    You write an Android app partly in Java/Kotlin/Flutter and partly in C++. The UI part needs to be in Java/Kotlin/Flutter and the part that interacts with Photon needs to be in C++. You can call C++ functions from Java/Kotlin through JNI (Java Native Interface).

    I don't know anything about Flutter, but https://stackoverflow.com/questions/54952245/how-to-use-c-code-in-flutter-android-application might help about how to call C++ functions from Flutter.


    In Photon you simply connect, create/join the same room and use opRaiseEvent() to communicate between the Android C++ and the Unity C# Client.