How to create static app shortcut for android 7.1 app? - android-7.1-nougat

like this I want to do with my own shortcuts. And to open particular activity depending on shortcut type

Create android project with target api level 25
Create an xml named shortcuts.xml under res, inside xml directory and add following code in it: (to create static shortcuts)
<shortcuts xmlns:android="">
android:targetPackage="Package_Name_Of_Activity" />
Inside Manifest.xml add this meta-data tag for your activity:
android:resource="#xml/shortcuts" />
And test it by long pressing app icon.


PhoneGap URL scheme on other pages not working

Hi i have this simple app and and i use myapp:// to open app my ANDROID APP this works file but when i use myapp://index.html to open a page it does not work i searched the internet but i could not find the solution can any body tell me i want to open a specific page in my APP because TWITTER does not support myapp:// it supports only if if has any extension like myapp://index.html
or if this is not possible is there any why i could redirect user to a url myapp:// after login from my TWITTER application
Muhammad Zeeshan
You can listen also http scheme as your site with a listener activity. Something like this code.
<activity android:label="#string/app_name" android:name="com.foursquare.robin.BrowsableActivity">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" android:host="" android:pathPrefix="/" />
<data android:scheme="https" android:host="" android:pathPrefix="/" />
When any platform re-route your app to your scheme will be revoked shortly.
That myapp:// URL is only useful within the device as a means to start another app on the device (or, in this case, to start your app from another app). I think what you want to do is use a plugin that allows your app to login using the builtin native apps. See this plugin, in particular, as a possible solution:
You can make "myapp://" as your mobile app URL scheme using these things :
Android :
In your menifest.xml file, add intent-filter into tag
<application ... >
<activity ... >
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="myapp"/>
Use android:scheme="myapp". So, whenever you want to start your app from other app, you need to add this hiperlink.
Open myApp
iOS :
In iOS, open .plist file of your project(which can be found in Resources/) in xCode.
You need to add 2 things :
Information Property List->URL types->item0->URL identifier = Bundle identifier
Information Property List->URL types->item0->URL schemes = myApp
If anything is not there, you can right click and select "add row", then you can type elements. Help will help you. ;)
So, whenever you want to start your app from other app, you need to add this hiperlink.
Open myApp
Your app will open if it is pre installed in device
You can use javascript frameworks for single page apps.
they can handle by easy way that you do not need to request to other url or external file.
all of your application will run in just single page without refresh.
here i offer list of this frameworks:
backbonejs ( that is easy to use )
angularjs witch is google project and personally i offer this.
list of javascript single page framework is mush bigger, but know about these more.
to handle custom url schema i know some plugins, but personally i did not test theme
- Custom URL scheme

Is there a way to submit a reactjs PWA on Google Play?

