本文整理汇总了Java中com.taobao.weex.utils.WXSoInstallMgrSdk类的典型用法代码示例。如果您正苦于以下问题:Java WXSoInstallMgrSdk类的具体用法?Java WXSoInstallMgrSdk怎么用?Java WXSoInstallMgrSdk使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WXSoInstallMgrSdk类属于com.taobao.weex.utils包,在下文中一共展示了WXSoInstallMgrSdk类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import com.taobao.weex.utils.WXSoInstallMgrSdk; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_index);
setContainer((ViewGroup) findViewById(R.id.index_container));
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
mProgressBar = (ProgressBar) findViewById(R.id.index_progressBar);
mTipView = (TextView) findViewById(R.id.index_tip);
mProgressBar.setVisibility(View.VISIBLE);
mTipView.setVisibility(View.VISIBLE);
if (!WXSoInstallMgrSdk.isCPUSupport()) {
mProgressBar.setVisibility(View.INVISIBLE);
mTipView.setText(R.string.cpu_not_support_tip);
return;
}
loadUrl(isLocalPage() ? AppConfig.getLocalUrl() : AppConfig.getLaunchUrl());
}
示例2: onCreate
import com.taobao.weex.utils.WXSoInstallMgrSdk; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_wxpage);
mContainer = (ViewGroup) findViewById(R.id.container);
mProgressBar = (ProgressBar) findViewById(R.id.progress);
mTipView = (TextView) findViewById(R.id.index_tip);
Uri uri = getIntent().getData();
Bundle bundle = getIntent().getExtras();
if (uri != null) {
mUri = uri;
}
if (bundle != null) {
String bundleUrl = bundle.getString(Constants.PARAM_BUNDLE_URL);
if (!TextUtils.isEmpty(bundleUrl)) {
mUri = Uri.parse(bundleUrl);
}
}
if (mUri == null) {
Toast.makeText(this, "the uri is empty!", Toast.LENGTH_SHORT).show();
finish();
return;
}
if (!WXSoInstallMgrSdk.isCPUSupport()) {
mProgressBar.setVisibility(View.INVISIBLE);
mTipView.setText(R.string.cpu_not_support_tip);
return;
}
loadUrl(getUrl(mUri));
}
示例3: isSupport
import com.taobao.weex.utils.WXSoInstallMgrSdk; //导入依赖的package包/类
public static boolean isSupport() {
boolean excludeX86 = "true".equals(options.get(SETTING_EXCLUDE_X86SUPPORT));
boolean isX86AndExcluded = WXSoInstallMgrSdk.isX86()&&excludeX86;
boolean isCPUSupport = WXSoInstallMgrSdk.isCPUSupport()&&!isX86AndExcluded;
if (WXEnvironment.isApkDebugable()) {
WXLogUtils.d("WXEnvironment.sSupport:" + isCPUSupport
+ " WXSDKEngine.isInitialized():" + WXSDKEngine.isInitialized()
+ " !WXUtils.isTabletDevice():" + !WXUtils.isTabletDevice());
}
return isCPUSupport && WXSDKEngine.isInitialized() && !WXUtils.isTabletDevice();
}
示例4: doInitInternal
import com.taobao.weex.utils.WXSoInstallMgrSdk; //导入依赖的package包/类
private static void doInitInternal(final Application application,final InitConfig config){
WXEnvironment.sApplication = application;
WXEnvironment.JsFrameworkInit = false;
WXBridgeManager.getInstance().post(new Runnable() {
@Override
public void run() {
long start = System.currentTimeMillis();
WXSDKManager sm = WXSDKManager.getInstance();
if(config != null ) {
sm.setIWXHttpAdapter(config.getHttpAdapter());
sm.setIWXImgLoaderAdapter(config.getImgAdapter());
sm.setIWXUserTrackAdapter(config.getUtAdapter());
sm.setIWXDebugAdapter(config.getDebugAdapter());
sm.setIWXStorageAdapter(config.getStorageAdapter());
if(config.getDebugAdapter()!=null){
config.getDebugAdapter().initDebug(application);
}
}
WXSoInstallMgrSdk.init(application);
boolean isSoInitSuccess = WXSoInstallMgrSdk.initSo(V8_SO_NAME, 1, config!=null?config.getUtAdapter():null);
if (!isSoInitSuccess) {
return;
}
sm.initScriptsFramework(config!=null?config.getFramework():null);
WXEnvironment.sSDKInitExecuteTime = System.currentTimeMillis() - start;
WXLogUtils.renderPerformanceLog("SDKInitExecuteTime", WXEnvironment.sSDKInitExecuteTime);
}
});
register();
}
示例5: setup
import com.taobao.weex.utils.WXSoInstallMgrSdk; //导入依赖的package包/类
@Before
public void setup() throws Exception {
mockStatic(WXSoInstallMgrSdk.class);
when(WXSoInstallMgrSdk.initSo("weexv8", 1, null)).thenReturn(true);
WXSDKEngine.initialize(RuntimeEnvironment.application,new InitConfig.Builder().build());
mInstance = createInstance();
WXBridgeManagerTest.getLooper().idle();
mockStatic(WXFileUtils.class);
when(WXFileUtils.loadAsset(null,null)).thenReturn("{}");
}
示例6: setUp
import com.taobao.weex.utils.WXSoInstallMgrSdk; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
PowerMockito.mockStatic(WXSoInstallMgrSdk.class);
PowerMockito.mockStatic(TextUtils.class);
PowerMockito.mockStatic(WXComponentFactory.class);
PowerMockito.when(TextUtils.isEmpty("124")).thenReturn(true);
PowerMockito.when(WXSoInstallMgrSdk.initSo(null, 1, null)).thenReturn(true);
WXSDKInstance instance = Mockito.mock(WXSDKInstance.class);
mWXRenderStatement = new WXRenderStatement(instance);
}
示例7: doInitInternal
import com.taobao.weex.utils.WXSoInstallMgrSdk; //导入依赖的package包/类
private static void doInitInternal(final Application application,final InitConfig config){
WXEnvironment.sApplication = application;
WXEnvironment.JsFrameworkInit = false;
WXBridgeManager.getInstance().post(new Runnable() {
@Override
public void run() {
long start = System.currentTimeMillis();
WXSDKManager sm = WXSDKManager.getInstance();
sm.onSDKEngineInitialize();
if(config != null ) {
sm.setInitConfig(config);
if(config.getDebugAdapter()!=null){
config.getDebugAdapter().initDebug(application);
}
}
WXSoInstallMgrSdk.init(application,
sm.getIWXSoLoaderAdapter(),
sm.getWXStatisticsListener());
boolean isSoInitSuccess = WXSoInstallMgrSdk.initSo(V8_SO_NAME, 1, config!=null?config.getUtAdapter():null);
if (!isSoInitSuccess) {
return;
}
sm.initScriptsFramework(config!=null?config.getFramework():null);
WXEnvironment.sSDKInitExecuteTime = System.currentTimeMillis() - start;
WXLogUtils.renderPerformanceLog("SDKInitExecuteTime", WXEnvironment.sSDKInitExecuteTime);
}
});
register();
}
示例8: setUp
import com.taobao.weex.utils.WXSoInstallMgrSdk; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
PowerMockito.mockStatic(WXSoInstallMgrSdk.class);
PowerMockito.mockStatic(TextUtils.class);
PowerMockito.mockStatic(WXComponentFactory.class);
PowerMockito.when(TextUtils.isEmpty("124")).thenReturn(true);
PowerMockito.when(WXSoInstallMgrSdk.initSo(null, 1, null)).thenReturn(true);
WXSDKInstance instance = Mockito.mock(WXSDKInstance.class);
mWXRenderStatement = new RenderActionContextImpl(instance);
}
示例9: isHardwareSupport
import com.taobao.weex.utils.WXSoInstallMgrSdk; //导入依赖的package包/类
/**
* Tell whether Weex can run on current hardware.
* @return true if weex can run on current hardware, otherwise false.
*/
public static boolean isHardwareSupport() {
boolean excludeX86 = "true".equals(options.get(SETTING_EXCLUDE_X86SUPPORT));
boolean isX86AndExcluded = WXSoInstallMgrSdk.isX86() && excludeX86;
boolean isCPUSupport = WXSoInstallMgrSdk.isCPUSupport() && !isX86AndExcluded;
if (WXEnvironment.isApkDebugable()) {
WXLogUtils.d("WXEnvironment.sSupport:" + isCPUSupport
+ "isX86AndExclueded: "+ isX86AndExcluded
+ " !WXUtils.isTabletDevice():" + !WXUtils.isTabletDevice());
}
return isCPUSupport && !WXUtils.isTabletDevice();
}
示例10: doInitInternal
import com.taobao.weex.utils.WXSoInstallMgrSdk; //导入依赖的package包/类
private static void doInitInternal(final Application application,final InitConfig config){
WXEnvironment.sApplication = application;
WXEnvironment.JsFrameworkInit = false;
WXBridgeManager.getInstance().post(new Runnable() {
@Override
public void run() {
long start = System.currentTimeMillis();
WXSDKManager sm = WXSDKManager.getInstance();
if(config != null ) {
sm.setInitConfig(config);
if(config.getDebugAdapter()!=null){
config.getDebugAdapter().initDebug(application);
}
}
WXSoInstallMgrSdk.init(application);
boolean isSoInitSuccess = WXSoInstallMgrSdk.initSo(V8_SO_NAME, 1, config!=null?config.getUtAdapter():null);
if (!isSoInitSuccess) {
return;
}
sm.initScriptsFramework(config!=null?config.getFramework():null);
WXEnvironment.sSDKInitExecuteTime = System.currentTimeMillis() - start;
WXLogUtils.renderPerformanceLog("SDKInitExecuteTime", WXEnvironment.sSDKInitExecuteTime);
}
});
register();
}
示例11: doInitInternal
import com.taobao.weex.utils.WXSoInstallMgrSdk; //导入依赖的package包/类
private static void doInitInternal(final Application application,final InitConfig config){
WXEnvironment.sApplication = application;
WXEnvironment.JsFrameworkInit = false;
WXBridgeManager.getInstance().getJSHandler().post(new Runnable() {
@Override
public void run() {
long start = System.currentTimeMillis();
WXSDKManager sm = WXSDKManager.getInstance();
if(config != null ) {
sm.setIWXHttpAdapter(config.getHttpAdapter());
sm.setIWXImgLoaderAdapter(config.getImgAdapter());
sm.setIWXUserTrackAdapter(config.getUtAdapter());
sm.setIWXDebugAdapter(config.getDebugAdapter());
if(config.getDebugAdapter()!=null){
config.getDebugAdapter().initDebug(application);
}
}
WXSoInstallMgrSdk.init(application);
boolean isSoInitSuccess = WXSoInstallMgrSdk.initSo(V8_SO_NAME, 1, config!=null?config.getUtAdapter():null);
if (!isSoInitSuccess) {
return;
}
sm.initScriptsFramework(null);
WXEnvironment.sSDKInitExecuteTime = System.currentTimeMillis() - start;
WXLogUtils.renderPerformanceLog("SDKInitInvokeTime", WXEnvironment.sSDKInitInvokeTime);
WXLogUtils.renderPerformanceLog("SDKInitExecuteTime", WXEnvironment.sSDKInitExecuteTime);
}
});
register();
}
示例12: setUp
import com.taobao.weex.utils.WXSoInstallMgrSdk; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
PowerMockito.mockStatic(WXSoInstallMgrSdk.class);
PowerMockito.mockStatic(TextUtils.class);
PowerMockito.mockStatic(WXComponentFactory.class);
PowerMockito.when(TextUtils.isEmpty("124")).thenReturn(true);
PowerMockito.when(WXSoInstallMgrSdk.initSo(null, 1, null)).thenReturn(true);
// WXSDKEngine.init(RuntimeEnvironment.application);
WXSDKInstance instance = Mockito.mock(WXSDKInstance.class);
mWXRenderStatement = new WXRenderStatement(instance, "123");
}
示例13: onCreate
import com.taobao.weex.utils.WXSoInstallMgrSdk; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_index);
setContainer((ViewGroup) findViewById(R.id.index_container));
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
toolbar.setTitle("WEEX");
setSupportActionBar(toolbar);
mProgressBar = (ProgressBar) findViewById(R.id.index_progressBar);
mTipView = (TextView) findViewById(R.id.index_tip);
mProgressBar.setVisibility(View.VISIBLE);
mTipView.setVisibility(View.VISIBLE);
if(!WXSoInstallMgrSdk.isCPUSupport()){
mProgressBar.setVisibility(View.INVISIBLE);
mTipView.setText(R.string.cpu_not_support_tip);
return;
}
if(TextUtils.equals(CURRENT_IP,DEFAULT_IP)){
renderPage(WXFileUtils.loadFileContent("index.js", this),WEEX_INDEX_URL);
}else{
renderPageByURL(WEEX_INDEX_URL);
}
}
示例14: onCreate
import com.taobao.weex.utils.WXSoInstallMgrSdk; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_wxpage);
mContainer = (ViewGroup) findViewById(R.id.container);
mProgressBar = (ProgressBar) findViewById(R.id.progress);
mTipView = (TextView) findViewById(R.id.index_tip);
if (mIsDevSupportEnabled && !CommonUtils.hasHardwareMenuKey()) {
mShakeDetector = new ShakeDetector(new ShakeDetector.ShakeListener() {
@Override
public void onShake() {
showDevOptionsDialog();
}
});
}
Uri uri = getIntent().getData();
Bundle bundle = getIntent().getExtras();
if (uri != null) {
mUri = uri;
}
if (bundle != null) {
String bundleUrl = bundle.getString(Constants.PARAM_BUNDLE_URL);
if (!TextUtils.isEmpty(bundleUrl)) {
mUri = Uri.parse(bundleUrl);
}
}
if (mUri == null) {
Toast.makeText(this, "the uri is empty!", Toast.LENGTH_SHORT).show();
finish();
return;
}
if (!WXSoInstallMgrSdk.isCPUSupport()) {
mProgressBar.setVisibility(View.INVISIBLE);
mTipView.setText(R.string.cpu_not_support_tip);
return;
}
loadUrl(getUrl(mUri));
}
示例15: onCreate
import com.taobao.weex.utils.WXSoInstallMgrSdk; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_wxpage);
mContainer = (ViewGroup) findViewById(R.id.container);
mProgressBar = (ProgressBar) findViewById(R.id.progress);
mTipView = (TextView) findViewById(R.id.index_tip);
if (mIsDevSupportEnabled && !CommonUtils.hasHardwareMenuKey()) {
mShakeDetector = new ShakeDetector(new ShakeDetector.ShakeListener() {
@Override
public void onShake() {
showDevOptionsDialog();
}
});
}
Uri uri = getIntent().getData();
Bundle bundle = getIntent().getExtras();
if (uri != null) {
mUri = uri;
}
if (bundle != null) {
String bundleUrl = bundle.getString(Constants.PARAM_BUNDLE_URL);
if (!TextUtils.isEmpty(bundleUrl)) {
mUri = Uri.parse(bundleUrl);
}
}
if (mUri == null) {
Toast.makeText(this, "the uri is empty!", Toast.LENGTH_SHORT).show();
finish();
return;
}
if (!WXSoInstallMgrSdk.isCPUSupport()) {
mProgressBar.setVisibility(View.INVISIBLE);
mTipView.setText(R.string.cpu_not_support_tip);
return;
}
Log.e("tag","=========murl: "+mUri.toString());
loadUrl(getUrl(mUri));
}