Phonegap (android) - Enable URL TextView in InAppBrowser - android

How do I enable the URL field in the InAppBrowser in Phonegap 2.5.0 running on Android? Currently when I tap the field to type a URL, nothing happens (although in Eclipse it is reporting "TextView does not support text selection. Action mode cancelled.").

Yeah, that is by design. The location in that text field is not editable. If you want that type of functionality you may want to go back to using the ChildBrowser or edit the InAppBrowser code yourself.

Related

InAppBrowser clipboard context menu doesn't show up on Android

I'm using Ionic for building a multi-platform hybrid app that, basically, just opens a responsive web app, with InAppBrowser plugin. I can't figure out why, only on Android (on iOS it works as expected), the standard context menu, for copy/paste operation, after a long click on input text, doesn't appear, only the markers for the select text are displayed.
I can't find out what I'm missing, did it suppose to show up by default, on Android, or did I need some configuration, register some listener, use other plugin or whatever?
So, in short, if I copy some text on a device (e.g. from google.com) and I want to be able to paste it, on Android, in an input text, of a page opened with InAppBrowser within my app, is it possible and how can I achieve that?
I confirm that the standard behavior, even with InAppBrowser, is to display the context menu, to manage copy/paste operation, on long click, on the selectable text.
So, in my case, it wasn't an InAppBrowser problem, but it was the site who disable all context menu (iOS just doesn't care and show it anyway, but that's another story).

Is there any way to avoid this screen while accessing "mailto:"?

I am trying to use mailto link in my app but when clicking that link, I am getting a screen saying
"Webpage not available and some error", although email application
opens properly but I want to bypass that background error page.
Please note that I am using following code inside the button click:
window.open('mailto:alok1141#gmail.com?subject=Feedback: Competitive Aptitude');
Please suggest any way to avoid this background page.
Image with background error screen
My best guess is that you need to use a link <a href="mailto:..."> instead of a button or maybe use window.location=... in the onClick so that the browser can present the popup directly.
Now you tell the browser to open a window with the mailto url so only after the window has been opened it will check the url and present the popup.
There's two kind of format "mailto:" or "message/rfc822" MIME type. You have to add it on Intent with setType() If no app supports both, then it will shows the default chooser.
Have you tried setting the target to _system? It could be that your app is attempting to handle the link itself and failing. By setting the target to _system, you are asking the OS to open it for you.
window.open('mailto:alok1141#gmail.com?subject=Feedback: Competitive Aptitude', '_system');
You will also need the inappbrowser plugin. This plugin ensures that adding _system actually works. I believe on Android you may not need this, but you definitely will for iOS.
cordova plugin add cordova-plugin-inappbrowser
Thanks,
I found the solution. Actually when you run the application in phonegap app it will not open href="mailto: xyz#email.com" thats why I had to use window.open,
but once you will build the app even href="mailto: xyz#email.com" will work and best thing is it will directly open the app and no background error page will appear.

How do I trigger a Cordova Webview to pop up when user clicks on a row in a native Android listview

I've finished the Cordova tutorial (http://cordova.apache.org/docs/en/2.5.0/guide_cordova-webview_android.md.html). So now it's very clear how to use a Cordova webview event to trigger something in the native app. But I still don't understand how to write functionality that goes in the other direction. How can I make a native Android listview that triggers a Cordova webview to pop up when the user selects one of the rows in the native Android listview? Of course it would need to pass the data from the row that was selected as an argument to the function that calls the Cordova webview up on the screen. Here's a similar question someone answered for iOS but it still doesn't help me much for Android (and the answer doesn't give a concrete use example) Bind a native iOS event to a webView using a custom Cordova plugin

Changing the Keyboard for Specific App on Android

I am developing a "Nepali Dictionary Android App" using Cordova. Using jQuery I have been able to map the keyboard character to Devnagari. For example If you pressed the 'k' from keyboard 'क' will be displayed in editable text inputs. Now , I am trying to change the keyboard characters so that the users could see Nepali characters in keyboard.
I don't know If it is possible or not, but I think it should be. I am not a java programmer and using cordova api to build the android applications. I am also planning to create MultiKeyboard Phonegap / Cordova Plugin for android (in future ) if It is possible.
My Question is :
How can I change the android keyboard characters for some specific apps ?
WHAT HAVE I TRIED
I have not started coding for this because I don't know if it is possible or not. Please show me the right way.
Thanks.
You could change char value with different value if the given input values will not be used. What i mean is if 'k' will never be used you could catch that input in for example
var tempChar;
variable and swap it's value from a HashMap, but I don't know if you can change the layout of keyboard using PhoneGap only. If you can't do, you can draw your own keyboard using jQuery Mobile if there is way to disable Android keyboard for your app.

Phonegap 2.6 android inappbrowser opens on self despite _blank being passed

I am using PhoneGap 2.6.0 with Sencha Touch 2.2 on Android 4.0.3. I am calling the InAppBrowser to open a share url to facebook like so:
window.open(encodeURI('https://www.facebook.com/sharer/sharer.php?u=http://www.mycoolapp.com/&t=Everyone check this out'), '_blank', 'location=no');
However, instead of opening the InAppBrowser with the UI, it opens on top of my app screen without any 'OK' button like on iOS or any way to close and go back.
I am able to go back with the standard Android OS back button.
Is there any way to get the url bar and the OK button to show on the Android InAppBrowser for PhoneGap?
As per window.open section in docs, you have to give `location=yes' to show location bar. Regarding type of window, do you see any difference when you pass '_self' and '_blank'?
Maybe a problem with your Access-origin in res/xml/config.xml (PhoneGap 2.6.0 Domain Whitelist Guide)...?
As others stated, for android you have to specify location=yes and no you can't get riddle of the location bar and mantain back button.
But if you are on Android why do you have to keep it?
Being able to coming back with physical back button is the preferred behaviour by design in Android.

Categories

Resources