Can we use Phonegap with Java for Android - android

Normally, we build native Android applications via Java.
Now, we also have Phonegap which can be used to build apps.
However, can we combine both of them so that some functions which cannot be called using html, css and javascript can be used through PhoneGap.

Yeah you can do that by using or writing your own Phonegap Plugin.
Check the documentation for Phonegap Plugins.
http://wiki.phonegap.com/w/page/36752779/PhoneGap%20Plugins

Yes you can do it by creating a plugin for phonegap. By communicating with your plugin you will be able to run your Java code.
A good tutorial on how to build a plugin for phonegap/android can be found here:
http://phpmyweb.net/2011/09/14/creating-a-plugin-for-phonegap-1-0-android/

Related

Is there a way to use android application functionality on cordova?

I have two applications one is running on android java,the other one is a cordova application. I need to use the android functionality on the cordova app. is therere a workround to this? I have been scratching my head for a week.
I have looked into Android plugins but i don't really know how to glue them together. I know Cordova can communicate back and forth with native code. But since i am an android developer and i have little idea on how cordova works with plugins Am Stuck with just my plain Android App built on java.
If you have a custom requirement, then your best shot is creating a plugin for Cordova which is well documented in the cordova docs. It will guide you on how to build as well as publish a plugin for Cordova.
Once you publish a plugin, you can add it using
cordova plugin add <plugin_name>

How to create a cordova plugin for my android library?

I have developed an android library using which one can send messages to other android devices. I have developed many demo apps for mobile and watch to demonstrate this using native android projects. Now I want to explore hybrid android development. I want to know how a native android code can access my android library and use the functionalities.
I have come across custom Cordova plugins. Is it possible for me to build a Cordova plugin for my android library? If yes, can I then use it in a hybrid project and access the functionalities? If not, what is the best way to do it? Thanks in advance.
To answer your 2 important questions:
1. Is it possible for me to build a Cordova plugin for my android library?
Yes, it's possible to create a custom Cordova plugin for your library. That's how all the Cordova plugins are dependent on the base Android library.
2. can I then use it in a hybrid project and access the functionalities?
Yes, you can.
Some are the links that might be helpful to create a new custom Cordova plugin.
https://cordova.apache.org/docs/en/latest/guide/hybrid/plugins/
https://cordova.apache.org/docs/en/2.5.0/guide/plugin-development/android/
https://taco.visualstudio.com/en-us/docs/createplugintutorial/

Cordova Vs PhoneGap for Sencha based Application

I have a Sencha application which i use to create iOS and Android apps. I have tried cordova but dont really understand why people prefer phonegap over cordova.
Enlightenment needed
The main reason to prefer phonegap is if you want to use phonegap build.
Project built using phonegap cli generates a config.xml using a different shema to handle specific PG build extensions.
Other benefit of phonegap can be if you want to use the Phonegap developer app (it may have changed but at the begining at least, it was supported only by the phonegap cli).
And there are also people using phonegap because at the begining there was only phonegap (before phonegap was renamed cordova) and most people continue to use the name phonegap for all cordova/phonegap stuffs.

How to write valid phonegap code to run It on android and ios?

Hello everybody I learn phonegap framework and I have few questions. I want to write app for android and ios. In android I write using Java and JavaScript so If I want to run it on other platform (like ios where is object-C) do I have to depend mostly on JS, move that code to MAC and build ios app??? I dont understand how to use my code in android and iOS... Do I need MAC? Do I need to know xcode?
If you are using cordova you have to use javascript/HTML/Jquery/Jquery Mobile/CSS, everything that you would use for the web.
Regarding the compilation if you have to work with IOS, you must have a MAC and then compile the project using xCode, but you do not need to know him well, you just need to know the process of publication.
For Android, you can instead use Ecplise.
If you want to develop cross-platform on an Android IDE, such as Eclipse then there is no need for a Mac & Xcode outside of testing. However, if you're saying that you already use Xcode and write in Obj-C then have a look at this tutorial to get you started:
http://www.raywenderlich.com/30734/phonegap-tutorial-a-cross-platform-zombie-app
Or this for a JQM/Android example:
http://www.gajotres.net/building-a-native-mobile-app-with-phonegap-and-jquery-mobile-1-4/

Use of phonegap for the development of apps on several patforms

just wanted to clear a confusion concerning phonegap,
My area of interest is mainly Android and Iphone. What I really understand about phonegap is that the phonegap app is platform independant when no native libs are ysed and thus run both on iphone and android. Thus if i build an android app on eclipse using phonegap without using any native libs, will it run on iphone as well??
Nope, this is not exactly the case.
Phonegap enables you to write cross-platform code (HTML, JS, CSS), but when it comes to building, you have to compile this code to a specific environment for each OS. For example you can build the Android version using eclipse, and the iOS version using Xcode.
Hope this helps!
No, you will still need to build for iPhone as well.
You can use the same source code for all systems.

Categories

Resources