Adobe PhoneGap

from Wikipedia, the free encyclopedia
Adobe PhoneGap
Basic data

Maintainer Joe Bowser, Michael Brooks, Rob Ellis, Dave Johnson, Anis Kadri, Brian Leroux, Jesse MacFadyen, Filip Maj, Eric Oesterle, Brock Whitten, Herman Wong, Shazron Abdullah
developer Adobe Inc.
Current  version 9.0.0
( October 10, 2019 )
operating system iOS , Android , webOS , Symbian OS , Blackberry , Windows Phone , Windows 8
programming language JavaScript
License Apache license 2.0
phonegap.com

Adobe PhoneGap (formerly PhoneGap ) is a framework for creating hybrid applications for mobile devices . PhoneGap was originally developed by Nitobi, which was acquired by Adobe Inc. in 2011 . In August 2020, Adobe announced that it would stop the further development of PhoneGap. The associated cloud build service PhoneGap Build will be terminated on October 1, 2020.

PhoneGap makes it possible to write application software for mobile devices with JavaScript , HTML5 and CSS3 instead of device-specific programming languages ​​such as Swift or Java . The resulting applications are hybrid applications; they are neither native applications, because the layout is written using web technologies and not with native user interface frameworks, nor are they web-based applications, since they can be distributed as apps via the sales portals of the operating system manufacturers and can access the programming interfaces of the operating systems of the end devices. From version 1.9 it is even possible to freely mix native and hybrid code parts.

PhoneGap is based on Apache Cordova , which was donated by Adobe / Nitobi to the Apache Software Foundation. Apache Cordova was originally also called PhoneGap , but had to be renamed for legal reasons, as no names that have already been used may be used for Apache projects for trademark reasons. It was initially called Apache Callback and later renamed Apache Cordova . At Adobe Systems it also appears as Adobe PhoneGap and Adobe PhoneGap Build.

PhoneGap was used for the creation of many mobile applications; 1,890 products sold in various online stores are listed on the PhoneGap website. Apple Inc. has confirmed that the framework is also compatible with the 4.0 developer license agreement.

PhoneGap is used by various mobile application platforms such as ViziApps, Worklight, Convertigo appMobi and AppByYou. The JavaScript library Sencha Touch is compatible with PhoneGap from version 2.3, which enables a simplified integration of APIs such as notification, contacts, memory or camera.

history

PhoneGap was first presented and further developed during an iPhoneDevCamp event in San Francisco. PhoneGap won the People's Choice Award at the O'Reilly Media 2009 Web 2.0 Conference.

On October 4th, 2011 Adobe officially announced the takeover of Nitobi Software, the company originally behind the PhoneGap development. At the same time, PhoneGap was donated to the Apache Software Foundation.

Early versions of PhoneGap required an Apple computer to create iOS applications and a Windows PC to create Windows Mobile applications. Since September 2012, Adobe's PhoneGap Build Service has enabled the uploading of PhoneGap applications in the form of HTML, CSS and JavaScript source code into a so-called "cloud compiler", which generates the applications for all supported platforms.

method

PhoneGap applications use HTML5 and CSS3 for the display and JavaScript for the program logic. Although HTML5 enables access to mobile technologies such as accelerometers , cameras and GPS , HTML5 is not yet offered uniformly for all mobile browsers , especially for older Android versions. To avoid these impairments, the PhoneGap framework embeds HTML5 code in a native WebView using a foreign function interface . This means that the native APIs of the devices can be addressed directly.

PhoneGap can also be expanded with native plug-ins , which provide developers with functionalities that can be called up via JavaScript. PhoneGap already provides plug-ins for access to contacts and appointments, notifications, the user's locale , memory and files, device and connection information, splash screen , in-app browser, accelerometer, camera, sound, image and video recording and -playback, compass and GPS available.

Using web-based technologies, PhoneGap applications may be slower than native applications with the same functionality. Adobe Systems warns that applications developed with PhoneGap may not be accepted by Apple because of their slow speed or because they do not feel “native enough”.

Supported Platforms

PhoneGap currently supports development for the operating systems Apple iOS , Google Android , LG webOS , Microsoft Windows Phone , Blackberry and Tizen (SDK 2.x).

PhoneGap extensions for other operating systems and versions are planned or are offered by other manufacturers. Among others, Nokia Symbian OS , Bada is supported .

The following table shows which capabilities, typical for mobile devices, are supported by PhoneGap for each operating system:

