How to create Huawei Android Emulator

后端 未结 4 2054
执笔经年
执笔经年 2021-01-03 19:41

I\'m developing an Android app using Huawei\'s Push service. I have installed DevEco IDE plugin within Android Studio. But I don\'t have any

4条回答
  •  鱼传尺愫
    2021-01-03 20:18

    You do not need for most cases Huawei device. Here is my battle-tested solution.

    If you're implementing HMS (Huawei Mobile Services) feature like push notifications, SMS retrieving or auth(orization) you can do simply:

    1. Grab HMS Core APK from: https://www.huaweicentral.com/download-the-latest-huawei-mobile-services-apk/
    2. Create new or run existing Android emulator via Android Studio or ADB
    3. Install HMS Core APK downloaded from 1.
    4. Go to Settings -> Apps & Notifications
    5. Make sure that HMS Core has required permissions like SMS for SMS retrieving or push notifications
    6. If you forget about 5., HMS library will return exception "Permissions not enabled"

    I am pretty sure that instead of emulator you can use any of physical devices, grab APK and install HMS Core on it.

    Happy coding!

提交回复
热议问题