With a few android projects in Eclipse I get compile error in AndroidManifest.xml every time I restart Eclipse. Errors are something like: Description Resource Path Location Type error: Error: No resource found that matches the given name (at ‘label’ with value ‘@string/share_name’). AndroidManifest.xml /MobiwsaleAdmin line 37 Android AAPT Problem This project is done with PhoneGapRead more about Strange compile error in AndroidManifest.xml[…]
First ensure that you have Basic PhoneGap application running on your android. Check this tutorial if needed. Official tutorial is not so good but might help you out if Phonegap Facebook tutorial here fails. For additional information go to https://github.com/davejohnson/phonegap-plugin-facebook-connect/blob/master/README.md.
- Download PhoneGap Facebook plugin from https://github.com/davejohnson/phonegap-plugin-facebook-connect/tree/master/www
- Move cdv-plugin-fb-connect.js into your android phonegap webroot assets/www
- Add <plugin name=”org.apache.cordova.facebook.Connect” value=”org.apache.cordova.facebook.ConnectPlugin” /> into res/xml/plugins.xml Read more about Add Facebook login to PhoneGap/Cordova Android app Easiest way – UPDATED …
This tutorial assumes that you have eclipse which is set up for regular android development and you can create new android projects. Phonegap files are now named cordova
- Create new Android project in eclipse.
- Download package and extract cordova-2.6.0.jar from zip file from http://phonegap.com/download/
- Add cordova-2.6.0.jar to your projects build path. In eclipse open project properties > Java Build Path > Add Jars
- Change main Activity superclass to DroidGap
- Replace setContentView(R.layout.main); with super.loadUrl(“file:///android_asset/www/index.html”);
- Create folder xml into the project res folder. Add there plugins.xml and cordova.xml from the package you download before.
- Add into AndroidManifest.xml <uses-permission android:name=”android.permission.INTERNET” /> and <uses-permission android:name=”android.permission.ACCESS_NETWORK_STATE” />
- Create folder www into projects assets folder.
- Add index.html file into assets/www. File content is regular HMTL.
By now you can already run the program. Next steps are starting to use PhoneGap special HTML5 features and try accessing hardware. If It fails to run then make sure you have logcat view activated in eclipse or try in linux commandline: Read more about Basic PhoneGap Android app from scratch step-by-step …