I want to use the "Write once, run everywhere"
So I created a PWA in reactjs with create-react-app.
My app works greatly, and I can put it on the home screen of my mobile from the website.
However, I want to be visible on mobile stores too (starting with Google Play).
I tried:
Microsoft pwaBuilder which doesn't seems to work (the downloaded bundle is not recognized by Google play)
Packaging my app in Cordova (by copying files of the reactjs build in www) but I'm stuck with a white screen like some other people (publishing PWA on app stores : google play and ios itunes, Reactjs with cordova)
Is there a way today to deploy a reactjs PWA app on a store?
That would realize my great dream about progressive web apps :)
months ago I've developed a small ReactJS application using Cordova/Phonegap that actually works so I think you miss a couple of details in order to make your application works.
First, did you wait the deviceready event before to bootstrap ReactJS?
Your entry point should be something like this ( code is quite old, I used it in an old AngularJS application and adapted it just to bootstrap ReactJS )
var appName = 'myApp';
var PhoneGapInit = function (appName) {
this.boot = function (appName) {
<Route exact path="*" component={ApplicationAsync} />
if (window.cordova !== undefined) {
// "Found Cordova";
var self = this;
document.addEventListener('deviceready', function() {
}, false);
// 'PhoneGap not found, booting manually';
window.addEventListener('load', () => {
new PhoneGapInit(appName);
Second, using Webpack I've found necessary to use this webpack plugin to have cordova object available, ( everything is explained there )
Moreover your index.html should contain a body tag like this
You need to enable JavaScript to run this app.
<div id="root"></div>
<script type="text/javascript" src="cordova.js"></script>
The first step should be enough to have your application running.
Also, it is important to know that using Chrome it is possible to access the console to see what is happening in the application, just follow these steps
Connect your device with the application installed ( must be
DEBUG version, not release )
Open the Chrome console and near the last tab you should see a
three vertical dots icon, click it and select 'more tools', then
'remote devices', you should see your connected device listed. Select
Find your application in the list and click the 'inspect' button,
at this point you shold have your application opened also in Chrome browser.
Hope it helps
The simple answer is there's currently no way to directly add your PWA to the Google Play Store, Apple's iTunes or Microsoft's App Store. You can, however add your PWA directly to Amazon's App Store. For the rest of them, you have to first create a wrapper for it, then deploy the wrapper package to the store. Since you specifically asked about Google Play Store, you basically need two files (see below), plus a few supporting files, which will be automatically created for you when you create a new Android project in Android Studio (or similar environment). You need a main activity that launches your PWA starting URL, something like:
public class MainActivity extends Activity {
protected void onCreate(Bundle savedInstanceState) {
WebView webView = (WebView) findViewById(;
WebSettings webSettings = webView.getSettings();
webView.setWebViewClient(new WebViewClient() {
public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
"Failed loading initial resources. Online access is needed when starting the app up for the first time. Close and try again with network connectivity", Toast.LENGTH_LONG).show();
super.onReceivedError(view, request, error);
You don't need a XML layout file (you could just create the WebView in code) but in case you prefer configuring options in xml, it'd be something like this:
<?xml version="1.0" encoding="utf-8"?>
<WebView xmlns:android=""
Finally, you need the AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android=""
<uses-permission android:name="android.permission.INTERNET"/>
<activity android:name=".MainActivity"
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
Then, you need Android build tools to create your package. If you've downloaded Android Studio, you are all set. The good thing is that, once you've published your wrapper app, you don't need to change it much but can focus on updating just your PWA.
For Microsoft App Store, the process is similar. You don't necessarily need Visual Studio. You can just use PWABuilder's package as a base, remove whatever you don't need and create an "app package upload file" with (Windows) command-line tools.
For iTunes, you need another wrapper and AFAIK, the only way to create one is with (Apple's) Xcode IDE.
The problem was about the create-react-app PUBLIC_URL environment variable which was unfilled.
With a cordova run browser, all seems to be ok as browser seems to be more permissive in the path resolution.
I had as example a /favicon.ico
But when i was doing cordova run android, path were not found at runtime.
By creating a new file .env and put in it:
resolved the path error and the application works now well!
The advice of Sergio running on device with chrome chrome://inspect helped me a lot
Yes there is way to publish your PWAs to PlayStore.
Trusted Web Activities are a new way to integrate your web-app content such as your PWA with your Android app using a protocol based on Custom Tabs.
TWAs uses The Digital Asset Links protocol and API enable an app or website to make public, verifiable statements about other apps or websites. For example, a website can declare that it is associated with a specific Android app, or it can declare that it wants to share user credentials with another website.
Checkout the following link for complete guide to launch PWA to Appstore by Google Developers forum and tutorial guide on medium by Maximiliano Firtman here

Cordova - Change app name accordingly to the build type

I need to change the app name of a Cordova based project depending on the gradle build type (debug/release). If I understand correctly, Cordova uses the <nametag in master config.xml as app name. Is there any easy way to configure it? If no, what should I use?
I am using cordova-android": "^6.2.3
Below are the 3 ways to do so :
- Step 1:
You can set the name of your Application in your config.xml
the tag which defines it is
<name>your appname</name>
- Step 2 :
You actually need to go to res -> values -> strings.xml and change:
<string name="app_name">Your app's name</string>
- Step 3:
In cordova project> properties> WMAppManifest.xml file you can change you app's name and icon as well.
If Still Issue :
Check this link -
Change the value of android:label attribute in your <application> tag in your AndroidManifest.xml fileLike this:
android:label="#string/app_name" <!--Replace with your Application name-->

How to show my cordova app in IOS share menu?

We have an existing Cordova iOS App for which we need an iOS share extension which will allow Users to to share files from other apps (like Photos, Pages, Numbers, Keynote, etc) with our App (i.e. Export file from Pages to our App).
We need the following delivered:
Prototype / Sample iOS Cordova App
with a share extension setup up for jpg, png, video, pdf and office (xls, xlsx, doc, docx, ppt, pptx) files
Extension to either open the Cordova App directly OR to open the Cordova App as a webview inside the share widget
Cordova App must receive parameters about the shared file (filename, path, type, filesize) from extension - the handling of the file afterwards will be done by us.
Documentation on how to implement this functionality (share extension) in our existing Cordova App (steps necessary to perform in Xcode etc)
I think you could find a solution here. It is not clear, but it seems to work.
There is a cross-platform cordova plugin (iOS and Android) that achieves that:
That's a good and still relevant question.
I tried to make use of the awesome cordova-plugin-openwith by Jean-Christophe Hoelt but faced several issues. The plugin is meant to receive share items of one type (say, URL, text or image), which is configured during installation. Also, with its current implementation, writing a note to share and selecting a receiver in a Cordova app are two different steps in different (native and Cordova) context, so it didn't look as a good user experience to me.
I made these and other corrections to this plugin and published it as a separate plugin:
Note that it works only for iOS, not for Android.
There are few links which could be helpful even if you do not want to use open with plugin
In android editing, the manifest worked fine for me. I had to add one more java file added in some already added plugin like below in plugin.xml. Which in turn added in the manifest.
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
<data android:mimeType="application/pdf"/>
<data android:mimeType="application/msword"/>
<data android:mimeType="application/mspowerpoint"/>
<data android:mimeType="application/powerpoint"/>
<data android:mimeType="application/"/>
<data android:mimeType="application/x-mspowerpoint"/>
<data android:mimeType="application/excel"/>
<data android:mimeType="application/"/>
<data android:mimeType="application/x-excel"/>
<data android:mimeType="application/x-msexcel"/>
<data android:mimeType="application/vnd.openxmlformats-officedocument.wordprocessingml.document"/>
<data android:mimeType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"/>
<data android:mimeType="application/vnd.openxmlformats-officedocument.presentationml.presentation"/>

How to share a link within ionic app that links back to the app

I am trying to implement social sharing within ionic app, I was able to successfully share links through native share sheet. When the link is clicked by the person whom the link is shared with it is meant to link back to the item within the app, If the the user have the app installed, otherwise, it prompt the user to install the app. But it is not work that way, rather it asks if you want to open with PlayStore or browser.
Below is the first thing I did which shares the link successfully after installing cordova social share
.controller('myCtrl', function($state, $cordovaContacts, $ionicActionSheet, $cordovaSocialSharing ) {
$scope.share = function(id) {
.share("my Link Description", null, null,""+id) // Share via native share sheet
.then(function(result) {
// Success!
}, function(err) {
// An error occured. Show a message to the user
and the view is like this
<a ng-click="share(id)"><i class="ion ion-share"></i> </a>
When the link refused to work as I expected, I did a further research, and I found Custom URL scheme PhoneGap Plugin which is a cool plugin for Cordova that is designed to allow to launch apps by clicking on a link in an email or on a web page
after installing the plug , the link is meant to be used like this;
Open my app
Open my app
Open my app
Open my app
but if I put any of this raw into the social sharing implementation, it shared it as it is written, so the link cannot be clicked.
Okay. Let's go step by step.
First of all, you need to install, not only the plugin you use for the URL scheme (I use this one), but also a universal-link plugin which links the http URL to your app example://.
After all the process, your config.xml file should be like that:
<plugin name="cordova-plugin-customurlscheme" spec="~4.2.0">
<variable name="URL_SCHEME" value="example" />
<variable name="ANDROID_SCHEME" value=" " />
<variable name="ANDROID_HOST" value=" " />
<variable name="ANDROID_PATHPREFIX" value="/" />
<plugin name="cordova-universal-links-plugin" spec="~1.1.2" />
<ios-team-id value="xxxxxx" />
<host name="" scheme="https">
<path event="openUrl1Page" url="/url1/*" />
<path event="openUrl2Page" url="/url2/*" />
Note: You'll see that a folder called ul_web_hooks is created. Copy also the <link> elements to your main .html file (Actually for me It works without that, but in the documentation, they say it's necesary).
After you have done that 2 things, you should be able to open your app throught console typing something like:
adb shell am start -W -a android.intent.action.VIEW -d ""
It should also work if you use the URL scheme:
adb shell am start -W -a android.intent.action.VIEW -d "example://url1/x"
Next, you'll need to manually bootstrap your app, so cordova decides bootstrapping depending of the way the app was loaded (common loading opening the app or because someone clicked the link) (note that here you'll have to handle the resume and pause possible status of your up with their respectives addeventListener.
Pay attention since it's a nice trick to use your $urlRouterProvider.otherwise() since you can set over there the right path.
Our last step should be to create a website for those who open a link for the first time and the app is not installed yet (They will successfully open the URL).
Hope it helps!'{{YOUR URL}}, '_system', 'location=yes');
and'{{YOUR URL}}, '_system', 'location=yes');