Skills up to iPhone 3G from iPhone 3GS Android Windows Phone BlackBerry 10, PlayBook OS Black Berry 4.6-4.7 Black Berry 5.x-6.0 + Bada Symbian webOS Tizen
Accelerometer Yes Yes Yes Yes Yes No Yes Yes Yes Yes Yes
camera Yes Yes Yes Yes Yes No Yes Yes Yes Yes Yes
compass No Yes Yes Yes Yes No No Yes No Yes Yes
contacts Yes Yes Yes Yes Yes No Yes Yes Yes No Yes
Files Yes Yes Yes Yes Yes No Yes No No No Yes
Geolocation Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes
media Yes Yes Yes Yes Yes No No No No No Yes
network Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes
Notifications (alarm, sound, vibration) Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes
Storage Yes Yes Yes Yes Yes No Yes No Yes Yes Yes

Plugins

Cordova provides an interface for plug-ins . This enables functions of the operating system-dependent libraries to be called. The function can be called using JavaScript . Callback functions, which are called on success and on errors, are included. In the following example the plugin is called "my_web_telefon", the function that is to be carried out is "call". Parameters can be passed in an array . In the following example, the telephone number, the URL of the telephone server, user and password are transferred to establish a Voice-over-IP connection. If successful, a Javascript function is called which displays the message “I'm voting like the devil!”. In the event of an error, the error message is displayed.

Example of a call using Javascript:

 cordova.exec(function(Parameter) {alert('Ich wähle schon wie der Teufel!');},
                 function(error) {alert('Fehler: ' + error);},
                 "mein_web_telefon",
                 "anrufen",
                 ["099 111 22 33", "sip://meine_telefonanlage.com", "mein_benutzer", "mein_password"]);

The definitions of the interfaces to the actual plug-in must be in a Javascript file in the "www" subdirectory. "Index.js" is often chosen as the name, but this is not a requirement. Several Javascript files can also take on this task.

The actual plug-in must be programmed separately for the respective operating system, since, as in the above example, it must establish socket connections to the telephone server. Due to the limitations of a web browser (and a web view is a web browser without user interaction), a web view cannot establish any UDP , TLS or TCP / IP connections to the telephone server. The plugin must provide this functionality. In the respective technology of the operating system. With Android, a plug-in is usually written in Java , since every Android phone or Android Pad can execute Java programs and libraries. Of course you could set up a WebSocket connection to the telephone server. In the example, however, it is assumed that the Cordova app is intended to operate telephone systems that do not have WebRTC technology. Then a non-executable example to illustrate a plugin. The example uses "linphone" as RTC and SIP library.

 // Hier werden die cordova spezifischen Klassen importiert
import org.apache.cordova.CallbackContext;
import org.apache.cordova.CordovaInterface;
import org.apache.cordova.CordovaPlugin;
import org.apache.cordova.CordovaWebView;
// Hier werden einige Klassen für JSON importiert
import org.json.JSONArray;
import org.json.JSONException;
// Hier werden einige Klassen einer Telefon API eingebunden. Im Beispiel linphone
import org.linphone.core.Core;
import org.linphone.core.ProxyConfig;
import org.linphone.mediastream.Log;
// Die Klasse  vererbt von CordovaPlugin
public class mein_web_telefon extends CordovaPlugin
{
    public static Linphone mInstance;
    public static LinphoneMiniManager mLinphoneManager;
    public static Context mContext;
    ...
   @Override
    public void initialize(CordovaInterface cordova, CordovaWebView webView)
	{
        super.initialize(cordova, webView);
        this.cordova = cordova;
        mContext = cordova.getActivity().getApplicationContext();
        mLinphoneManager = new LinphoneMiniManager(mContext);
	...
    }
    //Die wichtige Funktion. Sie wird vom Javascript mit cordova.exec aufgerufen
    public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException
	{
        switch (action)
		{
			case "anrufen":

				mLinphoneManager.call(args.getString(0), args.getString(1), callbackContext);
				return true;
			case 'logon"
			....
		}
	}
}

The example is very simplified and cannot be run. First the plugin would have to connect to the server before it can make a call. To make the functionality available to IOS devices, you would have to create a similar library in Object-C or Swift for the Apple operating system.

So that the plugin can be successfully added to a Cordova project with "cordovar plugin add d: \\ my_web_telefon", for example, a file with the name "plugin.xml" must be in the root directory. This xml file lists the files that the plugin needs for the various operating systems. Access rights such as B. access to the camera must be declared here.

