I recently started working with PhoneGap based on cordova to build an app for ios, android and windows phones.
For now I'm testing it on iphone, which is the main platform for this app and this question as well.
To make it easier, lets call my PhoneGap application "Scanner".
Here's what I'm trying to achieve:
You're in a random app, lets say the mail app. Click on an attachement and select "Open with..." Scanner. That should send the file to the scanner and send the path of that file to a javascript variable.
For now, I had no problem opening the xcode build and adding the document type, so my app is displayed in the open with menu.
Any idea how to get the app to display a file ? A pdf for example ?
If there's a global solution for the 3 platforms, that would be like heaven...
Thanks to all of you !
What you need is called "deep linking"
some plugins.
https://github.com/nordnet/cordova-universal-links-plugin
Happy codding!
******************* Edit *******************
I see your need, you are talking about Uniform Type Identifiers, but I dont find any information about how to use in cordova. Probably you will need to write your own plugin
https://developer.apple.com/library/ios/documentation/FileManagement/Conceptual/understanding_utis/understand_utis_intro/understand_utis_intro.html#//apple_ref/doc/uid/TP40001319
Related
I have couple questions about generating PWA App. Maybe at the first step I explain something about app for better understanding my problems with generating app for multiplatforms.
Multi Tenancy App
I can't say much more about application. This is application where users can create own account. Accounts is separated at servers, eg. app1, app2, app3 etc. Every server has his own domain, eg. app1.example.com etc. Every user can upgrade his account to premium type and define own domain, which can be go on and login to his account without using global domains (here is a problem with PWA app, multi domains). I think it is everything what you need to know, if you need more specific info, give me a feedback, I will try to help you. I need to use WebView because app need access to localStorage.
My problems
Problem is with multi domains. In manifest.json configuration is possible to define one domain, which app will be use to display application and authorize it (with assetlinks.json) to don't display URL Bar (for "Add to Home Screen" - with android app is possible to add wildcard).
I need possibility to use application with multi domains (I achieve it on android - explanation in the following part of post).
Problem is too with adding application from mobile Chrome "Add to Home Screen" and on the desktop "Install app...". After redirect to other URL, URL Bar is shown.
Next problem is to compile Windows Store app from Visual Studio (explanation in the following part of post).
I need more info about compiling app for iOS and MacOS - is this possible to compile and test it without Apple devices? I tried to use pwabuilder.com, but after download MacOS package folder is empty. Maybe virtual machine could help me with that? What you recommend too use to make that application? I tested what I found in google, but it wasn't what I expect.
Installation from Chrome browser
Is possible to change user URL without showing URL Bar? Now after autorization user and redirect him on the properly his premium address url bar is showing - i don't want users to have to go on properly domain and install app from "Add to Home Screen" - they should install it from any domain and use it like Native App.
Android
Partially solved problem with subdomains for every account. It's working properly, but maybe someone has any other authorization solution where I don't need custom subdomain for authorize app.
Windows Store
I installed Visual Studio, make new application with this documentation but I getting error
Error Project must have a reference to an application. Please add a reference under the 'Applications' node in the Solution Explorer.
Here is an issue - Maybe problem is with newest version of Visual Studio? Next question is, even if I compile the App, what with multi domain - URL Bar will be visible when user will be redirected? What if Chrome don't be installed?
iOS and MacOS
Maybe someone has good documentation how to create apps on this platform and where can I test it? What with multi domain? URL Bar will be shown? Is possible to make it invisible like an Android App eg. wildcard or other solution?
My questions
How to create PWA app for iOS and MacOS. Maybe is nice documentation for it.
How to build application for Windows Store. I made app with Microsoft documentation, but it doesn't work - problem was open on GitHub Issue, but without solution.
Is possible to use multi domains and don't show URL Bar for applications installed from mobile Chrome like a "Add to Home" or desktop Chrome "Install app...".
What if Chrome don't be installed on device? Application will be working properly? I know from android 8.1 is possible to remove chrome from android. I don't know if after remove Chrome application will be working?
Thanks everyone for help and your patience, I counting on much help from you.
I'm recently building a PWA with Vue and I'm trying to find a way of making the IOS package out of It. So far I haven't done yet but for Windows, Android & MacOs are pretty easy ... There a lot of blog tutorials for that and if you don't want to go through much of coding then the PWA Builder is the best option for you.
For your 4th question if you want to run a PWA from a browser the browser you have must support standalone desktop apps.
I wanted to try my PWA on iPhone from Chrome and couldn't because that chrome does not have the feature to pin an app to screen so I had to rely on safari only
Do we have any separate tool or add on like anything to get the x path in
android devices?
Else how can i get the values for android mobile devices?
It seems that you are asking about, How to inspect element in the android app, to find an element ID.
If you are using Native android application, then Android Studio is giving facility to inspect UI elements.
Once Android SDK installed, navigate to link
c:\users\username\AppData\Local\Android\sdk\tools you'll notice a batch file with name 'uiautomatorviewer.bat'. Double-click on it to launch "Uiautomatorviewer" GUI.
If your app is using web-view then you can use Google-inspector
Google-chrome-devtools
Our app uses Phonegap's inappbrowser to point to our website. Our website (written in Laravel) has an edit profile page where you can upload a profile pic. This works fine on desktop but in the Phonegap app tapping the 'Choose Picture' button does not bring up the Android file system or gallery. I've installed both file system plugin and file transfer plugin for Cordova and it doesn't make a difference. Is my only choice really to re-write this part of the app custom for Phonegap using JS?
<input type="file" has a lot of know errors on mobile and isn't supported with Android WebViews in general. I would suggest using the FileTransfer Plugin to accomplish what you're trying to do. Use the upload method of this plugin to manually upload the file to the remote server. Also look at the Camera Plugin to choose which image on the device to upload.
Install the plugin cordova camera and also FileTransfer, I think that could help you much more than any kind of input, remembers working in the default browser and operating system often fail with different html attributes. There are several ways to get the picture from the device to make an upload to a server. If you're only working on Android, check your code on several devices since in some models (mostly Motorola) my fault I often a code if it works in Samsung for example. Always keep your updated plugins.
Plugin Camera
FileTransfer
I am total cordova beginner. I created a sample application that runs on my phone. It is a simple Test Database with 1 Customer Table. Eventually I will want to import data from a local file. It might not be necessary to know where my app is located on my phone in order to do the import. However, where is my app located on the phone? I am using a file browser that shows hidden files, and I can't seem to find the app. I can run the app as it has an icon on my phone. The name of the app is HTML5_2. It also is called com.coolappz.html5_2. But I can't locate it using the file browser on my phone. Does anybody know what the app path is on the android phone? Galaxy S5?
This question had been asked before but does not have any answers. Maybe this is just one of those wonders of the world that just works but nobody knows why?
Thanks.
Mike
If you use the config.xml of phonegap or cordova and read the documentation in the web you can see that in preferences you can pick the android-installLocation and select if internalOnly, auto or preferExternal. If you pick preferExternal, the app be install on the SD. More easy to see the complete rute and write the code.
You can see more of the App install location here
Regards and good code ;)
I am making a Hybrid Application using cordova-cli. My requirement is that the first page in my application must redirect to a website. The entire data required for the application will be loaded into this website from some other data-sources.
The requirement is to access device native features such as camera, accelerometer etc. from pages on this website.
I am using
location.href="http://www.example.com";
to open the pages. I need a unified cordova.js file with all the plugins embedded into it.
Currently I am putting the individual plugins into the lib\android\plugin\android and by using the grunt -f command from grunt-cli, the cordova.js file recieved for android does not seem to produce expected results.
Can't be done I am afraid - because of the way Cordova interacts with the device.
What happens if, using a non-mobile device, you accessed the same website from elsewhere? The website will not know what on earth Cordova is.
Cordova interacts with the native code on the device, so requires this to handle the passing of JS-to-native, and vice-versa.