Cannot get com.huawei.hms.location.LocationServices for Huawei Map Kit in android studio - huawei-mobile-services

I am currently trying to migrate Google Maps to Huawei map kit in my android project.
It was easy to migrate google maps to Huawei map at first. They are provided all the methods and classes that Google Maps have but now I couldn't get LocationServises class from Huawei that I used in my google maps.
In the documentation they say that Huawei Map kit has com.huawei.hms.location package and LocationServises inside. But why I cannot get it???
The links and libs that I added to gradle below: I refer the Huawei Map Kit documentation
1. maven {url 'https://developer.huawei.com/repo/'}
2. classpath 'com.huawei.agconnect:agcp:1.2.1.301'
3. maven {url 'https://developer.huawei.com/repo/'}
4. implementation 'com.huawei.hms:maps:5.1.0.300'

You can find the location services in the following artifactory
// Huawei implementation "com.huawei.hms:location:4.0.3.301"
And retrieve the location with:
FusedLocationProviderClient
Retrieve the last location with the listener
private var fusedLocationProviderClient: FusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(context)
fusedLocationProviderClient.lastLocation.addOnSuccessListener { location -> Log.d("Location", location)
}

You are advised to use Huawei Location Kit because Map Kit involves only some of location functions. :)
I am migrating the Google maps to Huawei map and in the google version
there is something like public static final Api API;
variable inside LocationServises class and I need this variable in
Huawei too. But there no variable like this :/ do you know where to
get it?
Please kindly refer to the Location Kit References.
About public enum LocationType, please refer to docs here.

Related

(Flutter) Huawei Location Kit - longitude and latitude null

I am trying to use Huawei Location Kit(Fused Location Service) to get longitude and latitude. But the response I get back are all null. 
Then, I call the requestLocationUpdates() method to obtain the device location and update the cache. But I got PlatformException. May I know why?
My current code to use Huawei Location Kit:
Log:
I tried your code in the project, it seems working.
Can you check whether agconnect-services.json and key file is put in correct place like this:
Project screenshot:
and the API has been enabled in AppGallery Connect:
AGConnect Screenshot:
In the new Location kit 6.0.0 version, Non-Huawei Android phones support only Fused location capability. See Docs.
In addition, only some interfaces are supported. Docs link.
The requestLocationUpdates interface you use here is not supported by Non-Huawei Android phones. You are advised to use the requestLocationUpdatesCb interface instead.
Or you could use version 5.1.0.303 of the Flutter plug-in.

No Google services available in this device

I am trying to integrate HMS kits i.e. location, ads, etc. into my app so that I can launch app into appGallery as well.
However, I also use react-native-firebase for other services. Now, I get alert/dialog saying:
"No google services available in this device...."´
How to fix this issue? Is there any way to avoid this message?
That's true that GMS is not supported on Huawei phones released after the Google ban. However, if you just want to suppress this dialog complaining "No google services available in this device...." in RN that could be achieved by Turning off Google Play Services availability errors:
firebase.utils().errorOnMissingPlayServices = false;
firebase.utils().promptOnMissingPlayServices = false;
for more information please visit this link.
GMS is not supported on Huawei phones released after the Google ban. Here I provide two options for you:
Option 1: Release your app both on HUAWEI AppGallery and Google Play, with different packages. The app you release on AppGallery contains only Huawei's logic code. For details about multi-channel packaging, please refer to docs.
Option 2: Release the same app on HUAWEI AppGallery and Google Play. Add the following code to determine whether GMS APIs or HMS APIs are available and call the available APIs:
public boolean isGMS(){
return GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(this) == com.google.android.gms.common.ConnectionResult.SUCCESS;
}
public boolean isHMS(){
return HuaweiApiAvailability.getInstance().isHuaweiMobileServicesAvailable(this) == com.huawei.hms.api.ConnectionResult.SUCCESS;
}
You can add the code manually, or use HMS ToolKit to realize G+H logic judgment.

How to integrate Huawei Mobile Services (HMS) in Unity?

