[phoneGap] test
[phoneGap]
1. http://phonegap.com/start/#android
2. Download and install Eclipse Classic
3. Download and install Android SDK à c:\programme file\android
4. Download and install ADT Plugin
5. Android SDK Manger update
6. Launch Eclipse, then under the File menu select New > Android Project
a. In the root directory of the project, create two new directories:
/libs
/assets/www
b. Copy phonegap.js from your PhoneGap download earlier to /assets/www
d. Copy phonegap.jar from your PhoneGap download earlier to /libs
c. Copy xml folder from your PhoneGap download earlier to /res
d. Change the class’s extend from Activity to DroidGap in HelloWorldActivity.java
e. Replace the setContentView() line with super.loadUrl(« file:///android_asset/www/index.html »);
f. Add import com.phonegap.*;
g. Remove import android.app.Activity;
h. You might experience an error here, where Eclipse can’t find phonegap-1.0.0.jar. In this case, right click on the /libs folder and go to Build Paths/ > Configure Build Paths. Then, in the Libraries tab, add phonegap-1.0.0.jar to the Project. If Eclipse is being temperamental, you might need to refresh (F5) the project once again.
j. Right click on AndroidManifest.xml and select Open With > Text Editor
k. Paste the following permissions under versionName: (view image below)
l. Now create and open a new file named index.html in the /assets/www directory.
m. Deploy to Simulator
Right click the project and go to Run As and click Android Application
[problème] DroidGap Cannot be resolved to a type » in Hello Sample ???
[résolution] : You need an import statement of the droidsgap class on top of your class
import com.phonegap.DroidGap;
[problème] Application requires API version 11. Device API version is 8 (Android 2.2).
[résolution] : AbdroidManifest.xml <uses-sdk android:minSdkVersion= »11″ /> TO <uses-sdk android:minSdkVersion= »2″ />
[problème] java.lang.Object cannot be resolved
[résolution] : un fichier .classpath dans le répertoire du projet
ajouter : <classpathentry kind= »con » path= »org.eclipse.jdt.launching.JRE_CONTAINER »/>
7. ce marche avec index.html
<!DOCTYPE HTML>
<html>
<head>
<title>Télessonne, la télé de l’Essonne</title>
<META NAME= »description » CONTENT= » la locale de avec chaque jour les actualités : journaux d’information, reportages, vie locale à Evry, Massy, Etampes, Corbeil, Essonnes, Palaiseau, Les Ulis, Grigny, Viry-Chatillon,… »/>
<script type= »text/javascript » charset= »utf-8″ src= »phonegap-1.2.0.js »></script>
<meta http-equiv= »refresh » content= »0; url=http://www.t.fr/mobile/ »>
</head>
<body bgcolor= »#000000″>loading…
</body>
</html>
8. PhoneGap:Build => Building for iOS : https://build.phonegap.com/docs/ios-builds
8.1. all iOS builds need to be signed by a developer certificate and a provisioning profile, that is tied to your Apple developer account and the device you wish to test on
8.2 need a Mac to configure your certificate and provisioning profile.
8.3 Your key will actually consist of two files: a certificate and a provisioning profile.
8.4 For the provisioning profile, you will need a file with the mobileprovision extension
8.5 o prepare your certificate, you will need to open the Keychain Access utility on your Mac
8.6 Save the certificate in a location you can remember, and enter a password.
9. PhoneGap:Build => Building for Android : Building in Release Mode : http://developer.android.com/guide/developing/building/building-cmdline.html
9.1 the result of the process is a compiled .apk file that is signed with your private release key. Your application is now ready to be published publicly so users can install it.
9.2 To publish your application on Android Market, you first need to register with the service using a Google account and agree to the terms of service
http://developer.android.com/guide/publishing/publishing.html
Comments are closed.