I am getting some problems between facebook and the microbrowser that Android>=5 (lollipop) pop ups when (for example... in my case) a user tries to connect to a open wifi, but its connection is limited. The problem I am experiencing is that, when I show the like box:
<div class="facebookOuter">
<div class="facebookInner">
<div id="fb-connect"
class="fb-like"
data-width="245"
data-height="290"
data-href="https://www.facebook.com/THE_PAGE_ID"
data-layout="button_count"
data-action="like"
data-show-faces="true"
data-share="false"
data-border-color="#F4F4F4"
data-layout="box_count">
</div>
</div>
</div>
It shows correctly with other brosers (including the iOS´s minibrowser -for the same case-), but not for the Android´s where never shows if the users like the page (the button allways shows the facebook icon), and clicking it, this event doesn´t work:
FB.Event.subscribe("edge.create",function(url, html_element) {
window.location="redirect.php";
});
The screen goes blank.
Thank you very much.
I am testing an Android Hybrid application using Appium v1.3.4 (REV c8c79a85fbd6870cd6fc3d66d038a115ebe22efe) which is the lastest at the moment. I also downloaded the latest ChromeDriver from here: https://groups.google.com/forum/#!topic/chromedriver-users/iBdJQHu1ipQ
The login screen in the application under test is a hybrid view (WebView). So I am switching to the proper context via calling appiumDriver.context("WEBVIEW_com.my.app.pkg")as shown below and I am also able to successfully locate and populate both the username and the password fields with the proper text data using the following code:
appiumDriver.context("WEBVIEW_com.my.app.pkg");
WebElement userNameTextField = appiumDriver.findElement(By.id("username"));
userNameTextField.click();
userNameTextField.sendKeys(new String[]{"Guest"});
WebElement passwordTextField = appiumDriver.findElement(By.id("password"));
passwordTextField.click();
passwordTextField.sendKeys(new String[]{"password"});
// The following code is not working
WebElement loginButton = appiumDriver.findElement(By.id("loginbutton"));
loginButton.click();
However, my issue is when I try to click on the login button on this screen! This is how the button is written in HTML
<div href="#" id="loginbutton" class="button">Login</div>
I tried many ways to click on the button while I am in the Web context but all so far has been in vain...This is the HTML snippet for the login screen
<div id="formbody">
<div class="line">
<input placeholder="Username" type="text" id="username" class="styled_input" value="">
</div>
<div class="line">
<input placeholder="Password" type="password" id="password" class="styled_input" value="">
</div>
<div class="line_button">
<div href="#" id="loginbutton" class="button">Login</div>
</div>
</div>
After many many attempts to click on the div/link in the Webcontext, I gave up and switched to the NATIVE context and was able to click on the button using the following code:
appiumDriver.context("NATIVE_APP");
appiumDriver.findElementByName("Login").click();
Can anyone explain to me why I am able to interact with the username and password textfields in the WebView context but have to switch to the NATIVE_APP context to be able to interact with the button?
Also note that while in the WebView context I am able to find the button ... tag by id and to call loginButton.getText(), loginButton.isEnabled(), loginButton.isDisplayed() and getTagName()
Thanks
driver.findElement(By.xpath("//*[#id=\"formbody\"]/div[3]")).click();
should work. Inspect elements on your device using chrome, this will give you exact xpath.
To inspect elements, type this command in chrome: chrome://inspect/#devices
Having trouble with the soft "NUMERIC" keyboard on my android/phonegap application.
My goal: create a simple form on a html5 page (that I will use with phonegap), where the user enters a number using 0-9 characters. To do this, I have used an input field with type = number, and this generates the correct soft keyboard on my android phone.
Unfortunately, I've felt a huge amount of frustration trying to detect when the enter key is pressed on the numeric keyboard. Usually when pressed, instead of submitting the form, the keyboard just goes away. However, if I change the type of the input to "text" then the enter key works as expected and submits the form.
How can I reproduce form submission using the numeric keyboard?
For reference see:
http://jsfiddle.net/Ua9yw/13/
WORKING ENTER SUBMISSION BEHAVIOR:
<form> <input type="text"/> </form>
<form id="form1">
<input type="text"/>
<input type="submit"/>
</form>
NOT WORKING ENTER BUTTON BEHAVIOR:
<form> <input type="number"/> </form>
<form id="form1">
<input type="number"/>
<input type="submit"/>
</form>
You can detect the next keyboard press by using the following bind in JQuery:
$('input').on('keydown', function(e){
if(e.which === 9) {
//your code here
}
});
The next button emulates the tab keypress event on a keyboard, which is key code 9. Unfortunately, keypress and keyup events do not detect the next key event, so you need to bind it on keydown.
We are developing a mobile web app in jQuery Mobile 1.0.1 and Phonegap 1.4.1 and have run into issues with the keyboard on the galaxy s2.
We have a menu which slides out and contains a search input:
<input type="search" placeholder="Search..." name="search" id="menu_search" data-role="none" />
When we tap in the input so that it gains focus, the keyboard opens but does not allow us to type anything in. I guess a clue here is that its giving us a regular text keyboard and not the search keyboard (which has a magnifying glass as the enter key)
If we focus the input when the menu opens: $("#menu_search").focus() - The search keyboard is open when the menu displays and we are able to search BUT as soon as we tap in the input the keyboard changes to a regular keyboard and we a not able to type anything.
Another clue is that while typing in the keyboard the auto-predict works but when tapping on the correct option only a space is added to the input and none of the other characters.
We have tried a bunch of other attribues on the search input to no avail:
<input type="search" placeholder="Search..." name="search" id="menu_search" value="" data-role="none" autocomplete="off" autocorrect="off" autocapitalization="off" role="textbox" aria-autocomplete="list" aria-haspopup="true" style="-webkit-appearance:searchfield;" class="ui-autocomplete-input" />
This all works fine on a HTC Desire running 2.2 and a desire running CM7 (Android 2.3.7)
We even tried changing the input to a textarea but this did pretty much the same thing :(
I also tried:
$("#menu_search").live('focus',function(event){
event.preventDefault();
});
to see if that would prevent it from changing keyboards but no luck either.
We do however have another search input elsewhere in the app which works fine, the only difference being that the other search is in a "propper" page: data-role="page" and the menu is outside of all of the other pages and in its own just set to hidden initially.
Please help, im crying blood atm!
You probably have
-webkit-user-select: none;
In your CSS somewhere. If you enable text selection for inputs
input, textarea { -webkit-user-select: text; }
it works again!
Did you try adding data-native-menu="false" attribute to your search input tag.
If you're still stuck on this, try updating to phonegap 2.0. It fixes some input problems.
$('#pageid').live('pageshow', function(event, ui) {
$(this).delegate('input[data-type="search"]', 'keyup', function () {
if($(this).val().length != 0)
keyword = $(this).val();
});
});
i'v create an app using phonegap + jequery you look for it in playStore "AssignmentReminder" or type in the search field koshWTF.
anyway. i'd encouraged this issue before and haven't fixed it as i guess its 4.0.1 issue not the phone gap nor jquery mobile , because i still can type under 4.0.4 and lesser. hope you find the answer for it because i did search aloot last time and couldn't find it.
I have/had the same issue on my Note II running 4.1.1 rooted using Phonegap 2.6.0 (though I can also replicate it in 2.5.0), jQuery Mobile 1.2.0, and jQuery 1.7.2. My keyboard is SwiftKey 4.0.1.128.
Except rather than just one input causing me issues, my form has multiple inputs that eventually cause me trouble. It's a real headache because it's hard to replicate - the input always works at first, but if you switch between inputs randomly and long enough, it eventually stops working at a random time.
This error used to happen fairly quickly, so that it would make it a pretty significant issue considering I would have to restart the app to get the form working again, which would eventually stop working yet again. My new form structure seems to work well; the error occurs after literally minutes of typing long strings and randomly switching inputs, which I assume no user will be doing; but it still upsets me that the error is there.
I tried to get help on this error on the jQuery Mobile forum, but they gave me some snarky comment about how it's likely just my element ID usage, because apparently 99% (probably not even realistic) of JQM errors are from incorrect ID usage. I know for a fact my IDs are all unique across every page, but they insist it's an ID error without even trying to correctly diagnose the issue, but I digress.
I should also note that I found the CSS solution that was provided in another answer in many other similar issues across the web, but not this exact issue; while I understand its usage, the CSS did not fix the issue for me.
My form is dynamically loaded into a data-role="content" DIV inside of a data-role="page" DIV, so:
<div data-role="page">
<div data-role="content" id="my-form-holder">
</div>
</div>
I've found the best form structure, at least in my application, to cause the error least frequently is:
<form id="account-add" action="add-edit-account.php" method="post" data-ajax="false" autocomplete="off">
<div data-role="fieldcontain" class="ui-hide-label">
<label for="custom-name">
</label>
<input name="custom-name" placeholder="Account Name" value="Service Name Here" type="text"><br>
<label for="custom-1">
</label>
<input name="custom-1" placeholder="User ID" type="text"><br>
<label for="custom-2">
</label>
<input name="custom-2" placeholder="Password" type="password"><br>
<input type="hidden" name="action" value="add-2">
<input type="hidden" name="newserviceid" value="3">
<input type="hidden" name="userid" value="1">
<input id="account-add-submit" type="submit" name="account-add-submit" value="Add Account">
</div>
</form>
The form HTML is fetched via AJAX and loaded into the DIV by:
$(ajaxData).appendTo("#my-form-holder").trigger("create");
Naturally, your form will be a bit different, and you may not even have a form since you just have a search input (getting to that in a moment). But if you do have a form, that's what works best for me.
Since you're in Phonegap, you may not even need an action theoretically since you likely have jQuery to handle the input, but jQuery Mobile docs state forms must have action and method attributes, so I didn't want to go against that. Also, jQuery Mobile usually has a data-role="field-contain" DIV around each label/input group, but I found that the error occurred sooner if I did this. Again, the error occurs at an arbitrary moment that is never the same, so I don't know if it's directly related to the DIV.
I also have an input hard-coded into another page:
<div data-role="fieldcontain" class="ui-hide-label">
<label for="service-search-input">
</label>
<input name="service-search-input" id="service-search-input" placeholder="Enter a service to search for" type="search">
</div>
This seems to work fine. However, there are no other inputs to switch to, so the best I can do to try to replicate the error is focus/unfocus the input by tapping elsewhere on the page. Though, I am always able to type initially whereas your error doesn't let you type at all if I understand correctly. You may want to try that HTML structure and see if it works. There is no form tag surrounding that input.
Our issues are a little different (I have most of my issues with a dynamically injected form whereas yours is hard-coded from what I gather), but this is the only page I could find anywhere that directly addresses this exact issue, so hopefully this helps and we can get some further insight on this issue.
I have the following html code that I am trying to display in an Android WebView.
<div id=header-right>
<p dir=RTL style='text-align:right;direction:rtl;unicode-bidi:
embed'><a name=1><b><span lang=HE style='font-size:13.5pt;mso-fareast-font-family:
"Times New Roman";color:#000099'> úôìú ùçøéú <o:p></o:p></span></b></a></p>
</div>
<div id=header-right>
<p dir=RTL style='text-align:right;direction:rtl;unicode-bidi:
embed'><a name=1><b><span lang=HE style='font-size:13.5pt;mso-fareast-font-family:
"Times New Roman";color:#000099'>îåãÆä <o:p></o:p></span></b></a></p>
</div>
The "weird" chars are hebrew. Both display correctly in a browser (firefox), when run in Android, the first displays correctly and the second displays incorrectly (the word is displayed inverted, first char last).
Both have exactly the same structure. I do not understand why is shown correctly and the other not
The first word is unvowelized; the second has vowels (nikud). There is a reported bug about this—vowelized Hebrew words are incorrectly laid out with letters going left-to-right (although, weirdly, words themselves are correctly laid out right-to-left).
You can test this diagnosis by removing the segol under the dalet in the second word (the only vowel) and seeing how it displays.