Aysennoussi
Aysennoussi

Reputation: 3860

fresh start issues in phonegap

I'm a new user of Phonegap and I'm very confused how everything works. I have created the project on c://ProjectName and built it for android. I open my ADT (Eclipse) and I create a project from the existing code, then I have two project folders : ProjectName and ProjectName-CordovaLib.

When I modify the index.html file and run the app in the emulator, it doesn't seem to have any effect. in ADT the auto-rebuild option is checked. How am I able to modify the file ? In : ProjectName.java

public class ProjectName extends CordovaActivity 
{
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        super.init();
        // Set by <content src="index.html" /> in config.xml
        super.loadUrl(Config.getStartUrl());
        super.loadUrl("file:///android_asset/www/index.html");
    }
}

I think these are my problems at the moment. Can you help me please? My index.html file (Modified):

<!DOCTYPE html>
<!--
    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you under the Apache License, Version 2.0 (the
    "License"); you may not use this file except in compliance
    with the License.  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an
    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
     KIND, either express or implied.  See the License for the
    specific language governing permissions and limitations
    under the License.
-->
<html>
    <head>
        <meta charset="utf-8" />
        <meta name="format-detection" content="telephone=no" />
        <!-- WARNING: for iOS 7, remove the width=device-width and height=device-height attributes. See https://issues.apache.org/jira/browse/CB-4323 -->
        <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
        <link rel="stylesheet" type="text/css" href="css/index.css" />
        <title>MY APP</title>
    </head>
    <body>
        <div class="app">
            <h1>MY</h1>
            <div id="deviceready" class="blink">
                <p class="event listening">Hi !</p>
                <p class="event received">Hello Sekai</p>
            </div>
        </div>
        <script type="text/javascript" src="phonegap.js"></script>
        <script type="text/javascript" src="js/index.js"></script>
        <script type="text/javascript">
        //there was something here but I deleted it.
        // there was an app.init() 
        </script>
    </body>
</html>

Properties of project

Upvotes: 1

Views: 237

Answers (1)

Amit Prajapati
Amit Prajapati

Reputation: 14335

First Ans: What is ProjectName-CordovaLib? -> It is the library ot cordoava. in olderversion phongap will provide .jar and now andorid 3.3.0 up it will provide one library.

Second Ans: I have in ProjectName>www -> it the basic common code to use in multiple platform,

In Android you can see www in assets forlder. if not than read "_where-is-www.txt" file and follow instraction.

Upvotes: 1

Related Questions