`
fanfq
  • 浏览: 267772 次
  • 性别: Icon_minigender_1
  • 来自: 苏州
社区版块
存档分类
最新评论

phonegap-splashscreen

 
阅读更多
其实就是自定义一个启动页面,不顾完全可以不用这么做,MainActivity就可以充当启动页面来做,这个是官方的例子就顺便学习一下。同时这里也有延迟加载的例子。

index.html
<!DOCTYPE html>
<html>
  <head>
    <title>Splashscreen Example</title>

    <script type="text/javascript" charset="utf-8" src="cordova-2.0.0.js"></script>
    <script type="text/javascript" charset="utf-8">

    // Wait for Cordova to load
    //
    document.addEventListener("deviceready", onDeviceReady, false);

    // Cordova is ready
    //
    function onDeviceReady() {
        //navigator.splashscreen.show();
        navigator.splashscreen.hide();
    }

    </script>
  </head>
  <body>
    <h1>Example</h1>
  </body>
</html>


MainActivity.java
package com.fanfq.phonegap.splashscreen;

import org.apache.cordova.DroidGap;

import android.os.Bundle;

public class MainActivity extends DroidGap {
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		// The first line 'super.setIntegerProperty' sets the image to be
		// displayed as the splashscreen. If you have named your image anything
		// other than splash.png you will have to modify this line. The second
		// line is the normal 'super.loadUrl' line but it has a second parameter
		// which is the timeout value for the splash screen. In this example the
		// splash screen will display for 10 seconds. If you want to dismiss the
		// splash screen once you get the "deviceready" event you should call
		// the navigator.splashscreen.hide() method.
		super.setIntegerProperty("splashscreen", R.drawable.splash);
		super.loadUrl("file:///android_asset/www/index.html", 10000);
	}
}
分享到:
评论

相关推荐

    cordova扫码插件phonegap-plugin-barcodescanner,修复了在ios10上面的内存泄漏导致的闪退bug

    在这个场景中,我们关注的是一个名为`phonegap-plugin-barcodescanner`的插件,这是一个专门为PhoneGap/Cordova设计的扫码功能插件。 这个插件的主要作用是在iOS和Android等平台上实现条形码和二维码的扫描功能。...

    phonegap-phonegap-1.0.0-0-g80cc6dd.zip

    这个“phonegap-phonegap-1.0.0-0-g80cc6dd.zip”文件是PhoneGap的一个特定版本,版本号为1.0.0,Git提交ID为80cc6dd,这通常代表了该版本在开发过程中的一个快照。 PhoneGap的核心理念是利用Web技术来实现原生移动...

    phonegap-phonegap-1.8.1-0-gce32a3f.zip

    这个“phonegap-phonegap-1.8.1-0-gce32a3f.zip”文件是一个特定版本的PhoneGap框架的归档,版本号为1.8.1,对应的Git提交哈希值是gce32a3f。这个压缩包可能包含了运行和开发基于PhoneGap 1.8.1项目所需的所有文件。...

    jpush-phonegap-plugin-master

    "jpush-phonegap-plugin-master" 是一个针对 PhoneGap 框架的 JPush 插件,适用于 Ionic2 应用程序。PhoneGap 是一种跨平台的移动应用开发框架,它允许开发者使用 HTML、CSS 和 JavaScript 来构建原生的移动应用。...

    Phonegap-LocalNotification-master

    在这个名为“Phonegap-LocalNotification-master”的项目中,我们聚焦于PhoneGap的一个重要特性——本地通知(Local Notifications),尤其针对Android平台。 本地通知是移动应用中的一个重要功能,它可以在应用...

    phonegap-phonegap-1.6.0-0-g66780d6.rar_android_ios框架_phonegap

    标题中的"phonegap-phonegap-1.6.0-0-g66780d6.rar"表明这是一个关于PhoneGap 1.6.0版本的压缩包,版本号后的"g66780d6"可能代表Git的提交哈希值,意味着这是一个特定的源码版本。 PhoneGap的主要优势在于它的跨...

    jpush-phonegap-plugin

    【jpush-phonegap-plugin】是基于PhoneGap框架的一个插件,用于集成极光推送(JPush)服务到移动应用中。PhoneGap是一种流行的混合移动应用开发框架,它允许开发者使用HTML、CSS和JavaScript来构建跨平台的应用程序...

    phonegap-cli, PhoneGap和 PhoneGap/构建 命令行 接口.zip

    phonegap-cli, PhoneGap和 PhoneGap/构建 命令行 接口 PhoneGap命令行接口和 node.js 库。命令行命令行要求安装 node.js 版本 &gt;=4.0.0安装 iOS sim 将应用程序部署到iOS模拟器。安装$ npm install

    cordova-barcodescanner:从phonegap-plugin-barcodescanner派生并更新IOS上的UI

    PhoneGap插件条形码扫描仪 =============================== 适用于Cordova / PhoneGap的跨平台BarcodeScanner。 遵循,因此可与一起。 安装 ... phonegap plugin add phonegap-plugin-barcodesc

    Android代码-phonegap-android

    PhoneGap Android is an Android application library that allows for PhoneGap-based projects to be built for the Android Platform. PhoneGap-based applications are, at the core, an application written in...

    phonegap-1.8.0-0

    phonegap-1.8.0-0 phonegap-1.8.0-0

    PhoneGap-Desktop-Beta-0.4.4-win.zip

    PhoneGap Desktop Beta 0.4.4是这个框架的一个早期版本,适用于Windows操作系统,特别强调了其作为桌面应用的形式。在官方渠道下载困难的情况下,此压缩包提供了一个方便的下载途径。 PhoneGap的核心理念是利用Web...

    PhoneGap-2.9.1

    这个“PhoneGap-2.9.1”版本是该框架的一个旧版本,它包含了用于Android平台开发的关键组件。 1. **PhoneGap框架**:PhoneGap的核心理念是利用WebView,一个在移动设备上运行网页应用的原生组件,来展示由Web技术...

    phonegap-2.1.0

    这个压缩包文件 "phonegap-2.1.0" 指向的是 PhoneGap 的一个特定版本,即 2.1.0 版本,用于 Android 平台的开发。在这个版本中,PhoneGap 提供了构建跨平台移动应用的能力,让开发者可以利用熟悉的 web 开发工具和...

    phonegap-desktop 0.4.2 beta

    Download and install our new PhoneGap Desktop app, which is currently in beta.

    phonegap-phonegap-1.6.0-0-g66780d6.zip_66780,com_PhoneGap 1.6_co

    PhoneGap 1.6.0:: Prerequisite Software PhoneGap requires you have the following software installed: 1. Eclipse Integrated Design Environment (IDE), a program to write code and manage software ...

    phonegap-2.9.1中cordova-2.9.1.jar

    最新版本的phonegap-2.9.1是没有cordova-2.9.1.jar的,这里打包好给大家。

    phonegap-1.0.0rc2.zip

    这个“phonegap-1.0.0rc2.zip”文件是PhoneGap的一个早期版本,版本号为1.0.0 Release Candidate 2,这表明它是一个在正式版本发布前的候选版本,可能包含了对早期版本的改进和修复。 PhoneGap的核心理念在于利用...

    Phonegap-Plugin样例

    这个"Phonegap-Plugin样例"压缩包显然包含了用于学习和实践PhoneGap插件开发的资源,这对于初学者或者希望提升PhoneGap技能的人来说非常有价值。 PhoneGap的核心理念是利用Web技术开发移动应用,然后通过它的SDK将...

Global site tag (gtag.js) - Google Analytics