Navigation Epub3 on android - android

I've already built my app, I've got a backend CMS and whilst I can get it to work in opening my stories, I have an issue in being able to navigate within my stories. I've uploaded them using calibre and have the format in epub3 allowing extra features that I require. I've found that when I click within my stories, for a different chapter as an example, the corresponding chapter will open but it opens in a Web browser and from that Web page onto others if another click is submitted.
Is there anything within android studio that I can enable which may prevent this from happening?
I suspect it might be a feature of how calibre is scripted but if there is a way I can disable that function within android studio, it might prevent the user from being taken out of the app?

Related

Convert android deep link phone call saved as a shortcut into html anchor

Tl;Dr: I need to open deep link connected to a phone call from html page on Android. It MUST be the deep link, not the "tel:..." Url.
I've made simple mobile-friendly html page, with openstreetmap, showing gates around my residential block. Any gate could be opened by calling specific phone number, so, I've added map points, each having open link, that get opened by my android calling app (Google Phone), and gives ability to open the gate which is near me (on the map).
This solution is simple and workable, but it requires too many interactions, also, from time to time, after Google phone got open from the tel: link, the phone number isn't entered in the dialer (some kind of bug).
With specific command in Google Phone menu, I've created desktop shortcuts with the same numbers, and they are making the call by a single finger tap.
Now, I want to combine this two methods, as shortcut on Android desktop should be using some kind of deep link to the call app, but I don't know how to get the link that is used in shortcut.
Are there any tools/methods to see the actual deep links used to create shortcut, and use it in my html application to make it open immediately without opening Google call app dialer?
Googled a lot, tried different tools but no luck

auto-fill not working in InAppBrowserObject external website on Android device