<?xml version="1.0" encoding="utf-8"?>
<plugin id="mein_web_telefon" version="1.1.4" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
  <name>Mein fantastisches Telefon Plugin</name>
  ...
  <!-- android -->
  <platform name="android">
   <config-file target="AndroidManifest.xml" parent="/manifest">
      <uses-permission android:name="android.permission.RECORD_AUDIO" />
      <uses-feature
          android:name="android.hardware.camera"
          android:required="false" />
      <uses-feature
          android:name="android.hardware.camera.autofocus"
          android:required="false" />
    </config-file>
    <config-file target="config.xml" parent="/*">
      <feature name="Linphone">
        <param name="android-package" value="com.sip.linphone.Linphone" />
      </feature>
    </config-file>
    ...
    <source-file src="src/android/src/Linphone.java" target-dir="src/com/sip/linphone" />
    ...
  </platform>

  <!-- ios -->
  <platform name="ios">
   <config-file target="config.xml" parent="/*">
      <feature name="Linphone">
        <param name="ios-package" value="Linphone"/>
      </feature>
    </config-file>
    <header-file src="src/ios/Linphone.h"/>
    <source-file src="src/ios/Linphone.m"/>
    <header-file src="src/ios/libs/apple-darwin/include/" />
    ...
    <source-file framework="true" src="src/ios/libs/apple-darwin/lib/mediastreamer/plugins/libmsamr.a" target-dir="lib/mediastreamer/plugins" />
    ...
  </platform>
</plugin>

In the example “android” and “ios” are defined with the corresponding files that the plugin requires. In the case of “android” these are “.java” files, in the case of “ios” they are “.h” and “.m” files. As you can see, the source code files and other files are stored in the “src” directory, separated into “android” and “ios”. The plug-in is suitable for these two operating systems.

See also

literature

  • Jeff Pelletier: Mobile App Manual: The Blueprint . 1st edition. Withinsight Publishing, 2013, ISBN 978-0-9890721-0-6 (English, mobileappmanual.com [accessed October 25, 2013]).
  • John M. Wargo: PhoneGap Essentials: Building Cross-Platform Mobile Apps . 1st edition. Addison-Wesley Professional, 2012, ISBN 978-0-321-81429-6 (English, phonegapessentials.com [accessed October 25, 2013]).
  • Jamie Munro: 20 Recipes for Programming PhoneGap: Cross-Platform Mobile Development for Android and iPhone . 1st edition. O'Reilly Media, 2012, ISBN 978-1-4493-1954-0 (English, oreilly.com [accessed October 25, 2013]).
  • Joshua Marinacci: Building Mobile Applications with Java: Using the Google Web Toolkit and PhoneGap . 1st edition. O'Reilly Media, 2012, ISBN 978-1-4493-0823-0 (English, oreilly.com [accessed October 25, 2013]).
  • Rohit Ghatol: Beginning PhoneGap: Mobile Web Framework for JavaScript and HTML5 . 1st edition. 2011, ISBN 1-4302-3903-4 (English, apress.com [accessed October 25, 2013]).
  • Thomas Myer: Beginning PhoneGap . 1st edition. Wrox Press, 2011, ISBN 1-118-15665-X (English, wiley.com [accessed October 25, 2013]).
  • Ralph Steyer: Developing apps with PhoneGap . 1st edition. Carl Hansa Verlag, Munich 2013, ISBN 978-3-446-43510-0 ( hanser-fachbuch.de ).

Web links

