当前位置: 首页>>代码示例>>C++>>正文


C++ CJNIList::size方法代码示例

本文整理汇总了C++中CJNIList::size方法的典型用法代码示例。如果您正苦于以下问题:C++ CJNIList::size方法的具体用法?C++ CJNIList::size怎么用?C++ CJNIList::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CJNIList的用法示例。


在下文中一共展示了CJNIList::size方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: lock

std::vector<androidPackage> CXBMCApp::GetApplications()
{
  CSingleLock lock(m_applicationsMutex);
  if (m_applications.empty())
  {
    CJNIList<CJNIApplicationInfo> packageList = GetPackageManager().getInstalledApplications(CJNIPackageManager::GET_ACTIVITIES);
    int numPackages = packageList.size();
    for (int i = 0; i < numPackages; i++)
    {
      CJNIIntent intent = GetPackageManager().getLaunchIntentForPackage(packageList.get(i).packageName);
      if (!intent && CJNIBuild::SDK_INT >= 21)
        intent = GetPackageManager().getLeanbackLaunchIntentForPackage(packageList.get(i).packageName);
      if (!intent)
        continue;

      androidPackage newPackage;
      newPackage.packageName = packageList.get(i).packageName;
      newPackage.packageLabel = GetPackageManager().getApplicationLabel(packageList.get(i)).toString();
      newPackage.icon = packageList.get(i).icon;
      m_applications.push_back(newPackage);
    }
  }

  return m_applications;
}
开发者ID:HitcherUK,项目名称:xbmc,代码行数:25,代码来源:XBMCApp.cpp

示例2: ListApplications

bool CXBMCApp::ListApplications(vector<androidPackage> *applications)
{
  CJNIList<CJNIApplicationInfo> packageList = GetPackageManager().getInstalledApplications(CJNIPackageManager::GET_ACTIVITIES);
  int numPackages = packageList.size();
  for (int i = 0; i < numPackages; i++)
  {
    androidPackage newPackage;
    newPackage.packageName = packageList.get(i).packageName;
    newPackage.packageLabel = GetPackageManager().getApplicationLabel(packageList.get(i)).toString();
    CJNIIntent intent = GetPackageManager().getLaunchIntentForPackage(newPackage.packageName);
    if (!intent || !intent.hasCategory("android.intent.category.LAUNCHER"))
      continue;

    applications->push_back(newPackage);
  }
  return true;
}
开发者ID:IljaFedorow,项目名称:xbmc,代码行数:17,代码来源:XBMCApp.cpp

示例3: FindNetworkId

int CAndroidNetworkManager::FindNetworkId(const std::string& ssid)
{
  CJNIWifiManager wifiManager(CJNIContext::getSystemService("wifi"));
  if (!wifiManager)
    return -1;

  CJNIList<CJNIWifiConfiguration> configs = wifiManager.getConfiguredNetworks();

  int numConfigs = configs.size();
  for (int i = 0; i < numConfigs; i++)
  {
    CJNIWifiConfiguration config = configs.get(i);
    if(config && config.getSSID() == "\"" + ssid + "\"")
    {
      return config.getnetworkId();
    }
  }
  return -1;
}
开发者ID:TinyHTPC,项目名称:TOFU-XS-Android-TOFUApp,代码行数:19,代码来源:AndroidNetworkManager.cpp

示例4: GetWifiAccessPoints

void CAndroidNetworkManager::GetWifiAccessPoints()
{
  CAndroidConnectionList connections;
  CJNIWifiManager wifiManager(CJNIContext::getSystemService("wifi"));
  if(!wifiManager || !wifiManager.isWifiEnabled())
  {
    m_wifiAccessPoints = connections;
    return;
  }

  CJNIList<CJNIScanResult> survey = wifiManager.getScanResults();
  if (!survey)
  {
    m_wifiAccessPoints = connections;
    return;
  }

  int numAccessPoints = survey.size();
  for (int i = 0; i < numAccessPoints; i++)
  {
    CJNIScanResult accessPoint = survey.get(i);
    {
      CAndroidConnectionList::iterator i;
      for(i = m_wifiAccessPoints.begin(); i < m_wifiAccessPoints.end(); i++)
      {
        CAndroidConnectionPtr connection(*i);
        if (!connection.get())
          continue;
        if(accessPoint.SSID == connection->GetName())
        {
          connection->Update(accessPoint);
          connections.push_back(connection);
          break;
        }
      }
      if (i == m_wifiAccessPoints.end())
      {
        connections.push_back(CAndroidConnectionPtr(new CAndroidConnection(accessPoint, &m_wifiConnectionEvent)));
      }
    }
  }
  m_wifiAccessPoints = connections;
}
开发者ID:TinyHTPC,项目名称:TOFU-XS-Android-TOFUApp,代码行数:43,代码来源:AndroidNetworkManager.cpp


注:本文中的CJNIList::size方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。