<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: ManojGunkar</title>
    <description>The latest articles on DEV Community by ManojGunkar (@promanojnoob).</description>
    <link>https://dev.to/promanojnoob</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F808488%2Fcb49f22b-f104-4205-b2ee-1539c9778822.png</url>
      <title>DEV Community: ManojGunkar</title>
      <link>https://dev.to/promanojnoob</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/promanojnoob"/>
    <language>en</language>
    <item>
      <title>Expert: Doctor Consult using RxAndroid and MVVM with Huawei Kits (Account, Map, Identity) in Android App.</title>
      <dc:creator>ManojGunkar</dc:creator>
      <pubDate>Fri, 11 Mar 2022 09:41:15 +0000</pubDate>
      <link>https://dev.to/promanojnoob/expert-doctor-consult-using-rxandroid-and-mvvm-with-huawei-kits-account-map-identity-in-android-app-1lg7</link>
      <guid>https://dev.to/promanojnoob/expert-doctor-consult-using-rxandroid-and-mvvm-with-huawei-kits-account-map-identity-in-android-app-1lg7</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--O4V4gTU5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kkct5hqwjj0rvnaj7dzd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--O4V4gTU5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kkct5hqwjj0rvnaj7dzd.png" alt="Image description" width="880" height="953"&gt;&lt;/a&gt;Overview&lt;br&gt;
In this article, I will create a Doctor Consult Demo App along with the integration of Huawei Id, Map and Identity Kit. Which provides an easy interface to consult with doctor. Users can choose specific doctors and get the doctor details using Huawei User Address.&lt;br&gt;
By reading this article, you'll get an overview of HMS Core Identity, Map and Account Kit, including its functions, open capabilities and business value.&lt;br&gt;
HMS Core Map Service Introduction&lt;br&gt;
HMS Core Map SDK is a set of APIs for map development in Android. The map data covers most countries outside China and supports multiple languages. The Map SDK uses the WGS 84 GPS coordinate system, which can meet most requirements of map development outside China. You can easily add map-related functions in your Android app, including:&lt;br&gt;
Map display: Displays buildings, roads, water systems, and Points of Interest (POIs).&lt;br&gt;
Map interaction: Controls the interaction gestures and buttons on the map.&lt;br&gt;
Map drawing: Adds location markers, map layers, overlays, and various shapes.&lt;/p&gt;

&lt;p&gt;Prerequisite&lt;br&gt;
1.Huawei Phone EMUI 3.0 or later.&lt;br&gt;
2.Non-Huawei phones Android 4.4 or later (API level 19 or higher).&lt;br&gt;
3.Android Studio.&lt;br&gt;
4.AppGallery Account.&lt;/p&gt;

&lt;p&gt;App Gallery Integration process&lt;br&gt;
1.Sign In and Create or Choose a project on AppGallery Connect portal.&lt;br&gt;
2.Navigate to Project settings and download the configuration file.&lt;br&gt;
3.Navigate to General Information, and then provide Data Storage location.&lt;/p&gt;

