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