I have been struggling to get my app working the way I want it to. I have an ionic/angular based app that is meant to be only for the Android platform. It is basically a wrapper for an already-existing website from the company I work at. The InAppBrowserObject works great for this, it does exactly what I want except that it doesn't auto-fill the login credentials. It makes it so users need to login every time they open the app which is not what we want. We want the external website to open in the app itself and not in the device's browser, so I use "_self" as target.
I have noticed that when I use the device's browser (target: _system) that it asks for permission to save the credentials and then it does actually save them. It is only when I use the targets: "_self" or "_blank" that I get no popup asking to save it (it also doesn't save it). In the image below you can see the code in the app.component.ts file and some information about the app which might be important. The app is small, it literally only has the app.component files and that's it. It opens the external website immediatly when the app is started.
At this point I am clueless as to what to do about this problem. I think I have visited every website that is related to this subject and the solutions are either outdated or there is no solution at all. I hope I gave enough information as to what the problem is, if not, I can always add more.
Information:
using Angular(ts), Ionic in vs-code. Testing apk in Android Studio.
InAppBrowserObject (Cordova, #awesome-cordova-plugins/in-app-browser)
app.component.ts file ^
target set to _self and not auto-filling the inputs (the inputs in the website are set with autocomplete on)
target set to _system and auto-filling is working correctly.

How to avoid Open button when embedding a pdf in an Android mobile web app?

I'm building a web app for internal use of a company that uses Samsung tablets (Android 9 and Chrome latest versions). I have a page with a list of links to PDF documents and the problem is that when I click any of them, they do not open automatically but instead show an Open button asking to open the document. If I click Open, the document opens as expected with the default viewer (Google PDF Viewer). When I go back, the Open button is still there. If the document has already been downloaded, the browser asks whether to download it again. These images show the situation:
http://www.maresme.net/stackoverflow/chrome_android_pdf/open_button.jpg
http://www.maresme.net/stackoverflow/chrome_android_pdf/allow_auto_downloads.jpg
Is it possible to bypass this step and have the docs open automatically without showing this button? I want to avoid this button and that when users go back from reading the doc they find again the list of links to other PDFs.
I've tried different methods of embedding PDFs (embed, object and iframe) without success. Also, I considered using pdf.js with the canvas tag but my webapp must also work offline and this solution uses too much resources.
Searching the net I found references about an option in Chrome under "Privacy and security" to allow automatic opening of the PDFs but this option does not appear in the tablets I'm using. Is it a security restriction that can't be bypassed?
I will really thank any help with this, it's driving me nuts.
I'm going to answer myself: the problem with Chrome mobile is that it has no support for extensions, so there is no PDF plugin that allows to view this kind of files within the browser. When you intend to open a PDF file the browser has to open it in an external app, be the default viewer (if defined) or any other which is capable (a list will be presented). This is why it asks permission, which I suppose it's a security measure and don't know how/if it can be circumvented.
With pdf.js (and other commercial kits) you can parse the PDF file using JavaScript in the browser, so no plugins are required. However, you must include all this code in your PWA for offline use (and there is some). Another approach that has worked for me is to use the Kiwi browser which supports extensions (I have a closed group of users and I can force this) and then use a plugin, for instance, the plugin version of pdf.js.
Hope this helps someone.

Manually open hyperlinks in specific app in Android

I use the Twitter app to follow a lot of news outlets. Each one of them posts links to articles on their websites. I want to open those articles in the news outlet's dedicated Android app. Some of them, like the NYTimes app, does it by itself. But most of them don't. I'm figuring that's because they haven't declared an intent in their app to do so. So basically I want to write an app that would give me an option to redirect the hyperlink of the article to a specific app, and I want to do it for multiple apps. Would it be possible to create a regex that would run on the URL and redirect it to the proper app accordingly?
Would it be possible to create a regex that would run on the URL
That is impossible to state in the abstract. Android's <intent-filter> system does not allow for filtering on all parts of a URL.
and redirect it to the proper app accordingly?
That is impossible to state in the abstract:
There is no requirement for the app for a news site to have any means for outside apps to tell it what to view
There is no requirement for an app's developers to document how to convert a Web site URL to whatever input would be available to tell the app to go view something
So, what you want may be possible for some news apps, but the details would vary by app.
Not that I am aware of - though this is an interesting concept.
Here are some things to know:
the twitter app doesn't care how the intent is resolved. the purpose of the intent is to share external data. once the twitter app has handed over the intent with the url it is up to the android system to decide which app can resolve.
the NY Times app is capable of opening because of this feature: https://developer.android.com/training/app-indexing/deep-linking.html
Workaround:
Learn to develop your own Android ROM to modify the Android Open Source Project adding your logic for intent resolution, compile and get your new Android ROM ready for deploy, install ROM on phone, keep your fingers crossed the entire time.

Turning Drupal 7 mobile themes into apps that use both REST and a webview together?

I have a number of Drupal 7 websites (http://drupal.org) that have a mobile theme with JQuery mobile (http://jquerymobile.com/) for users browsing with smart phones or tablets. Although this provides a great mobile experience I would like to create an app for the Android and Iphone that uses a few built in features for content creation (mainly just the camera on node creation). I have eclipse and the android emulators all installed and have an installation of Phonegap working for Android testing. Here is where I need some advice on the best approach to my particular problem.
Basically each app can be almost entirely just a webview (easy), but I do need 2 features which should add enough uniqueness to make it able to get approved in the MAC app store.
Ability to add nodes using a REST service (along with phonegap) have access to the use phone’s camera to populate an image field.
A start or front-page has a fast login, and allows instant access to add content (all assets stored locally on phone, so even if the phone is offline, this page will still come up).
Ability to go from the regular mobile site (webview) back to the local node creation page (with access to the camera) or frontage.
Ability to pass something to the webview so I can hide content creation links that access the web version of node creation forms (which would not have the camera for example).
Here is where I’m confused. I don’t want to recreate the entire site and retrieve all the data using services (lots of tutorials and stuff I’ve seen are doing this including DrupalGap - http://drupal.org/project/drupalgap). That seems like a ton of redundant work that will require lots of continuous updates when the site is upgraded and changed with no real gain other than speed (For this it’s ok that it won’t be as fast).
For my mobile apps, when a user wants to view their profile, look at various pages etc, that should all happen in a webview, I only need services and the typical approach to mobile development for the front page, authentication and node creation. The rest should happen in a webview. So what is the best way to switch between adding nodes and authentication using a service and just going to a regular webview? Should I try embedding a webview in a page and having a small menu on the top that doesn’t’ change which links to the add content and login?
How do I setup the session for both the webview content and the service? Or how I can I force authentication through REST and then pass that on to the webview?
You don’t have to answer each one of those directly, I would just like some tips to get me started in the right direction. So far I’m thinking I create a “frontpage” for the app with all it’s assets stored locally on the phone, which has a login which authenticates through a web service (REST). After you login it shows the link to add nodes and a link to view the webview. The big question is how I use the same session for both and how to navigate between the 2 well?
I accomplished the goals stated above, by have the login use a REST service via jquery mobile in a regular html page (like this tutorial http://tylerfrankenstein.com/code/android-app-with-drupal-7-services-phonegap-and-jquery-mobile) this is also where the create content links can be placed. When you want the user to be able to open the "regular" mobile website and already be logged in, use the childbrowser phonegap plugin (https://build.phonegap.com/docs/plugins). Users can close the childbrowser and go back to the main dashboard by clicking the X, or you can create a listener that responds to them vising a specific URL (like the homepage).

Categories

Resources