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


C++ CJNIList类代码示例

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


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

示例1: GetPackageManager

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

示例2: 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

示例3: wifiManager

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


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