本文整理汇总了Java中com.android.sdklib.repository.AndroidSdkHandler类的典型用法代码示例。如果您正苦于以下问题:Java AndroidSdkHandler类的具体用法?Java AndroidSdkHandler怎么用?Java AndroidSdkHandler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AndroidSdkHandler类属于com.android.sdklib.repository包,在下文中一共展示了AndroidSdkHandler类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPlatformVersion
import com.android.sdklib.repository.AndroidSdkHandler; //导入依赖的package包/类
@VisibleForTesting
@Nullable
static String getPlatformVersion(@NonNull LintClient client) {
AndroidSdkHandler sdk = client.getSdk();
if (sdk != null) {
LocalPackage pkgInfo = sdk
.getLocalPackage(SdkConstants.FD_PLATFORM_TOOLS, client.getRepositoryLogger());
if (pkgInfo != null) {
return pkgInfo.getVersion().toShortString();
}
}
return null;
}
示例2: setSdkRootFolder
import com.android.sdklib.repository.AndroidSdkHandler; //导入依赖的package包/类
@Override
public void setSdkRootFolder(String sdkPath) {
String last = this.sdkPath;
this.sdkPath = sdkPath;
sdkRoot = new File(sdkPath);
sdkRootFo = FileUtil.toFileObject(sdkRoot);
firePropertyChange(LOCATION, last, sdkPath);
platforms.clear();
platformsList.clear();
final Runnable runnable = new Runnable() {
@Override
public void run() {
androidSdkHandler = AndroidSdkHandler.getInstance(sdkRoot);
if (androidSdkHandler != null) {
repoManager = androidSdkHandler.getSdkManager(new NbOutputWindowProgressIndicator());
repoManager.registerLocalChangeListener(AndroidSdkImpl.this);
repoManager.registerRemoteChangeListener(AndroidSdkImpl.this);
androidTargetManager = androidSdkHandler.getAndroidTargetManager(new NbOutputWindowProgressIndicator() {
});
updateSdkPlatformPackages();
scheduledThreadPool.scheduleWithFixedDelay(new Runnable() {
@Override
public void run() {
repoManager.reloadLocalIfNeeded(new NbOutputWindowProgressIndicator());
}
}, 30, 30, TimeUnit.SECONDS);
} else {
repoManager = null;
}
}
};
WindowManager.getDefault().invokeWhenUIReady(new Runnable() {
@Override
public void run() {
AndroidSdk.pool.submit(runnable);
}
});
}
示例3: getBuildTool
import com.android.sdklib.repository.AndroidSdkHandler; //导入依赖的package包/类
@NonNull
public static File getBuildTool(
@NonNull Revision revision,
@NonNull BuildToolInfo.PathId pathId) {
FakeProgressIndicator progress = new FakeProgressIndicator();
BuildToolInfo buildToolInfo = AndroidSdkHandler.getInstance(findSdkDir())
.getBuildToolInfo(revision, progress);
if (buildToolInfo == null) {
throw new RuntimeException("Test requires build-tools " + revision.toString());
}
return new File(buildToolInfo.getPath(pathId));
}
示例4: getTarget
import com.android.sdklib.repository.AndroidSdkHandler; //导入依赖的package包/类
/**
* Returns a {@link IAndroidTarget} with a minimum api level.
*
* @param minimumApiLevel the desired api level.
* @return the IAndroidTarget of that api level or above or null if not found.
*/
@Nullable
public static IAndroidTarget getTarget(int minimumApiLevel) {
FakeProgressIndicator progressIndicator = new FakeProgressIndicator();
IAndroidTarget target = AndroidSdkHandler.getInstance(findSdkDir())
.getAndroidTargetManager(progressIndicator)
.getTargetOfAtLeastApiLevel(minimumApiLevel, progressIndicator);
return target;
}
示例5: configAvd
import com.android.sdklib.repository.AndroidSdkHandler; //导入依赖的package包/类
AvdSelector.LaunchData configAvd(
AndroidSdkHandler sdkManager, AndroidSdk sdk, IAndroidTarget target, LaunchConfiguration launchCfg);
示例6: AndroidSdkImpl
import com.android.sdklib.repository.AndroidSdkHandler; //导入依赖的package包/类
public AndroidSdkImpl(String displayName, String sdkPath, Map<String, String> properties, Map<String, String> sysproperties, List<AndroidPlatformInfo> platforms, boolean defaultSdk) {
this.displayName = displayName;
this.sdkPath = sdkPath;
this.defaultSdk = defaultSdk;
sdkRoot = new File(sdkPath);
sdkRootFo = FileUtil.toFileObject(sdkRoot);
if (properties != null) {
this.properties = properties;
} else {
this.properties = new HashMap<>();
}
if (sysproperties != null) {
this.sysproperties = sysproperties;
} else {
this.sysproperties = new HashMap<>();
}
if (platforms != null) {
AndroidSdkTools.orderByApliLevel(platforms);
for (AndroidPlatformInfo platform : platforms) {
platformsList.put(platform.getHashString(), platform);
}
}
final Runnable runnable = new Runnable() {
@Override
public void run() {
androidSdkHandler = AndroidSdkHandler.getInstance(sdkRoot);
if (androidSdkHandler != null) {
repoManager = androidSdkHandler.getSdkManager(new NbOutputWindowProgressIndicator());
repoManager.registerLocalChangeListener(AndroidSdkImpl.this);
repoManager.registerRemoteChangeListener(AndroidSdkImpl.this);
androidTargetManager = androidSdkHandler.getAndroidTargetManager(new NbOutputWindowProgressIndicator() {
});
updateSdkPlatformPackages();
scheduledThreadPool.scheduleWithFixedDelay(new Runnable() {
@Override
public void run() {
repoManager.reloadLocalIfNeeded(new NbOutputWindowProgressIndicator());
}
}, 30, 30, TimeUnit.SECONDS);
} else {
repoManager = null;
}
}
};
WindowManager.getDefault().invokeWhenUIReady(new Runnable() {
@Override
public void run() {
AndroidSdk.pool.submit(runnable);
}
});
}
示例7: getAndroidSdkHandler
import com.android.sdklib.repository.AndroidSdkHandler; //导入依赖的package包/类
@Override
public AndroidSdkHandler getAndroidSdkHandler() {
return androidSdkHandler;
}
示例8: createAvdManager
import com.android.sdklib.repository.AndroidSdkHandler; //导入依赖的package包/类
public static AvdManager createAvdManager(AndroidSdkHandler sdkMgr) throws AndroidLocationException {
final ILogger sdkLog = SdkLogProvider.createLogger(true);
final AvdManager avdMgr = AvdManager.getInstance(sdkMgr, sdkLog);
return avdMgr;
}
示例9: getAndroidSdkHandler
import com.android.sdklib.repository.AndroidSdkHandler; //导入依赖的package包/类
public abstract AndroidSdkHandler getAndroidSdkHandler();