Thursday, August 27, 2015

Sign Releases with Cordova Android - Cordova 5

The Cordova CLI for Cordova 5 Phonegap  tutorial

Introduction: Adobe PhoneGap© says that it takes the pain off developing mobile apps! Android developers seemed to take heed of that as well as ios developers. And windows mobile app makers too. The biggies on deciding how to make an app have chosen Phonegap as the app creator. But the constant software development and revisions take a heavy toll on developers time and on documentation! 
As iLee.co.uk does not revise what is to be done for Gradle and Cordova 5, here it is for our developer colleagues revised as on 28 August 2015
Since the Cordova 5 was introduced about a few months ago, building and deploying Cordova apps for development has become different to say the least. E.g. for Android:






$ cordova build android









$ cordova run android


As before if you want to build a release version of an APK from the command line for production. Use command below however, this does not sign your release:





$ cordova build android --release


 To release a signed apk to Android with Cordova 5, first a keystore file must be created as usual.

$ keytool -genkey -v -keystore <"Name of Application">.keystore -alias <"Your Alias"> -keyalg RSA -keysize 2048 -validity 10000


Enter the keystore password and continue entering in all the rest of the prompted information
Copy this newly created key store created whichever folder you are in, into the platform/android directory.

Release in CLI workflow

Use this below to hooks directly into the cordova build android --release command.
Cordova 5 (might have been 4 as well) uses Gradle to compile now, so the old ant.properties no longer works. 
You can work the same trick by creating a release-signing.properties file in platforms/android and adding the following fill with your file name and other information:
storeFile=
storeType=jks
keyAlias=
// optional :
keyPassword=
storePassword=
Also It works with Java 7 no issues, no certificate signing issues. 
And finally give the command 
cordova build android --release 

and you get a signed zip aligned apk to be sent to the Google play store. 

Its is found in /platforms/android/build/outputs/apk/ folder

Happy developing!
Thanks Adobe and Apache Cordova





Get more value from your mobile app strategy


Develop Cross Platform Mobile apps.Call us



Wednesday, August 19, 2015

SAP Kapsel what a PhoneGap developer is trying to know!

Get your hands dirty by trying Kapsel  with SMP Cloud

Phonegap developers | PhoneGap development | phonegap services | Cordova PhoneGap Experts Services SAP with Cordova for a PhoneGap developer is  well ...complicated.See this "In the last years we have been focused on Sencha products because SAP WebDynpro for ABAP and JAVA were too restricted and did not fullfil the needs for a modern flexible UI that could also be used on mobile devices.

Since the end of 2013, SAP provides SAPUI5 as OpenUI5 under an Apache Open Source licence. The current stable state of the SDK and the possibility to realize Open Source apps on it, are the reason to use UI5 as our main UI strategy......." says  Holger Schäfer  And there is SAP Fiori.

SAP Kapsel is a set of plugins for Apache Cordova (open source) that provides a subset of the capabilities provided by Hybrid web container, and we have to use these plugins during the development of hybrid apps.

Since Kapsel is a part of SMP 3, and not sure whether all Kapsel plugins are officially supported by SMP on Cloud since the cloud version has difference with on premise.
Will be trying out Kapsel Logon plugin in an Android device with these steps.

Sign up for a free trial of SMP, cloud version: SAP HANA Cloud Platform
Download and install SMP 3 SDK (tested with SMP 3 SP01) from SAP Service Market Place
Install Cordova in your system (version 3.1.0-0.2.0), Apache Cordova
com.sap.mp.cordova.plugins.corelibs 3.4.0 "CoreLibs"
com.sap.mp.cordova.plugins.logger 3.4.0 "Logger"
com.sap.mp.cordova.plugins.logon 3.4.0 "Logon"
org.apache.cordova.console 0.2.9 "Console"
org.apache.cordova.device 0.2.10 "Device"
org.apache.cordova.inappbrowser 0.5.0 "InAppBrowser"

http://scn.sap.com/community/mobile/blog/2014/05/01/get-your-hands-dirty-and-try-kapsel-with-smp-cloud

"A lot of companies are struggling with the question how to unlock the vast resources of their SAP installation for mobile development. Should we wait for the technologies SAP promises in its road maps or are there alternatives? There are many RAD platforms out there, but only two have reached the maturity that allows for very robust and performing integration with SAP: OutSystems and Mendix."

Saturday, August 1, 2015