&lt;p&gt;App Development&lt;br&gt;
1.Create A New Project.&lt;br&gt;
2.Configure Project Gradle.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        google()
        jcenter()
        maven {url 'https://developer.huawei.com/repo/'}
    }
    dependencies {
        classpath "com.android.tools.build:gradle:4.0.1"
        classpath 'com.huawei.agconnect:agcp:1.4.2.300'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven {url 'https://developer.huawei.com/repo/'}
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;3.Configure App Gradle.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//  implementation 'com.huawei.hms:maps:4.0.0.301'
    implementation 'com.huawei.hms:maps:5.0.1.300'
    //site
    implementation 'com.huawei.hms:site:4.0.0.300'
    //location
    implementation 'com.huawei.hms:location:4.0.3.301'

    implementation 'com.squareup.retrofit2:retrofit:2.5.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
    implementation "com.squareup.retrofit2:adapter-rxjava2:2.6.2"

    implementation 'io.reactivex:rxjava:1.3.0'
    implementation 'io.reactivex:rxandroid:1.2.1'
    implementation 'com.android.support:multidex:1.0.3'


    implementation 'com.squareup.okhttp3:logging-interceptor:4.2.2'

    // RxAndroid
    implementation 'io.reactivex.rxjava2:rxjava:2.2.8'
    implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;4.Configure AndroidManifest.xml.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;            android:name="install_channel"
            android:value="AppGallery" /&amp;gt;
        &amp;lt;meta-data
            android:name="com.huawei.hms.client.appid"
            android:value="XXXXXXX" /&amp;gt;`
5.Create Activity class with XML UI.
DirectionActivity:

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;package com.hms.doctorconsultdemo.map;&lt;/p&gt;

&lt;p&gt;import android.Manifest;&lt;br&gt;
import android.content.Intent;&lt;br&gt;
import android.content.IntentSender;&lt;br&gt;
import android.content.pm.PackageManager;&lt;br&gt;
import android.graphics.Color;&lt;br&gt;
import android.graphics.drawable.ColorDrawable;&lt;br&gt;
import android.location.Location;&lt;br&gt;
import android.os.Build;&lt;br&gt;
import android.os.Bundle;&lt;br&gt;
import android.os.Looper;&lt;br&gt;
import android.util.Log;&lt;br&gt;
import android.view.View;&lt;br&gt;
import android.widget.Button;&lt;/p&gt;

&lt;p&gt;import androidx.appcompat.app.ActionBar;&lt;br&gt;
import androidx.appcompat.app.AppCompatActivity;&lt;br&gt;
import androidx.appcompat.widget.Toolbar;&lt;br&gt;
import androidx.cardview.widget.CardView;&lt;br&gt;
import androidx.core.app.ActivityCompat;&lt;br&gt;
import androidx.lifecycle.ViewModelProviders;&lt;/p&gt;

&lt;p&gt;import com.google.android.material.card.MaterialCardView;&lt;br&gt;
import com.hms.doctorconsultdemo.BookAppointmentActivity;&lt;br&gt;
import com.hms.doctorconsultdemo.R;&lt;br&gt;
import com.hms.doctorconsultdemo.map.apiconnector.polylineBody.Destination;&lt;br&gt;
import com.hms.doctorconsultdemo.map.apiconnector.polylineBody.Origin;&lt;br&gt;
import com.hms.doctorconsultdemo.map.apiconnector.polylineBody.PolylineBody;&lt;br&gt;
import com.hms.doctorconsultdemo.map.apiconnector.polylineResponse.Paths;&lt;br&gt;
import com.hms.doctorconsultdemo.map.apiconnector.polylineResponse.Polyline;&lt;br&gt;
import com.hms.doctorconsultdemo.map.apiconnector.polylineResponse.PolylineResponse;&lt;br&gt;
import com.hms.doctorconsultdemo.map.apiconnector.polylineResponse.Routes;&lt;br&gt;
import com.hms.doctorconsultdemo.map.apiconnector.polylineResponse.Steps;&lt;br&gt;
import com.huawei.agconnect.remoteconfig.AGConnectConfig;&lt;br&gt;
import com.huawei.hmf.tasks.OnFailureListener;&lt;br&gt;
import com.huawei.hms.common.ApiException;&lt;br&gt;
import com.huawei.hms.common.ResolvableApiException;&lt;br&gt;
import com.huawei.hms.location.FusedLocationProviderClient;&lt;br&gt;
import com.huawei.hms.location.LocationAvailability;&lt;br&gt;
import com.huawei.hms.location.LocationCallback;&lt;br&gt;
import com.huawei.hms.location.LocationRequest;&lt;br&gt;
import com.huawei.hms.location.LocationResult;&lt;br&gt;
import com.huawei.hms.location.LocationServices;&lt;br&gt;
import com.huawei.hms.location.LocationSettingsRequest;&lt;br&gt;
import com.huawei.hms.location.LocationSettingsStatusCodes;&lt;br&gt;
import com.huawei.hms.location.SettingsClient;&lt;br&gt;
import com.huawei.hms.maps.CameraUpdateFactory;&lt;br&gt;
import com.huawei.hms.maps.HuaweiMap;&lt;br&gt;
import com.huawei.hms.maps.MapView;&lt;br&gt;
import com.huawei.hms.maps.OnMapReadyCallback;&lt;br&gt;
import com.huawei.hms.maps.SupportMapFragment;&lt;br&gt;
import com.huawei.hms.maps.model.LatLng;&lt;br&gt;
import com.huawei.hms.maps.model.MapStyleOptions;&lt;br&gt;
import com.huawei.hms.maps.model.Marker;&lt;br&gt;
import com.huawei.hms.maps.model.MarkerOptions;&lt;br&gt;
import com.huawei.hms.maps.model.PolylineOptions;&lt;/p&gt;

&lt;p&gt;import java.util.ArrayList;&lt;br&gt;
import java.util.HashMap;&lt;br&gt;
import java.util.List;&lt;br&gt;
import java.util.Map;&lt;/p&gt;

&lt;p&gt;public class DirectionActivity extends AppCompatActivity implements OnMapReadyCallback {&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public static final String TAG = "DirectionActivity";
private static final String MAPVIEW_BUNDLE_KEY = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
private HuaweiMap hmap;
private MapView mMapView;
private Marker mMarker;
private List&amp;lt;LatLng&amp;gt; latLngList;

private MapApiViewModel mapApiViewModel;
private CardView cardView;

private LocationCallback mLocationCallback;
private LocationRequest mLocationRequest;
private FusedLocationProviderClient fusedLocationProviderClient;
private SettingsClient settingsClient;


private PolylineBody polylineBody;

private Button btnBooking;

private Map&amp;lt;String, Object&amp;gt; remoteConfigMap;
private AGConnectConfig config;


@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    init();

    remoteConfigMap = new HashMap&amp;lt;&amp;gt;();
    config = AGConnectConfig.getInstance();
    remoteConfigMap.put("mapstyle", "light");
    config.applyDefault(remoteConfigMap);

    SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.mapView);

    mMapView = findViewById(R.id.mapView);
    Bundle mapViewBundle = null;
    if (savedInstanceState != null) {
        mapViewBundle = savedInstanceState.getBundle(MAPVIEW_BUNDLE_KEY);
    }
    mMapView.onCreate(mapViewBundle);
    mMapView.getMapAsync(DirectionActivity.this);
}


private void init() {
    setContentView(R.layout.activity_direction);
    cardView = findViewById(R.id.card_map);
    btnBooking = findViewById(R.id.btn_book_trip);
    btnBooking.setOnClickListener(view -&amp;gt; {
        Intent intent = new Intent(this, BookAppointmentActivity.class);
       startActivity(intent);
    });
    Toolbar toolbar = findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    getSupportActionBar().setDisplayShowHomeEnabled(true);

    Bundle extras = getIntent().getExtras();
    if (extras != null) {
        String name = extras.getString("name");
        String orgLat = extras.getString("orgLat");
        String orgLong = extras.getString("orgLong");
        String desLat = extras.getString("desLat");
        String desLong = extras.getString("desLong");
        boolean tripDisplay = extras.getBoolean("isTrip");

        if (!tripDisplay) {
            cardView.setVisibility(View.GONE);
        } else {
            cardView.setVisibility(View.VISIBLE);
        }

        setTitle(name);
        setLatLong(orgLat, orgLong, desLat, desLong);
    }


    mapApiViewModel = ViewModelProviders.of(this).get(MapApiViewModel.class);

    fusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(this);
    settingsClient = LocationServices.getSettingsClient(this);
    mLocationRequest = new LocationRequest();
    mLocationRequest.setInterval(10000);
    mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
    if (null == mLocationCallback) {
        mLocationCallback = new LocationCallback() {
            @Override
            public void onLocationResult(LocationResult locationResult) {
                if (locationResult != null) {
                    List&amp;lt;Location&amp;gt; locations = locationResult.getLocations();
                    if (!locations.isEmpty()) {
                        for (Location location : locations) {
                            Log.i(TAG,
                                    "onLocationResult location[Longitude,Latitude,Accuracy]:" + location.getLongitude()
                                            + "," + location.getLatitude() + "," + location.getAccuracy());
                        }
                    }
                }
            }

            @Override
            public void onLocationAvailability(LocationAvailability locationAvailability) {
                if (locationAvailability != null) {
                    boolean flag = locationAvailability.isLocationAvailable();
                    Log.i(TAG, TAG + flag);
                }
            }
        };
    }

    // check location permisiion
    if (Build.VERSION.SDK_INT &amp;lt;= Build.VERSION_CODES.P) {
        Log.i(TAG, "sdk &amp;lt; 28 Q");
        if (ActivityCompat.checkSelfPermission(this,
                Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED
                &amp;amp;&amp;amp; ActivityCompat.checkSelfPermission(this,
                Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
            String[] strings =
                    {Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION};
            ActivityCompat.requestPermissions(this, strings, 1);
        }
    } else {
        if (ActivityCompat.checkSelfPermission(this,
                Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED
                &amp;amp;&amp;amp; ActivityCompat.checkSelfPermission(this,
                Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED
                &amp;amp;&amp;amp; ActivityCompat.checkSelfPermission(this,
                "android.permission.ACCESS_BACKGROUND_LOCATION") != PackageManager.PERMISSION_GRANTED) {
            String[] strings = {Manifest.permission.ACCESS_FINE_LOCATION,
                    Manifest.permission.ACCESS_COARSE_LOCATION,
                    "android.permission.ACCESS_BACKGROUND_LOCATION"};
            ActivityCompat.requestPermissions(this, strings, 2);
        }
    }
}

@Override
protected void onStart() {
    super.onStart();
    mMapView.onStart();
}

@Override
protected void onResume() {
    super.onResume();
    mMapView.onResume();
}

@Override
protected void onPause() {
    super.onPause();
    mMapView.onPause();
}

@Override
protected void onStop() {
    super.onStop();
    mMapView.onStop();
}

@Override
protected void onDestroy() {
    super.onDestroy();
    mMapView.onDestroy();
}

@Override
public void onMapReady(HuaweiMap map) {

    hmap = map;

    hmap.setMyLocationEnabled(true);
    hmap.setTrafficEnabled(true);

    hmap.getUiSettings().setRotateGesturesEnabled(true);
    hmap.getUiSettings().setCompassEnabled(false);

    mapApiViewModel.getPolylineLiveData(getPolylineBody()).observe(this, result -&amp;gt; {
        Log.d(TAG, result.toString());
        getPolylineData(result);
    });

    addHMSRemoteConfigListner();
}

private PolylineBody getPolylineBody() {
    return polylineBody;
}

private void setLatLong(String orgLat, String orgLong, String desLat, String desLong) {
    polylineBody = new PolylineBody();
    Origin origin = new Origin();
    origin.setLat(orgLat);
    origin.setLng(orgLong);

    Destination destination = new Destination();
    destination.setLat(desLat);
    destination.setLng(desLong);

    polylineBody.setDestination(destination);
    polylineBody.setOrigin(origin);
}

public void getPolylineData(PolylineResponse polylineResponse) {
    List&amp;lt;Routes&amp;gt; routesList = polylineResponse.getRoutes();
    List&amp;lt;Paths&amp;gt; paths = new ArrayList&amp;lt;&amp;gt;();
    List&amp;lt;Steps&amp;gt; steps = new ArrayList&amp;lt;&amp;gt;();
    List&amp;lt;Polyline&amp;gt; polylines = new ArrayList&amp;lt;&amp;gt;();
    latLngList = new ArrayList&amp;lt;&amp;gt;();

    for (int x = 0; x &amp;lt; routesList.size(); x++) {
        for (Paths paths1 : routesList.get(x).getPaths()) {
            paths.add(paths1);
        }
        for (int y = 0; y &amp;lt; paths.size(); y++) {
            for (Steps step :
                    paths.get(y).getSteps()) {
                steps.add(step);
            }
        }
        for (int i = 0; i &amp;lt; steps.size(); i++) {
            for (Polyline polyline :
                    steps.get(i).getPolyline()) {
                polylines.add(polyline);
            }
        }
    }

    for (int i = 0; i &amp;lt; polylines.size(); i++) {
        latLngList.add(new LatLng(Double.valueOf(polylines.get(i).getLat())
                , Double.valueOf(polylines.get(i).getLng())));
    }

    hmap.animateCamera(CameraUpdateFactory.newLatLngZoom(latLngList.get(0), 12.0f));
    hmap.addMarker(new MarkerOptions().position(latLngList.get(0)));

    hmap.addPolyline(new PolylineOptions()
            .addAll(latLngList)
            .color(Color.BLUE)
            .width(3));

}

private void requestLocationUpdatesWithCallback() {
    try {
        LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder();
        builder.addLocationRequest(mLocationRequest);
        LocationSettingsRequest locationSettingsRequest = builder.build();
        settingsClient.checkLocationSettings(locationSettingsRequest)
                .addOnSuccessListener(locationSettingsResponse -&amp;gt; {
                    Log.i(TAG, "check location settings success");
                    fusedLocationProviderClient
                            .requestLocationUpdates(mLocationRequest, mLocationCallback, Looper.getMainLooper())
                            .addOnSuccessListener(aVoid -&amp;gt; Log.i(TAG, "requestLocationUpdatesWithCallback onSuccess"))
                            .addOnFailureListener(new OnFailureListener() {
                                @Override
                                public void onFailure(Exception e) {
                                    Log.e(TAG,
                                            "requestLocationUpdatesWithCallback onFailure:" + e.getMessage());
                                }
                            });
                })
                .addOnFailureListener(e -&amp;gt; {
                    Log.e(TAG, "checkLocationSetting onFailure:" + e.getMessage());
                    int statusCode = ((ApiException) e).getStatusCode();
                    switch (statusCode) {
                        case LocationSettingsStatusCodes.RESOLUTION_REQUIRED:
                            try {
                                ResolvableApiException rae = (ResolvableApiException) e;
                                rae.startResolutionForResult(DirectionActivity.this, 0);
                            } catch (IntentSender.SendIntentException sie) {
                                Log.e(TAG, "PendingIntent unable to execute request.");
                            }
                            break;
                    }
                });
    } catch (Exception e) {
        Log.e(TAG, "requestLocationUpdatesWithCallback exception:" + e.getMessage());
    }
}

@Override
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
    super.onRequestPermissionsResult(requestCode, permissions, grantResults);
    if (requestCode == 1) {
        if (grantResults.length &amp;gt; 1 &amp;amp;&amp;amp; grantResults[0] == PackageManager.PERMISSION_GRANTED
                &amp;amp;&amp;amp; grantResults[1] == PackageManager.PERMISSION_GRANTED) {
            Log.i(TAG, "onRequestPermissionsResult: apply LOCATION PERMISSION successful");
        } else {
            Log.i(TAG, "onRequestPermissionsResult: apply LOCATION PERMISSSION  failed");
        }
    }

    if (requestCode == 2) {
        if (grantResults.length &amp;gt; 2 &amp;amp;&amp;amp; grantResults[2] == PackageManager.PERMISSION_GRANTED
                &amp;amp;&amp;amp; grantResults[0] == PackageManager.PERMISSION_GRANTED
                &amp;amp;&amp;amp; grantResults[1] == PackageManager.PERMISSION_GRANTED) {
            Log.i(TAG, "onRequestPermissionsResult: apply ACCESS_BACKGROUND_LOCATION successful");
        } else {
            Log.i(TAG, "onRequestPermissionsResult: apply ACCESS_BACKGROUND_LOCATION  failed");
        }
    }
}

private void addHMSRemoteConfigListner() {

    config.fetch(5).addOnSuccessListener(configValues -&amp;gt; {
        config.apply(configValues);
        MapStyleOptions mapStyleOptions;
        String style = config.getValueAsString("mapstyle");
        String colorPrimary = config.getValueAsString("primarycolor");
        Log.d(TAG, "HMS color : " + colorPrimary);

        ActionBar actionBar = getSupportActionBar();
        actionBar.setBackgroundDrawable(new ColorDrawable(Color.parseColor(colorPrimary)));

        if (style.equalsIgnoreCase("dark")) {
            mapStyleOptions = MapStyleOptions.loadRawResourceStyle(DirectionActivity.this, R.raw.mapstyle_night);
            hmap.setMapStyle(mapStyleOptions);
        } else if (style.equalsIgnoreCase("light")) {
            mapStyleOptions = MapStyleOptions.loadRawResourceStyle(DirectionActivity.this, R.raw.mapstyle_day);
            hmap.setMapStyle(mapStyleOptions);
        }
    }).addOnFailureListener((OnFailureListener) e -&amp;gt; {
        Log.d(TAG, e.getMessage());
    });
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

## 
App Build Result

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wfe3ixmzduj5v0v7831m.png)

## 
Tips and Tricks
Map data of Map Kit does not cover the Chinese mainland. Therefore, the Map SDK for Android, Map SDK (Java) for HarmonyOS, JavaScript API, Static Map API, and Directions API of Map Kit are unavailable in the Chinese mainland. For details about locations where the services are available.
The map zoom icons flash on the map on devices running Android 8 or earlier before the map is loaded. (This issue occurs at a low probability in Android 8, but does not occur in versions later than Android 8.)

Layout file (XML file): Set uiZoomControls to false.
Code file: Set the parameter of the HuaweiMapOptions.zoomControlsEnabled(boolean isZoomControlsEnabled) method to false.

## 
Conclusion
In this article, we have learned how to integrate HMS Core Identity and Map in Android application. After completely read this article user can easily implement Huawei User Address and Map APIs by HMS Core Identity, so that User can consult with doctor using Huawei User Address and redirect to Doctor location.
Thanks for reading this article. Be sure to like and comment to this article, if you found it helpful. It means a lot to me.

## 
References
HMS Identity Docs: https://developer.huawei.com/consumer/en/hms/huawei-identitykit/ 
https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/android-sdk-introduction-0000001061991291
HMS Training Videos - 
https://developer.huawei.com/consumer/en/training/

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
    </item>
    <item>
      <title>Expert: Doctor Consult using Dependency Injection with Huawei Kits (Account, Crash, Identity and Analytics) in Android App.</title>
      <dc:creator>ManojGunkar</dc:creator>
      <pubDate>Fri, 04 Mar 2022 09:40:30 +0000</pubDate>
      <link>https://dev.to/promanojnoob/expert-doctor-consult-using-dependency-injection-with-huawei-kits-account-crash-identity-and-analytics-in-android-app-2c0e</link>
      <guid>https://dev.to/promanojnoob/expert-doctor-consult-using-dependency-injection-with-huawei-kits-account-crash-identity-and-analytics-in-android-app-2c0e</guid>
      <description>&lt;p&gt;Overview&lt;br&gt;
In this article, I will create a Doctor Consult Demo App along with the integration of Huawei Id, Crash, Analytics and Identity Kit. Which provides an easy interface to consult with doctor. Users can choose specific doctors and get the doctor details using Huawei User Address.&lt;br&gt;
By reading this article, you'll get an overview of HMS Core Identity, Analytics, Crash and Account Kit, including its functions, open capabilities and business value.&lt;/p&gt;

&lt;p&gt;HMS Core Identity Service Introduction&lt;br&gt;
Hms Core Identity provides an easy interface to add or edit or delete user details and enables the users to authorize apps to access their addresses through a single tap on the screen. That is, app can obtain user addresses in a more convenient way.&lt;/p&gt;

&lt;p&gt;Prerequisite&lt;br&gt;
1.Huawei Phone EMUI 3.0 or later.&lt;br&gt;
2.Non-Huawei phones Android 4.4 or later (API level 19 or higher).&lt;br&gt;
3.Android Studio&lt;br&gt;
4.AppGallery Account.&lt;/p&gt;

&lt;p&gt;App Gallery Integration process&lt;br&gt;
1.Sign In and Create or Choose a project on AppGallery Connect portal.&lt;br&gt;
2.Navigate to Project settings and download the configuration file.&lt;br&gt;
3.Navigate to General Information, and then provide Data Storage location.&lt;/p&gt;

&lt;p&gt;App Development&lt;br&gt;
1.Create A New Project.&lt;br&gt;
2.Configure Project Gradle.&lt;br&gt;
3.Configure App Gradle.&lt;br&gt;
4.Configure AndroidManifest.xml.&lt;br&gt;
5.Create Activity class with XML UI.&lt;/p&gt;

&lt;p&gt;AppModule:&lt;br&gt;
`package com.hms.doctorconsultdemo.di;&lt;/p&gt;

&lt;p&gt;import android.app.Application;&lt;br&gt;
import javax.inject.Singleton;&lt;br&gt;
import dagger.Module;&lt;br&gt;
import dagger.Provides;&lt;/p&gt;

&lt;p&gt;@Module&lt;br&gt;
public class AppModule {&lt;br&gt;
    private Application mApplication;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public AppModule(Application mApplication) {
    this.mApplication = mApplication;
}

@Provides
@Singleton
Application provideApplication() {
    return mApplication;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}`&lt;/p&gt;

&lt;p&gt;ApiModule:&lt;br&gt;
`package com.hms.doctorconsultdemo.di;&lt;/p&gt;

&lt;p&gt;import android.app.Application;&lt;/p&gt;

&lt;p&gt;import com.google.gson.FieldNamingPolicy;&lt;br&gt;
import com.google.gson.Gson;&lt;br&gt;
import com.google.gson.GsonBuilder;&lt;/p&gt;

&lt;p&gt;import javax.inject.Singleton;&lt;/p&gt;

&lt;p&gt;import dagger.Module;&lt;br&gt;
import dagger.Provides;&lt;br&gt;
import okhttp3.Cache;&lt;br&gt;
import okhttp3.OkHttpClient;&lt;br&gt;
import retrofit2.Retrofit;&lt;br&gt;
import retrofit2.converter.gson.GsonConverterFactory;&lt;/p&gt;

&lt;p&gt;@Module&lt;br&gt;
public class ApiModule {&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;String mBaseUrl;

public ApiModule(String mBaseUrl) {
    this.mBaseUrl = mBaseUrl;
}


@Provides
@Singleton
Cache provideHttpCache(Application application) {
    int cacheSize = 10 * 1024 * 1024;
    Cache cache = new Cache(application.getCacheDir(), cacheSize);
    return cache;
}

@Provides
@Singleton
Gson provideGson() {
    GsonBuilder gsonBuilder = new GsonBuilder();
    gsonBuilder.setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES);
    return gsonBuilder.create();
}

@Provides
@Singleton
OkHttpClient provideOkhttpClient(Cache cache) {
    OkHttpClient.Builder client = new OkHttpClient.Builder();
    client.cache(cache);
    return client.build();
}

@Provides
@Singleton
Retrofit provideRetrofit(Gson gson, OkHttpClient okHttpClient) {
    return new Retrofit.Builder()
            .addConverterFactory(GsonConverterFactory.create(gson))
            .baseUrl(mBaseUrl)
            .client(okHttpClient)
            .build();
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;br&gt;
`&lt;/p&gt;

&lt;p&gt;ApiComponent:&lt;br&gt;
`package com.hms.doctorconsultdemo.di;&lt;br&gt;
import com.hms.doctorconsultdemo.MainActivity;&lt;/p&gt;

&lt;p&gt;import javax.inject.Singleton;&lt;br&gt;
import dagger.Component;&lt;/p&gt;

&lt;p&gt;@Singleton&lt;br&gt;
@Component(modules = {AppModule.class, ApiModule.class})&lt;br&gt;
public interface ApiComponent {&lt;br&gt;
    void inject(MainActivity activity);&lt;br&gt;
}&lt;code&gt;&lt;br&gt;
MyApplication:&lt;br&gt;
&lt;/code&gt;package com.hms.doctorconsultdemo;&lt;br&gt;
import android.app.Application;&lt;/p&gt;

&lt;p&gt;import com.hms.doctorconsultdemo.di.ApiComponent;&lt;br&gt;
import com.hms.doctorconsultdemo.di.ApiModule;&lt;br&gt;
import com.hms.doctorconsultdemo.di.AppModule;&lt;br&gt;
import com.hms.doctorconsultdemo.di.DaggerApiComponent;&lt;/p&gt;

&lt;p&gt;public class MyApplication extends Application {&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;private ApiComponent mApiComponent;

@Override
public void onCreate() {
    super.onCreate();

    mApiComponent = DaggerApiComponent.builder()
            .appModule(new AppModule(this))
            .apiModule(new ApiModule("REST_API_URL"))
            .build();
}

public ApiComponent getNetComponent() {
    return mApiComponent;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;code&gt;&lt;br&gt;
MainActivity:&lt;br&gt;
&lt;/code&gt;package com.hms.doctorconsultdemo;&lt;/p&gt;

&lt;p&gt;import android.content.Intent;&lt;br&gt;
import android.os.Bundle;&lt;br&gt;
import android.util.Log;&lt;br&gt;
import android.view.View;&lt;br&gt;
import android.widget.Button;&lt;/p&gt;

&lt;p&gt;import androidx.appcompat.app.AppCompatActivity;&lt;/p&gt;

&lt;p&gt;import com.huawei.hmf.tasks.Task;&lt;br&gt;
import com.huawei.hms.common.ApiException;&lt;br&gt;
import com.huawei.hms.support.hwid.HuaweiIdAuthManager;&lt;br&gt;
import com.huawei.hms.support.hwid.request.HuaweiIdAuthParams;&lt;br&gt;
import com.huawei.hms.support.hwid.request.HuaweiIdAuthParamsHelper;&lt;br&gt;
import com.huawei.hms.support.hwid.result.AuthHuaweiId;&lt;br&gt;
import com.huawei.hms.support.hwid.service.HuaweiIdAuthService;&lt;/p&gt;

&lt;p&gt;public class MainActivity extends AppCompatActivity implements View.OnClickListener {&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;private static final int REQUEST_SIGN_IN_LOGIN = 1002;
private static String TAG = MainActivity.class.getName();
private HuaweiIdAuthService mAuthManager;
private HuaweiIdAuthParams mAuthParam;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    Button view = findViewById(R.id.btn_sign);
    view.setOnClickListener(this);

}

private void signIn() {
    mAuthParam = new HuaweiIdAuthParamsHelper(HuaweiIdAuthParams.DEFAULT_AUTH_REQUEST_PARAM)
            .setIdToken()
            .setAccessToken()
            .createParams();
    mAuthManager = HuaweiIdAuthManager.getService(this, mAuthParam);
    startActivityForResult(mAuthManager.getSignInIntent(), REQUEST_SIGN_IN_LOGIN);
}

@Override
public void onClick(View v) {
    switch (v.getId()) {
        case R.id.btn_sign:
            signIn();
            break;
    }
}

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (requestCode == REQUEST_SIGN_IN_LOGIN) {
        Task&amp;lt;AuthHuaweiId&amp;gt; authHuaweiIdTask = HuaweiIdAuthManager.parseAuthResultFromIntent(data);
        if (authHuaweiIdTask.isSuccessful()) {
            AuthHuaweiId huaweiAccount = authHuaweiIdTask.getResult();
            Log.i(TAG, huaweiAccount.getDisplayName() + " signIn success ");
            Log.i(TAG, "AccessToken: " + huaweiAccount.getAccessToken());

            Intent intent = new Intent(this, HomeActivity.class);
            intent.putExtra("user", huaweiAccount.getDisplayName());
            startActivity(intent);
            this.finish();

        } else {
            Log.i(TAG, "signIn failed: " + ((ApiException) authHuaweiIdTask.getException()).getStatusCode());
        }
    }

}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}`&lt;/p&gt;

&lt;p&gt;App Build Result&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--27mPTq_s--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zgsu8mbajfn9yu52sn5c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--27mPTq_s--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zgsu8mbajfn9yu52sn5c.png" alt="Image description" width="880" height="889"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Tips and Tricks&lt;br&gt;
Identity Kit displays the HUAWEI ID registration or sign-in page first. The user can use the functions provided by Identity Kit only after signing in using a registered HUAWEI ID.&lt;br&gt;
A maximum of 10 user addresses are allowed.&lt;br&gt;
If HMS Core (APK) is installed on a mobile phone, check the version. If the version is earlier than 4.0.0, upgrade it to 4.0.0 or later. If the version is 4.0.0 or later, you can call the HMS Core Identity SDK to use the capabilities.&lt;/p&gt;

&lt;p&gt;Conclusion&lt;br&gt;
In this article, we have learned how to integrate HMS Core Identity in Android application. After completely read this article user can easily implement Huawei User Address APIs by HMS Core Identity, so that User can consult with doctor using Huawei User Address.&lt;br&gt;
Thanks for reading this article. Be sure to like and comment to this article, if you found it helpful. It means a lot to me.&lt;/p&gt;

&lt;p&gt;References&lt;br&gt;
HMS Identity Docs: &lt;a href="https://developer.huawei.com/consumer/en/hms/huawei-identitykit/"&gt;https://developer.huawei.com/consumer/en/hms/huawei-identitykit/&lt;/a&gt; &lt;br&gt;
Identity Kit - &lt;a href="https://developer.huawei.com/consumer/en/training/course/video/101582966949059136"&gt;https://developer.huawei.com/consumer/en/training/course/video/101582966949059136&lt;/a&gt; &lt;/p&gt;

</description>
      <category>hms</category>
      <category>codereview</category>
    </item>
    <item>
      <title>Intermediate: Know Your Doctor using Huawei Kits (Account, Crash and Analytics) in Android App.</title>
      <dc:creator>ManojGunkar</dc:creator>
      <pubDate>Fri, 25 Feb 2022 09:11:43 +0000</pubDate>
      <link>https://dev.to/promanojnoob/intermediate-know-your-doctor-using-huawei-kits-account-crash-and-analytics-in-android-app-14c1</link>
      <guid>https://dev.to/promanojnoob/intermediate-know-your-doctor-using-huawei-kits-account-crash-and-analytics-in-android-app-14c1</guid>
      <description>&lt;h2&gt;
  
  
  Overview
&lt;/h2&gt;

&lt;p&gt;In this article, I will create a DoctorConsultApp android application in which I will integrate HMS Core kits such as Huawei ID, Crash and Analytics.&lt;/p&gt;

&lt;h2&gt;
  
  
  Huawei ID Service Introduction
&lt;/h2&gt;

&lt;p&gt;Huawei ID login provides you with simple, secure, and quick sign-in and authorization functions. Instead of entering accounts and passwords and waiting for authentication, users can just tap the Sign in with HUAWEI ID button to quickly and securely sign in to your app with their HUAWEI IDs.&lt;/p&gt;

&lt;p&gt;Prerequisite&lt;br&gt;
1.Huawei Phone EMUI 3.0 or later.&lt;br&gt;
2.Non-Huawei phones Android 4.4 or later (API level 19 or higher).&lt;br&gt;
3.HMS Core APK 4.0.0.300 or later&lt;br&gt;
4.Android Studio&lt;br&gt;
5.AppGallery Account.&lt;/p&gt;

&lt;h2&gt;
  
  
  App Gallery Integration process
&lt;/h2&gt;

&lt;p&gt;1.Sign In and Create or Choose a project on AppGallery Connect portal.&lt;br&gt;
2.Navigate to Project settings and download the configuration file.&lt;br&gt;
3.Navigate to General Information, and then provide Data Storage location.&lt;/p&gt;

&lt;h2&gt;
  
  
  App Development
&lt;/h2&gt;

&lt;p&gt;1.Create A New Project.&lt;br&gt;
2.Configure Project Gradle.&lt;br&gt;
3.Configure App Gradle.&lt;br&gt;
&lt;code&gt;implementation 'com.huawei.hms:identity:5.3.0.300'&lt;br&gt;
    implementation 'com.huawei.agconnect:agconnect-auth:1.4.1.300'&lt;br&gt;
    implementation 'com.huawei.hms:hwid:5.3.0.302'&lt;/code&gt;&lt;br&gt;
4.Configure AndroidManifest.xml.&lt;br&gt;
&lt;code&gt;&amp;lt;uses-permission android:name="android.permission.INTERNET" /&amp;gt;&lt;br&gt;
    &amp;lt;uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /&amp;gt;&lt;/code&gt;&lt;br&gt;
5.Create Activity class with XML UI.&lt;br&gt;
MainActivity:&lt;br&gt;
`&lt;br&gt;
public class MainActivity extends AppCompatActivity {&lt;br&gt;
    Toolbar t;&lt;br&gt;
    DrawerLayout drawer;&lt;br&gt;
    EditText nametext;&lt;br&gt;
    EditText agetext;&lt;br&gt;
    ImageView enter;&lt;br&gt;
    RadioButton male;&lt;br&gt;
    RadioButton female;&lt;br&gt;
    RadioGroup rg;&lt;br&gt;
    @Override&lt;br&gt;
    protected void onCreate(Bundle savedInstanceState) {&lt;br&gt;
        super.onCreate(savedInstanceState);&lt;br&gt;
        setContentView(R.layout.activity_main);&lt;br&gt;
        drawer = findViewById(R.id.draw_activity);&lt;br&gt;
        t = (Toolbar) findViewById(R.id.toolbar);&lt;br&gt;
        nametext = findViewById(R.id.nametext);&lt;br&gt;
        agetext = findViewById(R.id.agetext);&lt;br&gt;
        enter = findViewById(R.id.imageView7);&lt;br&gt;
        male = findViewById(R.id.male);&lt;br&gt;
        female = findViewById(R.id.female);&lt;br&gt;
        rg=findViewById(R.id.rg1);&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawer, t, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
    drawer.addDrawerListener(toggle);
    toggle.syncState();
    NavigationView nav = findViewById(R.id.nav_view);
    enter.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            String name = nametext.getText().toString();
            String age = agetext.getText().toString();
            String gender= new String();
            int id=rg.getCheckedRadioButtonId();
            switch(id)
            {
                case R.id.male:
                    gender = "Mr.";
                    break;
                case R.id.female:
                    gender = "Ms.";
                    break;
            }
            Intent symp = new Intent(MainActivity.this, SymptomsActivity.class);
            symp.putExtra("name",name);
            symp.putExtra("gender",gender);
            startActivity(symp);

        }
    });
    nav.setNavigationItemSelectedListener(new NavigationView.OnNavigationItemSelectedListener() {
        @Override
        public boolean onNavigationItemSelected(@NonNull MenuItem menuItem) {
            switch(menuItem.getItemId())
            {
                case R.id.nav_sos:
                    Intent in = new Intent(MainActivity.this, call.class);
                    startActivity(in);
                break;

                case R.id.nav_share:
                    Intent myIntent = new Intent(Intent.ACTION_SEND);
                    myIntent.setType("text/plain");
                    startActivity(Intent.createChooser(myIntent,"SHARE USING"));
                    break;

                case R.id.nav_hosp:
                    Intent browserIntent = new Intent(Intent.ACTION_VIEW);
                    browserIntent.setData(Uri.parse("https://www.google.com/maps/search/hospitals+near+me"));
                    startActivity(browserIntent);
                    break;
                case R.id.nav_cntus:
                    Intent c_us = new Intent(MainActivity.this, activity_contact_us.class);
                    startActivity(c_us);
                    break;

            }
            drawer.closeDrawer(GravityCompat.START);
            return true;
        }
    });
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;br&gt;
`&lt;/p&gt;

&lt;h2&gt;
  
  
  App Build Result
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wVct7v1J--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/loiwvktb54voh3604uh1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wVct7v1J--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/loiwvktb54voh3604uh1.png" alt="Image description" width="880" height="300"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Tips and Tricks
&lt;/h2&gt;

&lt;p&gt;Identity Kit displays the HUAWEI ID registration or sign-in page first. You can use the functions provided by Identity Kit only after signing in by a registered HUAWEI ID.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In this article, we have learned how to integrate Huawei ID in Android application. After completely read this article, user can easily implement Huawei ID in DoctorConsultApp application.&lt;br&gt;
Thanks for reading this article. Be sure to like and comment to this article, if you found it helpful. It means a lot to me.&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;p&gt;HMS Docs:&lt;br&gt;
&lt;a href="https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/introduction-0000001050048870"&gt;https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/introduction-0000001050048870&lt;/a&gt;&lt;br&gt;
Video Training:&lt;br&gt;
&lt;a href="https://developer.huawei.com/consumer/en/training/course/video/101583015541549183"&gt;https://developer.huawei.com/consumer/en/training/course/video/101583015541549183&lt;/a&gt;&lt;/p&gt;

</description>
      <category>hmscore</category>
    </item>
    <item>
      <title>Intermediate: Find Doctor Near to Me using Huawei Kits (Account, Crash and Analytics) in Android App </title>
      <dc:creator>ManojGunkar</dc:creator>
      <pubDate>Fri, 18 Feb 2022 08:37:38 +0000</pubDate>
      <link>https://dev.to/promanojnoob/intermediate-find-doctor-near-to-me-using-huawei-kits-account-crash-and-analytics-in-android-app-2n6h</link>
      <guid>https://dev.to/promanojnoob/intermediate-find-doctor-near-to-me-using-huawei-kits-account-crash-and-analytics-in-android-app-2n6h</guid>
      <description>&lt;p&gt;Overview&lt;br&gt;
In this article, I will create a FindDoctorNearMe android application in which I will integrate HMS Core kits such as Huawei ID, Crash and Analytics.&lt;br&gt;
Huawei ID Service Introduction&lt;br&gt;
Huawei ID login provides you with simple, secure, and quick sign-in and authorization functions. Instead of entering accounts and passwords and waiting for authentication, users can just tap the Sign in with HUAWEI ID button to quickly and securely sign in to your app with their HUAWEI IDs.&lt;br&gt;
Prerequisite&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Huawei Phone EMUI 3.0 or later.&lt;/li&gt;
&lt;li&gt; Non-Huawei phones Android 4.4 or later (API level 19 or higher).&lt;/li&gt;
&lt;li&gt; HMS Core APK 4.0.0.300 or later&lt;/li&gt;
&lt;li&gt; Android Studio&lt;/li&gt;
&lt;li&gt; AppGallery Account.
App Gallery Integration process&lt;/li&gt;
&lt;li&gt; Sign In and Create or Choose a project on AppGallery Connect portal.&lt;/li&gt;
&lt;li&gt; Navigate to Project settings and download the configuration file.&lt;/li&gt;
&lt;li&gt; Navigate to General Information, and then provide Data Storage location.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;App Development&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Create A New Project.&lt;/li&gt;
&lt;li&gt; Configure Project Gradle.&lt;/li&gt;
&lt;li&gt; Configure App Gradle.&lt;/li&gt;
&lt;li&gt; Configure AndroidManifest.xml.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create Activity class with XML UI.&lt;br&gt;
MainActivity:&lt;br&gt;
`public class MainActivity extends AppCompatActivity implements View.OnClickListener {&lt;/p&gt;

&lt;p&gt;private static final int REQUEST_SIGN_IN_LOGIN = 1002;&lt;br&gt;
private static String TAG = MainActivity.class.getName();&lt;br&gt;
private HuaweiIdAuthService mAuthManager;&lt;br&gt;
private HuaweiIdAuthParams mAuthParam;&lt;/p&gt;

&lt;p&gt;@Override&lt;br&gt;
protected void onCreate(Bundle savedInstanceState) {&lt;br&gt;
    super.onCreate(savedInstanceState);&lt;br&gt;
    setContentView(R.layout.activity_main);&lt;br&gt;
    Button view = findViewById(R.id.btn_sign);&lt;br&gt;
    view.setOnClickListener(this);&lt;/p&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;private void signIn() {&lt;br&gt;
    mAuthParam = new HuaweiIdAuthParamsHelper(HuaweiIdAuthParams.DEFAULT_AUTH_REQUEST_PARAM)&lt;br&gt;
            .setIdToken()&lt;br&gt;
            .setAccessToken()&lt;br&gt;
            .createParams();&lt;br&gt;
    mAuthManager = HuaweiIdAuthManager.getService(this, mAuthParam);&lt;br&gt;
    startActivityForResult(mAuthManager.getSignInIntent(), REQUEST_SIGN_IN_LOGIN);&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;@Override&lt;br&gt;
public void onClick(View v) {&lt;br&gt;
    switch (v.getId()) {&lt;br&gt;
        case R.id.btn_sign:&lt;br&gt;
            signIn();&lt;br&gt;
            break;&lt;br&gt;
    }&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;@Override&lt;br&gt;
protected void onActivityResult(int requestCode, int resultCode, Intent data) {&lt;br&gt;
    super.onActivityResult(requestCode, resultCode, data);&lt;br&gt;
    if (requestCode == REQUEST_SIGN_IN_LOGIN) {&lt;br&gt;
        Task authHuaweiIdTask = HuaweiIdAuthManager.parseAuthResultFromIntent(data);&lt;br&gt;
        if (authHuaweiIdTask.isSuccessful()) {&lt;br&gt;
            AuthHuaweiId huaweiAccount = authHuaweiIdTask.getResult();&lt;br&gt;
            Log.i(TAG, huaweiAccount.getDisplayName() + " signIn success ");&lt;br&gt;
            Log.i(TAG, "AccessToken: " + huaweiAccount.getAccessToken());&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;        Intent intent = new Intent(this, HomeActivity.class);
        intent.putExtra("user", huaweiAccount.getDisplayName());
        startActivity(intent);
        this.finish();

    } else {
        Log.i(TAG, "signIn failed: " + ((ApiException) authHuaweiIdTask.getException()).getStatusCode());
    }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;}&lt;br&gt;
}`&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Xml:&lt;br&gt;
`&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;br&gt;

    android:layout_width="match_parent"&lt;br&gt;
    android:layout_height="match_parent"&lt;br&gt;
    android:background="@color/colorPrimaryDark"&amp;gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;ScrollView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_centerHorizontal="true"
    android:layout_centerVertical="true"
    android:gravity="center"&amp;gt;

    &amp;lt;LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        android:padding="16dp"&amp;gt;


        &amp;lt;TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:padding="5dp"
            android:text="Find Doctor Near Me"
            android:textAlignment="center"
            android:textColor="@color/colorAccent"
            android:textSize="34sp"
            android:textStyle="bold" /&amp;gt;


        &amp;lt;Button
            android:id="@+id/btn_sign"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="20dp"
            android:layout_marginBottom="5dp"
            android:background="@color/colorPrimary"
            android:text="Login With Huawei Id"
            android:textColor="@color/hwid_auth_button_color_white"
            android:textStyle="bold" /&amp;gt;


    &amp;lt;/LinearLayout&amp;gt;

&amp;lt;/ScrollView&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;br&gt;
`&lt;/p&gt;

&lt;p&gt;App Build Result&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--B3rI9V1L--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/31zfedlokv665r5ol6cd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--B3rI9V1L--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/31zfedlokv665r5ol6cd.png" alt="Image description" width="880" height="435"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Tips and Tricks&lt;br&gt;
Identity Kit displays the HUAWEI ID registration or sign-in page first. You can use the functions provided by Identity Kit only after signing in using a registered HUAWEI ID.&lt;br&gt;
Conclusion&lt;br&gt;
In this article, we have learned how to integrate Huawei ID in Android application. After completely read this article user can easily implement Huawei ID in the FindDoctorNearMe application.&lt;br&gt;
Thanks for reading this article. Be sure to like and comment to this article, if you found it helpful. It means a lot to me.&lt;br&gt;
References&lt;br&gt;
HMS Docs:&lt;br&gt;
&lt;a href="https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/introduction-0000001050048870"&gt;https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/introduction-0000001050048870&lt;/a&gt;&lt;br&gt;
Account Kit - Training Video&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Demo</title>
      <dc:creator>ManojGunkar</dc:creator>
      <pubDate>Mon, 14 Feb 2022 13:15:43 +0000</pubDate>
      <link>https://dev.to/promanojnoob/demo-563n</link>
      <guid>https://dev.to/promanojnoob/demo-563n</guid>
      <description></description>
    </item>
    <item>
      <title>Intermediate: Consult Doctor for Disease using Huawei Kits (Account, Crash and Analytics) in Android App </title>
      <dc:creator>ManojGunkar</dc:creator>
      <pubDate>Fri, 04 Feb 2022 07:08:12 +0000</pubDate>
      <link>https://dev.to/promanojnoob/intermediate-consult-doctor-for-disease-using-huawei-kits-account-crash-and-analytics-in-android-app-b7e</link>
      <guid>https://dev.to/promanojnoob/intermediate-consult-doctor-for-disease-using-huawei-kits-account-crash-and-analytics-in-android-app-b7e</guid>
      <description>&lt;p&gt;Overview&lt;br&gt;
In this article, I will create a Doctor Consult android application in which I will integrate HMS Core kits such as Huawei ID, Crash and Analytics.&lt;br&gt;
Huawei ID Service Introduction&lt;br&gt;
Huawei ID login provides you with simple, secure, and quick sign-in and authorization functions. Instead of entering accounts and passwords and waiting for authentication, users can just tap the Sign in with HUAWEI ID button to quickly and securely sign in to your app with their HUAWEI IDs.&lt;br&gt;
Prerequisite&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Huawei Phone EMUI 3.0 or later.&lt;/li&gt;
&lt;li&gt; Non-Huawei phones Android 4.4 or later (API level 19 or higher).&lt;/li&gt;
&lt;li&gt; HMS Core APK 4.0.0.300 or later&lt;/li&gt;
&lt;li&gt; Android Studio&lt;/li&gt;
&lt;li&gt; AppGallery Account.
App Gallery Integration process&lt;/li&gt;
&lt;li&gt; Sign In and Create or Choose a project on AppGallery Connect portal.&lt;/li&gt;
&lt;li&gt; Navigate to Project settings and download the configuration file.&lt;/li&gt;
&lt;li&gt; Navigate to General Information, and then provide Data Storage location.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;App Development&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Create A New Project.&lt;/li&gt;
&lt;li&gt; Configure Project Gradle.&lt;/li&gt;
&lt;li&gt; Configure App Gradle.&lt;/li&gt;
&lt;li&gt; Configure AndroidManifest.xml.&lt;/li&gt;
&lt;li&gt; Create Activity class with XML UI.
MainActivity:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class MainActivity extends AppCompatActivity {
    Toolbar t;
    DrawerLayout drawer;
    EditText nametext;
    EditText agetext;
    ImageView enter;
    RadioButton male;
    RadioButton female;
    RadioGroup rg;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        drawer = findViewById(R.id.draw_activity);
        t = (Toolbar) findViewById(R.id.toolbar);
        nametext = findViewById(R.id.nametext);
        agetext = findViewById(R.id.agetext);
        enter = findViewById(R.id.imageView7);
        male = findViewById(R.id.male);
        female = findViewById(R.id.female);
        rg=findViewById(R.id.rg1);

        ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawer, t, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
        drawer.addDrawerListener(toggle);
        toggle.syncState();
        NavigationView nav = findViewById(R.id.nav_view);
        enter.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                String name = nametext.getText().toString();
                String age = agetext.getText().toString();
                String gender= new String();
                int id=rg.getCheckedRadioButtonId();
                switch(id)
                {
                    case R.id.male:
                        gender = "Mr.";
                        break;
                    case R.id.female:
                        gender = "Ms.";
                        break;
                }
                Intent symp = new Intent(MainActivity.this, SymptomsActivity.class);
                symp.putExtra("name",name);
                symp.putExtra("gender",gender);
                startActivity(symp);

            }
        });
        nav.setNavigationItemSelectedListener(new NavigationView.OnNavigationItemSelectedListener() {
            @Override
            public boolean onNavigationItemSelected(@NonNull MenuItem menuItem) {
                switch(menuItem.getItemId())
                {
                    case R.id.nav_sos:
                        Intent in = new Intent(MainActivity.this, call.class);
                        startActivity(in);
                    break;

                    case R.id.nav_share:
                        Intent myIntent = new Intent(Intent.ACTION_SEND);
                        myIntent.setType("text/plain");
                        startActivity(Intent.createChooser(myIntent,"SHARE USING"));
                        break;

                    case R.id.nav_hosp:
                        Intent browserIntent = new Intent(Intent.ACTION_VIEW);
                        browserIntent.setData(Uri.parse("https://www.google.com/maps/search/hospitals+near+me"));
                        startActivity(browserIntent);
                        break;
                    case R.id.nav_cntus:
                        Intent c_us = new Intent(MainActivity.this, activity_contact_us.class);
                        startActivity(c_us);
                        break;

                }
                drawer.closeDrawer(GravityCompat.START);
                return true;
            }
        });
    }



}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;App Build Result&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5AtgTUIE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0uyq2m0rty4316kazd90.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5AtgTUIE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0uyq2m0rty4316kazd90.jpg" alt="Image description" width="880" height="906"&gt;&lt;/a&gt;&lt;br&gt;
Tips and Tricks&lt;br&gt;
Identity Kit displays the HUAWEI ID registration or sign-in page first. You can use the functions provided by Identity Kit only after signing in using a registered HUAWEI ID.&lt;br&gt;
Conclusion&lt;br&gt;
In this article, we have learned how to integrate Huawei ID in Android application. After completely read this article user can easily implement Huawei ID in the Doctor Consult application.&lt;br&gt;
Thanks for reading this article. Be sure to like and comment to this article, if you found it helpful. It means a lot to me.&lt;br&gt;
References&lt;br&gt;
HMS Docs:&lt;br&gt;
&lt;a href="https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/introduction-0000001050048870"&gt;https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/introduction-0000001050048870&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