I've found a lot of guidelines on how to integrate HMS in my apps. But majority of them are different or using android studio. May I know which one is the latest guidelines to integrate HMS in my apps for Unity.
Also, I want to enable In-App-Purchase (subscription) for my apps as well.
Thanks in advance.
UPDATED
Currently I'm trying to implement In-App-Purchase for huawei. Huawei tech said that users need to signIn first before they can use IAP. But I received this error while testing signIn
How to obtain product info ? here
AFAIK you have two main options:
UDP SDK from Unity, which is the Unity official solution to HMS in Unity. However has been under maintenance for some days now.
Unity HMS Plugin from EvilMinds, an open source alternative that is already functional and includes supports to more HMS kits. Looks pretty promising for the future.
In any case you can still manually access HMS Android SDK directly using Unity SDK Android API.
Unity provides the HMS Plugin here: Unity Asset Store > Huawei HMS Core App Services
The README file contains information about development guides, API references. For more technical questions, please submit a ticket with Unity Customer Service.
Currently Unity does not support the In-App-Purchase (subscription) function. It will be planned in the future.
Update:
For the IAP error:
It is a null pointer. Please check for unassigned objects. If you cannot find anything, please delete project and install again cause sometimes these kind of things happening.

FIREBASE + UNITY [duplicate]

I am struggling a little bit while trying to implement firebase in unity, firebase do not yet provide a unity sdk and I was considering these options:
1) create native plugins for iOS and Android that wraps the firebase sdk and methods that I need
2) use IKVM to create a dll from the firebase .jar, I know someone has done it but I have not read yet about a 100% working method
3) build everything from scratch on top of the firebase REST api
what do you advice? have you got some experience with the topic, someone out there has made firebase work with unity?? :D
thanks
Firebase has officially Unity supported now.
https://firebase.google.com/docs/unity/setup
Import FirebaseAnalytics.unitypackage(Download From Firebase Website Or direct link https://dl.google.com/firebase/sdk/unity/firebase_unity_sdk_1.0.0.zip)
You can look this beta tool, with this u can build for Android and IOS from Unity.
Each Plugin have firebase fun.
https://github.com/unity-plugins/Firebase-Admob-Unity
Google Firebase Unity Admob Plugin
Google Firebase Unity Admob Plugin provides a way to integrate firebase admob ads in Unity3D Game and u3d app. You can use it for Unity iOS and Android App with the same c# or js code.It support all native firebase admob features such as Native Express Ad
Google Firebase Unity Admob Plugin Features
Platforms supported in one plugin :
Android, Based Admob SDK v9.0 (part of Google Firebase service)
iOS, via SDK v7.8.0
Support all native events
AdRequest targeting methods,such as children target,test mode
Not need change Android package name
Very simple API
Based on FireBase SDK Version
Ad Types:
Banner(All Banner Type and Custom banner sizes)
Interstitial (text, picture, video)
Rewarded Video
Native Express Ad
https://github.com/unity-plugins/google-service-unity
Google Service Unity Plugin
Google Service Unity Plugin is a Unity Plugin For Google Service.Include Google Admob Unity,Firebase Analytic Unity,Google Game API Unity. Login,Achievement,Leaderboard,Event,Quest,Snapshot,RealTimePlayGame,TurnbasedPlayGame API are supported and easy to use with c# or js.
Currently it's very easy to add Firebase to your Unity project as long as you follow specific prerequisites. If you're building for Android or iOS then you're good to go, but the same doesn't happen if you're building for WebGL.
According to the documentation, it can be done following the next steps
Create a Firebase project
Register your app with Firebase
Add Firebase configuration files
Add Firebase Unity SDKs

Use OpenStreet Maps in my blackberry application

I would like to use openstreet maps in my blackberry application. The idea is the application fetches the current location through GPS/cell tower. The user has an option to click on a button and load the map within the application (same display) below. I have researched a little and BlackBerry maps seem to be limited and Google Maps requires installing a seperate API. I am hoping to fetch and load the maps through http connection (something like a webservice). Can somebody please guide?
I use the nutiteq library its usefull and it implements the openstreet maps in my blackberry. Here are some links quick start nutiteq RIM BlackBerry Mapping API SDK