# Example code

Source: [https://docs.qualcomm.com/doc/80-PK177-134/topic/wwan_standard_example_code.html](https://docs.qualcomm.com/doc/80-PK177-134/topic/wwan_standard_example_code.html)

This section highlights complete code to make use of WWAN\_STANDARD subsystem
        APIs.

## Java

**Required imports**

    private IQesdk mQesdkManager;
    private WWANStandardManager mWwanStandardManager;
    private WWANPremiumManager mWwanPremiumManager;Copy to clipboard

**Create the QESDK Manager instance**

    mQesdkManager = IQesdk.createInstance(this);Copy to clipboard

**Create WWANStandardManager instance**

    mWwanStandardManager = new WWANStandardManager(mQesdkManager);Copy to clipboard

**Set up                callbacks**

    private IWWANStandardCBs.ILocationReportCallback wwanStandardLocationReportCallback;
    private IWWANStandardCBs.ILocationReportCallback wwanStandardPassiveLocationReportCallback;Copy to clipboard

**Send request to start location updates**

    mWwanStandardManager.requestNetworkLocationUpdates(
            mApiToExecute.minIntervalMillis,
            wwanStandardLocationReportCallback);Copy to clipboard

**Receive the network location reports in the registered callback**

## Native

**Required includes**

    #include  "qesdk_ndk.h" 
    #include “qesdk_Location_WWAN_STANDARD.h"Copy to clipboard

**Create WWANStandardManager instance**

    wwanStandardManager = new WWAN_STANDARDManager(); 
    int ret = wwanStandardManager->init(licenseStr, license_length, [](uint32_t opcodes, uint32_t *subsystems) {	 // Callback to handle init events
     });
    int ret = rlManager->init(licenseStr, icense_length,[] (uint32_t opcodes, uint32_t *subsystems){
    // Callback to handle init events
    });Copy to clipboard

**Send request to start location updates**

    qesdk_transaction_status qesdk_ndk_response = wwanStandardManager->requestNetworkLocationUpdates(min_interval_millis, [](wwan_standard_Location location){
        // Location Report Callback handle 
    }, qsap_api_response);
    
    if(qesdk_ndk_response.is_ok()){
        // Use the ret value
    } else {
        // Can get error code by get_error_code()
    }Copy to clipboard

**Send request to stop location                updates**

    qesdk_transaction_status qesdk_ndk_response = wwanStandardManager->removeNetworkLocationUpdates(qsap_api_response);
    if(qesdk_ndk_response.is_ok()) {
        // Use the ret value
    }
    else {
        // Can get error code by get_error_code()
    }Copy to clipboard

**Parent Topic:** [WWAN standard](https://docs.qualcomm.com/doc/80-PK177-134/topic/wwan_standard.html)

Last Published: Nov 14, 2024

[Previous Topic
Location](https://docs.qualcomm.com/bundle/publicresource/80-PK177-134/topics/wwan_standard_location.md) [Next Topic
WWAN premium](https://docs.qualcomm.com/bundle/publicresource/80-PK177-134/topics/wwan_premium.md)