I am new to Sencha Touch and Phonegap. I have one html file and one js file. I want to have 3 tabs. In each tab I am putting different Twitter search result. But I don't know when to put my tweet code.
Here is my index.html file: http://pastebin.com/Nv2Jfqr4
Here is my index.js file http://pastebin.com/f9nmycBP
And here is my tweet .html file http://pastebin.com/PPpGiZ3k
You need to take a look at the Kitchen Sink and tell us what kind of user interface component you want to put your twitter search results (probably a list) and then we'll help you achieve what you want.
Related
Any one knows how to detect click event of play button of iframe/video in HTML which is loaded in web-view.
in HTML Page contains like
<p><iframe width="100%" src="youtube.com/embed/uxpDa-c-4Mc"></iframe></p>
and i need to detect click event of Playvideo button in android webview.
Give the element an id, do the following in Javascript (I am assuming you have JQuery, your question itself is lacking details in many ways as I write this right now, you should really try to give more information in order to get answers).
EDIT: My solution to the iframe/jquery issue would be to use a video element instead of an iframe. Here is how: Show Youtube video source into HTML5 video tag?
We would then continue to use the below JS/JQuery
Example JQuery:
$('play').on("click", function() {
//Do something
});
Example with shortcut implemented:
$('play').click(function() {
//Do something
});
I am using XE7 Rad Studio to build "apps" for Android and IPhone. Focusing on Android for the moment.
According to the requirements, I need to load the HTML inside the application as a resource string.
WebBrowser1.LoadFromStrings(ResourceStrings.HTMLString,'');
//Loads the resource-string successfully.
However in this resource-string I need to load images, and I cant figure out how to do it. I can see in deployment that I have the images loaded into the project {Bitmap_1, Bitmap_2,Bitmap_3}.
How do I complete this line:
resource-string:
...'<img id="img2" class="thumbnail" src="/images/im2.bmp" alt="/images/im2.bmp"/>'...
Many thanks.
If you read the documentation for LoadFromStrings(), it says:
Displays HTML string content within the TWebBrowser component.
This method uses the following parameters:
Content: specifies the HTML string to be displayed.
BaseUrl: specifies a path that is used to resolve relative URLs within the loaded page. To clarify, consider the following scenario: this parameter is set to www.mycompany.com/departments/, and the loaded page defines a link <a href=’Sales.html’>Sales dept</a>. In the given case, clicking this link opens http:// www.mycompany.com/departments/Sales.html.
That is the exact scenario you are running into. Your HTML contains relative links to external images, but you are not providing a BaseURL, so the WebBrowser cannot resolve the correct URLs it needs to load those images.
In the Deployment Manager, set the Remote Path of your image files to either StartUp/Documents/images/ or StartUp/Library/Application Support/images/.
At app startup, Delphi will copy files beginning with StartUp to the appropriate folder on the device. Then you can do the following when calling LoadFromStrings():
// note sure which function to use for 'StartUp/Library/Application Support/',
// maybe TPath.GetLibraryPath()? This example is for '/StartUp/Documents/'...
WebBrowser1.LoadFromStrings(ResourceStrings.HTMLString, 'file://' + TPath.GetDocumentsPath);
That will allow "/images/im2.bmp" to resolve to something like file:///data/data/<application ID>/files/images/im2.bmp", etc.
https://github.com/guidosabatini/phonegap-plugins/tree/master/Android/WaitingDialog
I found this Waitling Dialogue Plugin for Phonegap. But i don't know how to use this, i mean where to put the files?
So please help me to solve this issue.
Download and put the WaitingDialog.java inside main package in src.
Then download and include the WaitingDialog.js file in your in the html file. Something like the following:
Then call necessary functions:
// To SHOW a modal waiting dialog
window.plugins.waitingDialog.show("Your dialog text");
// To HIDE the dialog
window.plugins.waitingDialog.hide();
[I haven't tested, but hopefully it will work.]
Alternative Solution:
If you are using jQuery Mobile then another solution can be to use jquery.mobile.utils to show the loader.
Download and include the jquery.mobile.utils.js file in your html file. Then call necessary functions like below:
// Params: jqm theme swatch, and message text
$.mobile.utils.showWaitBox("a", "Hang on while I do work...");
// ... some time later...
$.mobile.utils.hideWaitBox();
[This one is tested and works fine.]
I am trying to open email activity and to display in the email's body the following:
Display a hyperlink to a web site.
Display (not attach) an image logo (.png file).
I tried using html/text/image mime type and nothing works for both things.
I even tried to copy the png file to an sdcard and displaying it from sdcard path instead of using the "Assets" location that may be restricted and private only to the application, but it did not help as well!
Can anyone give me a code which works for both things??
Waiting for you help guys!!
Have you tried :
Linkify.addLinks(yourEmailString, Linkify.WEB_URLS);
yourTextView.setMovementMethod(LinkMovementMethod.getInstance());
It will make all links in the message clickable, not sure if this is what you are searching though :)?
can we freely put more than one html5 file in android app developed with dreamweaver cs5.5?
example:
page1.html
page2.html
page3.html
then provide hyperlinks between the pages?
I tried doing this but the browser refuses to load the pages.
If you have your HTML files in the assets folder, say in a subfolder in /assets/html/, the following would work...
Java code could look something like this:
private void displayHTML5Page(String filename) {
webView.loadUrl("file:///android_asset/html/index.html");
setContentView(webView);
In HTML you access other pages using something like:
Here's a Second Page
Here's a Third Page
Here's a Fourth Page
....