1

私は3つの異なるページを持っていますが、現時点では最初のページだけにもう少しロジックと変数が含まれています。Nexus 7でスライダーをテストしていると、次のようになります。

07-24 09:36:01.363: D/Cordova(10976):
onPageFinished(file:///android_asset/www/index.html#/android_asset/www/testSlider.html)
07-24 09:36:01.363: D/CordovaWebView(10976): >>> loadUrlNow()
07-24 09:36:01.363: D/DroidGap(10976): onMessage(onNativeReady,null)
07-24 09:36:01.363: D/DroidGap(10976):
onMessage(onPageFinished,file:///android_asset/www/index.html#/android_asset/www/testSlider.html)
07-24 09:36:17.463: D/dalvikvm(10976): GC_CONCURRENT freed 470K, 10%
free 8084K/8967K, paused 19ms+7ms, total 83ms

それでは、それはメモリに関するものですか、それともjqueryモバイルスライダーに大きなメモリリークがありますか?ほぼ空のページが3つしかなく、最後のページにスライダーがあるので(ただし機能していません)、ブラウザーでは機能していますが、nexus7では機能していません。

誰かがphonegap+jqm + Androidでマルチページアプリを実装している場合、それが可能であると教えてもらえますか?可能であれば、Nexusまたはエミュレーターでjvmのメモリ量を増やす方法、またはアプリでメモリ使用量を管理する方法を教えてください。スライダーにいくつかのコンソールログを挿入して、動作しているかどうかを確認しましたが、ログではなく、そのメモリラインを取得しました。前述のように、ブラウザーでは動作しますが、実際のデバイスでは動作しません。

そして、コードはここにあります

package com.mycordova.hellocordova;

import android.R;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.MenuItem;
import android.support.v4.app.NavUtils;
import org.apache.cordova.*;

public class HelloCordovaActivity extends DroidGap {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        super.loadUrl("file:///android_asset/www/index.html");
    }

}

<!DOCTYPE html>
<html>
<head> 

<title>conditions</title> 
<meta name="viewport" content="width=device-width, initial-scale=1"> 
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.css" />
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.js"></script>


<script type="text/javascript">
function onload(){
    $("#temperature").on("change", function(e){
        var newTemp = $("#temperature").val();
        console.log("newTempnewTempnewTempnewTemp---->" +newTemp)
        $("#temp").val(newTemp);
    });


}

</script>

</head> 

<body onload="onload()"> 
<div data-role="page" data-theme="a">
    <div data-role="header">


<h1>Conditions</h1>
    </div>


    <div data-role="fieldcontain">
        <label for="temperature">Temperature22:</label>
        <input type="range" name="temperature" id="temperature" value="15" min="-15" max="60" data-highlight="true" />
        <label for="temp">Echo Temp</label>
        <input type="text" value="" id="temp" />
    </div>
</div>
</body>
</html>

そして、ページからページへのジャンプはそのように起こっています。条件-ページは問題のあるものです!

<div data-role="footer" data-position="fixed">
    <div data-role="navbar" style="font-size: -2">
        <ul>
        <li><a href="index.html" class="ui-btn-active">Index</a></li>
        <li><a href="conditions.html" data-transition="pop"
        data-direction="reverse">Conditions</a></li>

    </ul>
    </div>
</div>

スライダーページ(条件と呼ばれる)は、最初のページでは正常に機能していますが、2番目のページでは機能していません。両方のページを最初のページに入れようとしましたが、最終結果は同じです。しかし、これは役に立ちました。なぜなら、私はJQMと私のjSを非難していたので、今ではそれが別のものであることがわかりました。

ところで、ブラウザでアプリをテストすると機能しませんが、ページを更新すると機能し始めます。これは私が今までに行った中で最も奇妙なアプリケーションです。

@tencentはもっと多くのログを持っていました、そしてここにそれがあります:

07-24 23:26:59.910: D/Cordova(20550): onPageFinished(file:///android_asset/www/index.html#conditions)
07-24 23:26:59.910: D/CordovaWebView(20550): >>> loadUrlNow()
07-24 23:26:59.910: D/DroidGap(20550): onMessage(onNativeReady,null)
07-24 23:26:59.910: D/DroidGap(20550): onMessage(onPageFinished,file:///android_asset/www/index.html#conditions)---> Transition to next page where that slider is.
07-24 23:27:21.490: D/SoftKeyboardDetect(20550): Ignore this event**----> I Tried to write to disabled echo-fied**
07-24 23:27:21.690: D/SoftKeyboardDetect(20550): Ignore this event
07-24 23:27:28.120: D/SoftKeyboardDetect(20550): Ignore this event
07-24 23:27:33.470: D/CordovaWebView(20550): >>> loadUrlNow()
07-24 23:27:33.470: D/DroidGap(20550): onDestroy()**--->Somewhere here it crashed and closed the app!!**
07-24 23:27:33.480: D/CordovaWebView(20550): >>> loadUrlNow()
07-24 23:27:33.480: D/CordovaWebView(20550): >>> loadUrlNow()
07-24 23:27:33.670: D/DroidGap(20550): DroidGap.onCreate()
07-24 23:27:33.690: D/CordovaWebView(20550): Origin to allow: http://127.0.0.1*
07-24 23:27:33.690: I/CordovaLog(20550): Found log level DEBUG
07-24 23:27:33.690: I/CordovaLog(20550): Changing log level to DEBUG(3)
07-24 23:27:33.690: I/CordovaLog(20550): Found preference for useBrowserHistory=false
07-24 23:27:33.690: D/CordovaLog(20550): Found preference for useBrowserHistory=false
07-24 23:27:33.700: D/DroidGap(20550): DroidGap.init()
07-24 23:27:33.700: D/CordovaWebView(20550): >>>loadUrl(file:///android_asset/www/index.html)
07-24 23:27:33.700: D/PluginManager(20550): init()
07-24 23:27:33.700: D/CordovaWebView(20550): >>> loadUrlNow()
07-24 23:27:33.710: D/CordovaLog(20550): exception firing pause event from native
07-24 23:27:33.710: D/CordovaLog(20550): null: Line 1 : exception firing pause event from native
07-24 23:27:33.710: I/Web Console(20550): exception firing pause event from native at null:1
07-24 23:27:33.710: D/CordovaLog(20550): exception firing destroy event from native
07-24 23:27:33.710: D/CordovaLog(20550): null: Line 1 : exception firing destroy event from native
07-24 23:27:33.710: I/Web Console(20550): exception firing destroy event from native at null:1
07-24 23:27:33.710: D/SoftKeyboardDetect(20550): Ignore this event
07-24 23:27:33.730: D/DroidGap(20550): onMessage(onPageStarted,about:blank)
07-24 23:27:33.730: D/Cordova(20550): onPageFinished(about:blank)
07-24 23:27:33.730: D/DroidGap(20550): onMessage(onPageFinished,about:blank)
07-24 23:27:33.730: D/DroidGap(20550): onMessage(exit,null)
07-24 23:27:33.760: D/DroidGap(20550): onMessage(onPageStarted,file:///android_asset/www/index.html)
07-24 23:27:33.770: D/CordovaWebView(20550): >>> loadUrlNow()
07-24 23:27:33.810: D/SoftKeyboardDetect(20550): Ignore this event
07-24 23:27:33.820: D/DroidGap(20550): onDestroy()
07-24 23:27:33.820: D/CordovaWebView(20550): >>> loadUrlNow()
07-24 23:27:33.820: D/CordovaWebView(20550): >>> loadUrlNow()
07-24 23:27:34.160: W/IInputConnectionWrapper(20550): showStatusIcon on inactive InputConnection
07-24 23:27:34.250: D/CordovaLog(20550): exception firing pause event from native
07-24 23:27:34.250: D/CordovaLog(20550): null: Line 1 : exception firing pause event from native
07-24 23:27:34.250: I/Web Console(20550): exception firing pause event from native at null:1
07-24 23:27:34.260: D/CordovaLog(20550): exception firing destroy event from native
07-24 23:27:34.260: D/CordovaLog(20550): null: Line 1 : exception firing destroy event from native
07-24 23:27:34.260: I/Web Console(20550): exception firing destroy event from native at null:1
07-24 23:27:34.260: D/Cordova(20550): onPageFinished(file:///android_asset/www/index.html)
07-24 23:27:34.260: D/CordovaWebView(20550): >>> loadUrlNow()
07-24 23:27:34.260: D/DroidGap(20550): onMessage(onNativeReady,null)
07-24 23:27:34.260: D/DroidGap(20550): onMessage(onPageFinished,file:///android_asset/www/index.html)
07-24 23:27:34.270: D/DroidGap(20550): onMessage(onPageStarted,about:blank)
07-24 23:27:34.290: D/Cordova(20550): onPageFinished(about:blank)
07-24 23:27:34.290: D/DroidGap(20550): onMessage(onPageFinished,about:blank)
07-24 23:27:34.300: D/DroidGap(20550): onMessage(exit,null)
07-24 23:27:36.270: D/DroidGap(20550): onMessage(spinner,stop)
07-24 23:27:36.300: D/DroidGap(20550): onMessage(spinner,stop)
4

0 に答える 0