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


Java AndroidSdkHandler类代码示例

本文整理汇总了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;
}
 
开发者ID:evant,项目名称:silent-support,代码行数:14,代码来源:ApiLookup.java

示例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);
        }
    });
}
 
开发者ID:NBANDROIDTEAM,项目名称:NBANDROID-V2,代码行数:40,代码来源:AndroidSdkImpl.java

示例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));
}
 
开发者ID:apptik,项目名称:tarator,代码行数:13,代码来源:SdkHelper.java

示例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;
}
 
开发者ID:apptik,项目名称:tarator,代码行数:15,代码来源:SdkHelper.java

示例5: configAvd

import com.android.sdklib.repository.AndroidSdkHandler; //导入依赖的package包/类
AvdSelector.LaunchData configAvd(
AndroidSdkHandler sdkManager, AndroidSdk sdk, IAndroidTarget target, LaunchConfiguration launchCfg);
 
开发者ID:NBANDROIDTEAM,项目名称:NBANDROID-V2,代码行数:3,代码来源:AndroidLauncher.java

示例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);
        }
    });

}
 
开发者ID:NBANDROIDTEAM,项目名称:NBANDROID-V2,代码行数:54,代码来源:AndroidSdkImpl.java

示例7: getAndroidSdkHandler

import com.android.sdklib.repository.AndroidSdkHandler; //导入依赖的package包/类
@Override
public AndroidSdkHandler getAndroidSdkHandler() {
    return androidSdkHandler;
}
 
开发者ID:NBANDROIDTEAM,项目名称:NBANDROID-V2,代码行数:5,代码来源:AndroidSdkImpl.java

示例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;
}
 
开发者ID:NBANDROIDTEAM,项目名称:NBANDROID-V2,代码行数:6,代码来源:PlatformUtilities.java

示例9: getAndroidSdkHandler

import com.android.sdklib.repository.AndroidSdkHandler; //导入依赖的package包/类
public abstract AndroidSdkHandler getAndroidSdkHandler(); 
开发者ID:NBANDROIDTEAM,项目名称:NBANDROID-V2,代码行数:2,代码来源:AndroidSdk.java


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