Question: My magento version is 2.1.0. How can i get all active shipping method list?

Any help would be highly appreciate

Answer: 
In addition to answer of keyur shah

You can get all active shipping using below code:

```php
protected $scopeConfig; 
protected $shipconfig;

public function __construct(
\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
\Magento\Shipping\Model\Config $shipconfig
) {
    $this->shipconfig = $shipconfig;
    $this->scopeConfig = $scopeConfig;
}

public function getShippingMethods() {
    $activeCarriers = $this->shipconfig->getActiveCarriers();

    foreach($activeCarriers as $carrierCode => $carrierModel) {
       $options = array();

       if ($carrierMethods = $carrierModel->getAllowedMethods()) {
           foreach ($carrierMethods as $methodCode => $method) {
                $code = $carrierCode . '_' . $methodCode;
                $options[] = array('value' => $code, 'label' => $method);
           }
           $carrierTitle = $this->scopeConfig
               ->getValue('carriers/'.$carrierCode.'/title');
        }

        $methods[] = array('value' => $options, 'label' => $carrierTitle);
    }

    return $methods;    
}

```

Using code below you will get list of carrier in phtml file. Here `$block` is related to block in which we have defined above function:

```xml
<?php $carriers = $block->getShippingMethods(); ?>
<select name="shipping"  class="control-select">
   <option value=""><?php /* @escapeNotVerified */ echo __('Please Select'); ?></option>
   <?php foreach ($carriers as $carrier): ?>
   <optgroup label="<?php /* @escapeNotVerified */ echo $carrier['label'] ?>">
      <?php foreach ($carrier['value'] as $child): ?>
      <option value="<?php /* @escapeNotVerified */ echo $child['value'] ?>">
      <?php /* @escapeNotVerified */ echo $child['label']; ?>
      </option>
      <?php endforeach; ?>
   </optgroup>
   <?php endforeach; ?>
</select>

```
```php
 $objectManager = \Magento\Framework\App\ObjectManager::getInstance();        
 $activeShipping = $objectManager->create('Magento\Shipping\Model\Config')
     ->getActiveCarriers();

```

**Note: I am against of direct loading object with `$objectManager`, for better impact you can inject it in your constructor. I have just given example how you can achieve it. `**

**Better way**

```php
protected $_shippingConfig;

public function __construct(\Magento\Shipping\Model\Config $shippingConfig) {
    $this->_shippingConfig = $shippingConfig;
}

```

Now you can get all active shipping method by:

```php
$this->_shippingConfig->getActiveCarriers();

```

If you want get *store specific* active shipping methods then you can pass `$store` object as a parameter:

```
public function getActiveCarriers($store = null)
{
    $carriers = [];
    $config = $this->_scopeConfig->getValue('carriers',
        \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $store);

    foreach (array_keys($config) as $carrierCode) {
        if ($this->_scopeConfig->isSetFlag('carriers/' . $carrierCode . '/active',
            \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $store)) {
            $carrierModel = $this->_carrierFactory->create($carrierCode, $store);
            if ($carrierModel) {
                $carriers[$carrierCode] = $carrierModel;
            }
        }
    }
    return $carriers;
}

```