Cordova 5 what a PhoneGap developer needs to know

     A complete change this Cordova 5 for a PhoneGap  developer


Apache Cordova is an open-source mobile development framework. It allows the PhoneGap developer (or Cordova developer) to use standard web technologies such as JavaScript for cross-platform development, avoiding each mobile platforms' native development language. Applications execute within wrappers targeted to each platform, and rely on standards-compliant API bindings to access each device's sensors, data, and network status.

Apache Cordova graduated in October 2012 as a top level project within the Apache Software Foundation (ASF). Through the ASF, future Cordova development will ensure open stewardship of the project. It will always remain free and open source under the Apache License, Version 2.0. Visit cordova.apache.org for more information.

Cross-platform (CLI) workflow
Use this workflow if you want your app to run on as many different mobile operating systems as possible, with little need for platform-specific development. This workflow centers around the cordova utility, otherwise known as the Cordova CLI, that was introduced with Cordova 3.0. The CLI is a high-level tool that allows you to build projects for many platforms at once, abstracting away much of the functionality of lower-level shell scripts. The CLI copies a common set of web assets into subdirectories for each mobile platform, makes any necessary configuration changes for each, runs build scripts to generate application binaries. The CLI also provides a common interface to apply plugins to your app. For more details on the CLI, see The Command-Line Interface. Unless you, the PhoneGap developer have a need for the platform-centered workflow, the cross-platform workflow is recommended.

Release highlights a PhoneGap developer needs to know:

Plugins have been renamed and the Cordova-CLI now supports fetching plugins from npm. We highly recommend reading about it in the plugins release blog post.<feature> tags have been renamed to <plugin> tags in your projects config.xml. Adding a <plugin> tag to your config.xml will fetch and install it on cordova prepareif it isn’t already installed.

Cordova Android@4.0.0 has been released and pinned as the default version for new projects. This includes support for pluggable WebViews! Read about it in the Android 4.0.0 release blog post.
  • Template app, Cordova App Hello World, has been moved to npm.
  • Added the ability to manage your plugin and platform dependencies in your project’sconfig.xml. When adding plugins or platforms, use the --save flag to add them toconfig.xml. Ex: cordova platform add android --save. Existing projects can usecordova plugin save and cordova platform save commands to save all previously installed plugins and platforms into your project’s config.xml. Platforms and plugins will be auto restored when cordova prepare is run. This allows developers to easily manage and share their dependencies among different PhoneGap development environments and with their coworkers.
  • The whitelist plugin and its security ramifications-the need to specify all external sources.Sample tags  Access to all the subdomains on google.com, for example mail.google.com and docs.google.com:
  • origin="http://*.google.com" />
  • CSP  the Content Security policy and the meta tag ( as per MozillaContent Security Policy (CSP) is an added layer of security that helps to detect and mitigate certain types of attacks, including Cross Site Scripting (XSS) and data injection attacks. These attacks are used for everything from data theft to site defacement or distribution of malware.Sample meta tag being:-
  •     
  •       content="default-src *;
  •                script-src * 'unsafe-inline' 'unsafe-eval'
  •                            127.0.0.1:*
  •   http://*.google.com
  •   https://*.google.com
  •                            http://*.gstatic.com
  •                            http://*.googleapis.com
  •                            https://*.gstatic.com
  •                            https://*.googleapis.com
  •     http://www.webprogr.com
  •             http://*.revmob.com
  •                            ;
  •                style-src  * 'unsafe-inline'
  •                            127.0.0.1
  •   http://*.google.com
  •   https://*.google.com
  •                            http://*.gstatic.com
  •                            http://*.googleapis.com
  •                            https://*.gstatic.com
  •                            https://*.googleapis
  •     http://www.webprogr.com
  •    https://*.revmob.com
  • ;
  • frame-src  *
  • "
  • >
The best way to debug continue to be Android Studio's monitor.bat but the earlier nice tag usage adb logcat CordovaLog:D *:S no longer works as they have replaced CordovaLog with 'Web Console' and these two words(why?) cause problem with grep.

The main problem is that not all plugins have been updated especially advertising,billing, Google analytics etc. And the PhoneGap developer would be at his wits end as Android Studio would refuse to compile what with the shenanigans of the constantly revised Google Play services versions!

Of course things are improving very fast daily with the smart people at Adobe, Apache, IBM and Google at work on the framework.