Individual evidence

  1. github.com . (accessed on March 26, 2020).
  2. PhoneGap License
  3. ^ Adobe Announces Agreement to Acquire Nitobi, Creator of PhoneGap. (No longer available online.) Adobe.com, October 3, 2011, archived from the original on April 13, 2012 ; Retrieved October 20, 2013 . Info: The archive link was inserted automatically and has not yet been checked. Please check the original and archive link according to the instructions and then remove this notice. @1@ 2Template: Webachiv / IABot / www.adobe.com
  4. Christian Liebel: Adobe discontinues PhoneGap: drama or chance? Heise Developer, August 12, 2020, accessed on August 15, 2020 .
  5. Marcus Ross: Developing cross-platform apps with PhoneGap. Heise Developer, August 13, 2013, accessed October 25, 2013 .
  6. ^ Apache Cordova gets a new look - The H Open Source: News and Features . H-online.com. February 22, 2012. Retrieved April 7, 2012.
  7. a b c Brian: PhoneGap, Cordova, and what's in a name? In: PhoneGap Blog. PhoneGap, March 22, 2012, accessed October 25, 2013 .
  8. Brian LeRoux: finding a new name did is not PhoneGap. org.apache.incubator.callback-dev, October 28, 2011, accessed October 25, 2013 .
  9. Adobe PhoneGap Build. Adobe Systems Inc., accessed October 25, 2013 .
  10. PhoneGap Apps. Phonegap.com, accessed October 25, 2013 .
  11. ^ Jesse: PhoneGap and the Apple developer license agreement. (No longer available online.) Phonegap.com, April 14, 2010, archived from the original on April 15, 2012 ; Retrieved on October 25, 2013 (English, In no uncertain terms, my contacts at Apple have assured me that "PhoneGap is not in violation of the 3.3.1 clause of the license agreement."). Info: The archive link was inserted automatically and has not yet been checked. Please check the original and archive link according to the instructions and then remove this notice. @1@ 2Template: Webachiv / IABot / www.phonegap.com
  12. ^ Ron Perry: How PhoneGap plays an important part in our Enterprise offering. (No longer available online.) Phonegap.com, June 27, 2011, archived from the original on April 15, 2012 ; Retrieved on October 25, 2013 (English): "At Worklight, we are not regular PhoneGap users: rather than developing PhoneGap-based apps, we have embedded PhoneGap into our enterprise-oriented mobile platform, and are fully exposing the PhoneGap APIs to our customers. " Info: The archive link was automatically inserted and not yet checked. Please check the original and archive link according to the instructions and then remove this notice. @1@ 2Template: Webachiv / IABot / www.phonegap.com
  13. Capulet: Convertigo Mobilizer Uses PhoneGap Build APIs. (No longer available online.) July 7, 2011, archived from the original on January 22, 2014 ; accessed on October 25, 2013 (English): "One of the exciting features of Convertigo Mobilizer is the ability to build cross platform native applications on iOS, Android, and BlackBerry. This features was made possible by integrating PhoneGap Build APIs in the Convertigo Server. “ Info: The archive link was automatically inserted and not yet checked. Please check the original and archive link according to the instructions and then remove this notice. @1@ 2Template: Webachiv / IABot / phonegap.com
  14. Darryl K. Taft: PhoneGap Simplifies iPhone, Android, BlackBerry Development. Eweek.com, March 13, 2009, accessed October 25, 2013 : "Ellis said the idea for the PhoneGap technology came out of an iPhoneDevCamp event in San Francisco."
  15. ^ Davis Lidija: PhoneGap: People's Choice Winner at Web 2.0 Expo Launch Pad. Readwriteweb.com, April 2, 2009, accessed October 25, 2013 .
  16. Stephen Shankland: Adobe buys PhoneGap, TypeKit for better Web tools. News.cnet.com, October 3, 2011, accessed October 25, 2013 .
  17. Klint Finley: Adobe Launches Hosted PhoneGap Build Service For Creating Cross-Platform Mobile Apps. TechCrunch, September 24, 2012, accessed October 25, 2013 .
  18. Prital Shah, Jacques Bourhis, Kaining yuan, Rao Meghana S: The Development of Mobile Applications using HTML5 and PhoneGap * on Intel Architecture-Based Platforms. Intel Corporation, June 22, 2012, accessed October 26, 2013 : “However, HTML5 has some limitations. Most prominent, is the lack of API to access device hardware and sensors such as accelerometer, compass, GPS, etc. While native applications can access device hardware, they lack the portability that web apps provide. Thus, a solution is to code a hybrid application, which cumulatively uses the benefits of native and web apps. "
  19. Plugin Development Guide. In: PhoneGap Documentation. PhoneGap, accessed October 26, 2013 .
  20. ^ Sapan Diwakar: Titanium vs Phonegap vs Native application development. June 21, 2012, accessed August 8, 2014 .
  21. ^ Andrew Trice: PhoneGap advice on dealing with Apple application rejections. Adobe Inc. , October 29, 2012, accessed October 26, 2013 .
  22. ^ Greg Avola: Creating apps with PhoneGap: Lessons learned. Adobe Inc. , September 17, 2012, accessed on October 26, 2013 (English): “When you add more complex CSS3 elements, heavy transitions, and supporting multiple devices (such as iOS and Android), however, it makes you realize that there are few steps you must iron out to prevent hair loss "
  23. PhoneGap Documentation: PhoneGap Platform Guides. PhoneGap, accessed October 25, 2013 .
  24. Jeremiah Cohick: Using PhoneGap and the Sony Ericsson WebSDK to develop Android apps. Android and Me, December 15, 2009, accessed October 25, 2013 .
  25. PhoneGap Build. Adobe, accessed on October 25, 2013 (English, see graphic).
  26. Phonegap.com: PhoneGap Supported Features. Adobe, accessed October 25, 2013 .