Skip to content

Support HarmonyOS #1166

Description

@chengxingen

Can the objectbox library support Harmony os? Harmony os runs on Huawei mobile phones, and its sdk has many similarities with android sdk.

Activity

  1. greenrobot-team commented on Dec 18, 2023

    @greenrobot-team
    Member

    Thanks for the suggestion! For anyone else interested, please thumbs up the first comment. This helps us track interest.

    Based on a quick search, it appears support for compiling native C++ code exists. This would be required to compile the ObjectBox core library for Harmony OS. But I can't find any docs on how to do it. So this may be possible, but not sure.

  2. changed the title [-]Support Harmony os[/-] [+]Support HarmonyOS[/+] on Dec 18, 2023
  3. chengxingen commented on Dec 19, 2023

    @chengxingen
    Author

    Thanks for the suggestion! For anyone else interested, please thumbs up the first comment. This helps us track interest.

    Based on a quick search, it appears support for compiling native C++ code exists. This would be required to compile the ObjectBox core library for Harmony OS. But I can't find any docs on how to do it. So this may be possible, but not sure.

    Harmony OS's main market is in China and has been widely used. Here is its development documentation link.As a mobile application developer, I have used many libraries related to data storage, but so far only objectbox has the highest efficiency,and it is the best. Therefore, I hope to support Harmony OS.Thank you!

  4. greenrobot commented on Dec 19, 2023

    @greenrobot
    Member

    So you are saying it's not compatible with Android? According to Wikipedia it's based on Android.

  5. chengxingen commented on Dec 19, 2023

    @chengxingen
    Author

    So you are saying it's not compatible with Android? According to Wikipedia it's based on Android.

    HarmonyOs is not AndroidOs,although their APIs have many similarities.For example, the objectbox uses the Context class,In Android SDK, its path is android.content.Context, but in Harmony SDK, its path is ohos.app.Context,this can lead to some compilation issues.Additionally, there are issues with plugins that are not supported.

  6. chengxingen commented on Dec 19, 2023

    @chengxingen
    Author

    So you are saying it's not compatible with Android? According to Wikipedia it's based on Android.

    HarmonyOs is not AndroidOs,although their APIs have many similarities.For example, the objectbox uses the Context class,In Android SDK, its path is android.content.Context, but in Harmony SDK, its path is ohos.app.Context,this can lead to some compilation issues.Additionally, there are issues with plugins that are not supported.

    This is an error message that is not supported by the plugin:

    An exception occurred applying plugin request [id: 'io.objectbox']

    Failed to apply plugin 'io.objectbox'.
    'io.objectbox' can only be applied to a project if one of the following is applied before:
    * an Android plugin
    * the Kotlin Android or JVM plugin
    * the Java Library, Java Application or Java plugin

  7. chengxingen commented on Dec 19, 2023

    @chengxingen
    Author

    So you are saying it's not compatible with Android? According to Wikipedia it's based on Android.

    HarmonyOs is not AndroidOs,although their APIs have many similarities.For example, the objectbox uses the Context class,In Android SDK, its path is android.content.Context, but in Harmony SDK, its path is ohos.app.Context,this can lead to some compilation issues.Additionally, there are issues with plugins that are not supported.

    This is an error message that is not supported by the plugin:

    An exception occurred applying plugin request [id: 'io.objectbox']

    Failed to apply plugin 'io.objectbox'.
    'io.objectbox' can only be applied to a project if one of the following is applied before:

    • an Android plugin
    • the Kotlin Android or JVM plugin
    • the Java Library, Java Application or Java plugin

    I can use the objectbox in the HarmonyOs project by creating a Java library, which is supported by the plugin. However, because the objectbox uses reflection to call some Android APIs, Harmony SDK does not support Android APIs, so errors may also occur when loading so files.

  8. greenrobot commented on Dec 19, 2023

    @greenrobot
    Member

    So, we have at least 3 eras, in which Harmony OS could be different:

    1. Gradle plugin (or whatever build tool we need)
    2. Java APIs
    3. Native libraries

    And there seems to be also Harmony OS NEXT, which has a micro-kernel and thus could be different in many other ways too.

    At this point it's not clear if we want to support it; it will depend on mainly two things, I guess. First, the amount of community support we would get. Second, how big the differences actually are.

  9. chengxingen commented on Dec 20, 2023

    @chengxingen
    Author

    So, we have at least 3 eras, in which Harmony OS could be different:

    1. Gradle plugin (or whatever build tool we need)
    2. Java APIs
    3. Native libraries

    And there seems to be also Harmony OS NEXT, which has a micro-kernel and thus could be different in many other ways too.

    At this point it's not clear if we want to support it; it will depend on mainly two things, I guess. First, the amount of community support we would get. Second, how big the differences actually are.

    Understood, thank you very much,looking forward to your support!

  10. mobileAiDev commented on Jul 9, 2024

    @mobileAiDev

    Harmony Next OS is now in beta. You can visit their website:
    https://developer.huawei.com/en/ @greenrobot-team @greenrobot
    You can contact them to receive a phone with Harmony Next and access the developer documentation

  11. mobileAiDev commented on Jul 9, 2024

    @mobileAiDev

    Most popular apps in China have already started their adoption work on Harmony Next. Therefore, there is indeed a requirement for a database. If you need more information, feel free to ask

  12. greenrobot commented on Jul 10, 2024

    @greenrobot
    Member

    Are there some deep links on what has to be done?

    PS.: again, these are the likely areas to watch:

    • Gradle plugin (or whatever build tool we need)
    • Java APIs
    • Native libraries
  13. mobileAiDev commented on Jul 17, 2024

    @mobileAiDev

    Harmony Next OS is now in beta, so I am not allowed to provide you with developer documents. You can only access the documents after Huawei gives you an account. If you need to contact a Huawei developer, I can offer you help, or you can use the link I provide to connect with Huawei directly.

  14. mobileAiDev commented on Jul 17, 2024

    @mobileAiDev

    Here is some information about Harmony Next:

    Build tool: Node (may be modified)
    Native libraries: Node-API
    Java APIs: There are no Java APIs; TypeScript is used instead
    @greenrobot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions