Unity Editor Installation and APK Packaging - Huawei Developers

Recently, the project leader suddenly proposed that the team use Unity to develop a game and release it on HUAWEI AppGallery. Unity beginners who have only developed Android clients before need to start learning knowledge about Unity. This article mainly talks about the following information for beginners:
How to install Unity Editor?
How to package an APK in Unity Editor quickly?、
Registering with the Unity Platform
Before you actually start using Unity, you should get a Unity account. An account is required to download Unity Editor and download resource files from Unity Asset Store. So, just register at this link: https://id.unity.com.
Installing Unity Editor
Now you have an account. You need to install Unity Editor. For details, see the description on the official website: https://unity.cn/releases.
There are many installation methods available on the official website. Here, I use the Unity Hub method recommended by the official website. That is, install Unity Hub first and then install Unity Editor in the hub.
Unity Hub: It is a tool for managing Unity projects, Unity Editor, licenses, and additional components.
Unity Editor: It is a platform for you to develop projects. It is similar to Android Studio and can be used to compile and run projects. In addition, from this editor, you can directly go to Unity Hub, which is really practical.
The installation procedure is as follows:
1. Install Unity Hub.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
2. Open Unity Hub and click the button to install Unity Editor. In the following figure, the latest version is installed.
Note: If you want to change the installation path of Unity Editor, click the gear icon in the upper right corner.
3. Manage your license. Here, I use a license of the personal edition. This is enough for a beginner.
(Optional) Installing Visual Studio
Visual Studio is the script editor of Unity. Generally, you do not need to install Visual Studio by yourself. It is automatically installed when you install Unity Editor. However, Visual Studio may fail to be installed automatically. According to information that can be found over the Internet, when installation failure occurs, you can install Visual Studio by yourself you referring to https://blog.csdn.net/fromfire2/article/details/81270185/.
If the automatic installation is successful, the Visual Studio information can be associated. The correct installation result is as follows:
Creating a Project
1. Open Unity Hub and create a project on the page shown in the following figure.
2. Click CREATE. Unity Editor automatically opens the project. For each new project, Unity provides a default sample game scene SampleScene.
A game scene contains the architecture, characters, background, sound, and special effects that will be revealed to players.
For details about the basic concepts of Unity, search the Internet or visit the Unity official website at https://docs.unity.cn/2018.4/Documentation/Manual/UsingTheSceneView.html.
Packaging the APK
I just created a project in Unity Editor, with a SampleScene displayed. This article will not talk about how to add characters, buildings, backgrounds, sounds, and buttons to the scene. You can learn about the procedure by yourself based on your needs. Next, I’ll talk about how to package an APK in Unity. In this case, I need to package the empty SampleScene.
1. Set up the Android environment. For details, please refer to the official documentation. I have integrated the Android SDK and Java SDK locally, so I associate the local SDKs.
2. Release an APK package and change the package name and version code.
3. Connect your mobile phone to your computer and package the APK package.
Actually, the package can be normally installed on my mobile phone.
For more details, please check:
Unity document: https://docs.unity.cn/2018.4/Documentation/Manual/UnityManual.html

Very nice

justnewsp said:
Very nice
Click to expand...
Click to collapse
Thank you for your liking.

Related

Integration Practice | Sending Messages by HUAWEI Push Kit in Cocos

Cocos Creator has supported HMS Core and HUAWEI AppGallery Connect, through which you can quickly release your games with one click, reducing such complex operations as the SDK integration and app upload during development. In this way, you can build high-quality and innovative apps to improve game experience.
Based on this guide, you can learn how to send messages by Push Kit in Cocos step by step.
Procedure Overview
1. Create a game on the Cocos website, and create the game project in Cocos Creator.
2. Create an app and configure the app information in AppGallery Connect, configure Cocos SDKHub and the building flow, and add the HUAWEI_HMS (Push) plugin and select HUAWEI AppGallery Connect from SDKHub Configuration.
3. Perform coding to obtain a token and build an APK.
4. Test the function of sending notification messages and data messages.
Procedure Details
Step 1: Create a game on the Cocos website, and create the game project in Cocos Creator.
1. Visit https://passport.cocos.com/auth/signup, and sign in with a Cocos developer account. (If you have no account, register one.) Then create a game.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
2. Visit http://www.cocos2d-x.org/products#creator, and download and install Cocos Creator.
3. Start Cocos Creator, choose Project, and click New. In the window that is displayed, configure project information, and click Save. The project creation is completed.
If the following error occurs during creation, download Editor.
In Cocos Creator, choose Editor, select version 2.4.2 on the right, and click Download.
Step 2: Create an app and configure the app information in AppGallery Connect, configure Cocos SDKHub and the building flow, and add the HUAWEI_HMS (Push) plugin and select HUAWEI AppGallery Connect from SDKHub Configuration.
1. Create an app and configure the app information in AppGallery Connect by referring to the guide in https://developer.huawei.com/consum...re-Guides/android-config-agc-0000001050170137.
The key steps include:
Generating a signing certificate fingerprint
Configuring the signing certificate fingerprint
Setting a data storage location
Enabling required services
Downloading the agconnect-services.json file
After the app information configuration, perform configuration in Cocos Creator.
2. Choose Panel > Service.
3. Select your project.
Select Cocos SDKHub on the page that is displayed.
4. Click Plugin Manage.
5. Select Push and click OK. The page shown in the preceding figure is displayed.
6. Move the cursor to Not Configured in Params. The editing icon is displayed. Click it.
7. Select a required JSON file, and click OK.
8. Choose Project > Build.
The Build panel is displayed on the right.
9. Set SDKHub Configuration to HUAWEI AppGallery Connect, and click Build.
If the following error occurs during building, install NDK.
After the installation, click Compile. The progress status becomes completed.
Step 3: Perform coding to obtain a token and build an APK.
The following figure shows the project structure.
In Cocos Creator, select js-sdkhub.js file from Assets at the lower left corner.
More information, you can visit https://forums.developer.huawei.com/forumPortal/en/topicview?tid=0201368424613350372&fid=0101187876626530001
https://forums.developer.huawei.com/...87876626530001 This seems a new platform for asking integration questions about HMS. I will try this.
Sherlock F said:
https://forums.developer.huawei.com/...87876626530001 This seems a new platform for asking integration questions about HMS. I will try this.
Click to expand...
Click to collapse
Yep, welcome to experience it~

Integrating HUAWEI Game Service Based on Cocos SDKHub - Packaging and Releasing

You can release a Cocos-based game in HUAWEI AppGallery Connect.
1. Building Your Version
Sign in to Cocos Creator, choose Project > Build & Release, and perform configurations as follows:
Select HUAWEI AppGallery Connect as the release platform.
For a joint operations app or game, the package name must end with*.huawei.
Use the keystore information configured previously.
In Cocos SDKHub, select the HUAWEI AppGallery Connect config set you need.
You are advised to deselect Debug Mode. All Huawei SDK APIs require app signature verification, if Debug Mode is selected, the compiler does not sign your app package by default.
2. Compiling Your Version
You can either compile your game in Cocos Creator or Android Studio.
2.1 Compiling in Cocos Creator
In Cocos Creator, go to Project > Build…, and click Compile after the build is complete.
After compilation, you can find the file in $ProjectHome\build\jsb-link\publish\android.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
2.2 Compiling in Android Studio
Open the following directory in Android Studio and compile your game.$ProjectHome \build\jsb-link\frameworks\runtime-src\proj.android-studio
3. Uploading Your Version
You can release your game version either by uploading it in Cocos Creator directly after build and compilation, or by uploading the compiled file in AppGallery Connect.
Method 1: Click Upload next to Compile in Cocos Creator. Select a login type, and enter the app ID of your game, which was generated by AppGallery Connect. You can set other parameters according to the actual situation. Click Confirm, and verify your HUAWEI ID in the displayed dialog box. After verification, your game version will be uploaded to AppGallery Connect. You can later sign in to AppGallery Connect and go to My apps > Distribute > Version information to view it.
Method 2: Sign in to AppGallery Connect, go to My apps > Distribute > Version information, click Software package management, and upload your app package.
For more details, check:
Integrating HUAWEI Game Service Based on Cocos SDKHub - Integrating Cocos SDKHub:https://forums.developer.huawei.com/forumPortal/en/topic/0203404602609800136
AppGallery Connect documentation:https://developer.huawei.com/consumer/en/doc/distribution/app/agc-release_app

How Can I Use the HUAWEI Game Service Demo Provided by Unity? - Part1

HUAWEI Game Service provides various capabilities, including automatic game update check, player information obtaining, floating window, game addiction prevention, game achievements, and leaderboards. Unity provides the HMS Core App Services SDK and demo for global developers to quickly integrate these capabilities and release their games on Huawei devices.
Let’s try this SDK.
Objective: Run the game demo provided by Unity to debug basic functional APIs, including init and APIs for HUAWEI ID sign-in.
Documentation
https://docs.unity.cn/cn/Packages-cn/[email protected]/manual/appgallery.html
Demo Download Path
https://github.com/Unity-Technologies/HMSSDKSample
The demo to be run is as follows.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Preparations
Step 1: Register as a Huawei developer, create a joint operations game, and add it to a project.
For details about the operations, please refer to the official documentation: https://developer.huawei.com/consum...connect-Guides/appgallerykit-preparation-game.
The following figure shows an example.
Step 2: Download the agconnect-services.json file in AppGallery Connect.
1. Go to the Project settings page of the project to which your game belongs. The following message is displayed. In this example, Manually enter the package name is selected.
2. Download the agconnect-services.json file.
Step 3: Replace the JSON file in the demo provided by Unity.
Replace the downloaded JSON file with the following file.
Step 4: Configure related files in the Assets/Plugins/Android directory.
For details about the operations, please refer to the Unity documentation:
https://docs.unity.cn/cn/Packages-c...configuration-files-into-assetspluginsandroid
Opening the Demo in UnityEditor
If you have not installed UnityEditor, you can install its latest version and Unity Hub by performing the operations in the following post. If you have installed UnityEditor, follow the operations below.
https://forums.developer.huawei.com/forumPortal/en/topic/0204435788744370088?fid=0101187876626530001
Step 1: Add a Unity project in Unity Hub.
The following figure shows how your project is displayed.
Note that you need to choose the correct Unity version when opening the project.
Step 2: Double-click the project and go to UnityEditor.
Ignore this message and click Continue.
Again, click Continue and wait for the project import to complete.
The demo page is as follows.
Completing the Build Settings for the Android Game
Step 1: Choose File > Build Settings….
Step 2: Click Player Settings… and the Project Settings tab page is displayed.
Note: If you have not installed the Android module, install it in UnityEditor as prompted. Restart UnityEditor to make the module take effect.
Step 3: Replace the game information, including Package Name and Version, with your actual game information configured in HUAWEI AppGallery Connect.
Step 4: Generate a signature file for your game.
Note: If a message is displayed, indicating that the JDK directory is not set or invalid, choose Edit > Preference > External Tools and change the default JDK directory. The system will automatically obtain the directory. If the directory cannot be found, you need to reinstall and restart UnityEditor. For details, please watch this video: JDK not found Unity | java development kit is not set or invalid unity.
In this example, the generated signature file is placed here.
Interesting to know it if you want to make a game with unity.
Rebis said:
Interesting to know it if you want to make a game with unity.
Click to expand...
Click to collapse
Thank you for like.

HMS Push kit Integration into Unity Game | Installation and Example

Introduction
In this article, we will learn how to add Push kit into our Unity Game. Push notifications are those notifications that we receive on our cell phone, smartwatch or computer with a message informing us about an event or encouraging us to take a certain action. While we usually take more time to read an email, we do the opposite with notifications: we respond to the stimulus by seeing them quickly (and it is that many times, to see a push it is not even necessary to unlock our screen). Thus, it is possible to take advantage of push notifications as a direct communication channel with our users, and they are a fundamental tool when it comes to generating engagement and building a lasting relationship.
Implementation Steps
1. Creation of our App in App Gallery Connect
2. Evil Mind plugin Integration
3. Configuration in Unity
4. Creation of the scene
5. Coding
6. Configuration for project execution
7. Final result
App Gallery Connect Configuration
Creating a new App in the App Gallery connect console is a fairly simple procedure but requires paying attention to certain important aspects.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Once inside the console we must create a project and to this project we must add an App.
When creating our App we will find the following form. It is important to take into account that the category of the App must be Game.
Once the App is created, it will be necessary for us to activate the Account Kit in our APIs, we can also activate the Game service if we wish.
HUAWEI Push Kit establishes a messaging channel from the cloud to devices. By integrating Push Kit, you can send messages to your apps on users' devices in real time.
Once this configuration is completed, it will be necessary to add the SHA-256 fingerprint, for this we can use the keytool command, but for this we must first create a keystore and for this we can use Unity.
Remember that we must change the platform we are on since normally Unity will always assign us as a PC platform.
Once the keystore is created we must open the console, go to the path where the keystore is located and execute the following code. Remember that to use this command you must have the Java JDK installed.
Once inside the route
Keytool -list -v -keystore yournamekey.keystore
This will give us all the information in our keystore, we obtain the SHA256 and add it to the App.
Unity Evil Mind Plugin configuration
We have concluded the creation of the App, the project and now we know how we can create a keystore and obtain the sha in Unity.
In case you have not done it now we must create our project in Unity once the project is created we must obtain the project package which we will use to connect our project with the AGC SDK. first of all let's go download the Evil Mind plugin.
GitHub - EvilMindDevs/hms-unity-plugin
Contribute to EvilMindDevs/hms-unity-plugin development by creating an account on GitHub.
github.com
In the link you can find the package to import it to Unity, to import it we must follow the following steps.
Download the .unity package and then import it into Unity using the package importer.
Once imported, you will have the Huawei option in the toolbar, we click on the option and add the data from our App.
Once we have imported the plugin we will have to add the necessary data from our App Gallery App and place it within the
required fields of the Unity plugin. Well, now we have our App Gallery App connected to the Unity project.
Now we can add the Push Notifications prefab to our scene remember that to do this we must create a new scene,
for this example we can use the eschena that the plugin provides.
For more, you can check https://forums.developer.huawei.com/forumPortal/en/topic/0202457956096970035
Why thus p40 pro giveaway date is extending every time?
YUAman said:
Why thus p40 pro giveaway date is extending every time?
Click to expand...
Click to collapse
Hi, you mean? I can not understand.

What should I do if HMS Core (APK) cannot be updated (error code 102)?

I integrated the HMS Core SDK via the Maven repository in Android Studio. During the test on a Huawei mobile phone, I was prompted to update HMS Core (APK) to the latest version. But when I tried to update it, error code 102 was displayed, indicating that HMS Core (APK) cannot be updated.
I contacted Huawei technical support personnel (you can also submit a ticket online), and provided the problem reproducing logs without any filter. They told us that the hmsrootcas.bks certificate, which is required for updating HMS Core (APK), was invalid.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Because the project is an Android Studio project, the technical support personnel advised us to delete the hmsrootcas.bks certificate file, build dependencies, and generate the package again according to the reference documentation.
Generally, the problem can be solved by performing the preceding steps. However, when I deleted the hmsrootcas.bks certificate file under the Assets file and integrated the SDK again, the problem still occurred no matter how many times I tried.
In response, technical support told us to download the Base SDK integrated for Eclipse to obtain the msrootcas.bks certificate file and add the file to our project. Using Base SDK 5.3.0.301 as an example, the detailed directory for obtaining the file is hmssdk-eclipse-5.3.0.301.zip/security-ssl-1.1.5.306/assets/hmsrootcas.bks.
If you encounter the same problem when you use Eclipse, delete the hmsrootcas.bks certificate file in the package and download the Assets file of the SDK to the project.
SDK download link:
https://developer.huawei.com/consum..._TOPIC_0000001050121222__section3142161417195
devwithzachary said:
I integrated the HMS Core SDK via the Maven repository in Android Studio. During the test on a Huawei mobile phone, I was prompted to update HMS Core (APK) to the latest version. But when I tried to update it, error code 102 was displayed, indicating that HMS Core (APK) cannot be updated.
I contacted Huawei technical support personnel (you can also submit a ticket online), and provided the problem reproducing logs without any filter. They told us that the hmsrootcas.bks certificate, which is required for updating HMS Core (APK), was invalid.
Because the project is an Android Studio project, the technical support personnel advised us to delete the hmsrootcas.bks certificate file, build dependencies, and generate the package again according to the reference documentation.
Generally, the problem can be solved by performing the preceding steps. However, when I deleted the hmsrootcas.bks certificate file under the Assets file and integrated the SDK again, the problem still occurred no matter how many times I tried.
In response, technical support told us to download the Base SDK integrated for Eclipse to obtain the msrootcas.bks certificate file and add the file to our project. Using Base SDK 5.3.0.301 as an example, the detailed directory for obtaining the file is hmssdk-eclipse-5.3.0.301.zip/security-ssl-1.1.5.306/assets/hmsrootcas.bks.
If you encounter the same problem when you use Eclipse, delete the hmsrootcas.bks certificate file in the package and download the Assets file of the SDK to the project.
SDK download link:
https://developer.huawei.com/consum..._TOPIC_0000001050121222__section3142161417195
Click to expand...
Click to collapse

Categories

Resources