Search Results

Search found 75 results on 3 pages for 'openurl'.

Page 2/3 | < Previous Page | 1 2 3  | Next Page >

  • problem with opening link through safari with webview

    - by Desmond
    hi i had encounter a problem opening a web link through safari. this is my code header #import <UIKit/UIKit.h> @interface qrcode_info : UIViewController <UIWebViewDelegate,UIAlertViewDelegate> { } @property (nonatomic, retain) IBOutlet UIWebView *Web; @end //main file #import "qrcode_info.h" @implementation qrcode_info @synthesize Web; -(BOOL)Web:(UIWebView *)Web shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType { if (navigationType == UIWebViewNavigationTypeLinkClicked) { [[UIApplication sharedApplication] openURL:[request URL]]; return NO; } return YES; } //[[UIApplication sharedApplication] openURL:[inRequest URL]]; //return NO; - (void)viewDidLoad { [super viewDidLoad]; [Web loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"help" ofType:@"html"] isDirectory:NO]]]; //self.wvTutorial = [[WebViewController alloc] initWithNibName:@”WebView” bundle:[NSBundle mainBundle]]; }

    Read the article

  • How to detect crashing tabed webbrowser and handle it?

    - by David Eaton
    I have a desktop application (forms) with a tab control, I assign a tab and a new custom webrowser control. I open up about 10 of these tabs. Each one visits about 100 - 500 different pages. The trouble is that if 1 webbrowser control has a problem it shuts down the entire program. I want to be able to close the offending webbrowser control and open a new one in it's place. Is there any event that I need to subscribe to catch a crashing or unresponsive webbrowser control ? I am using C# on windows 7 (Forms), .NET framework v4 =============================================================== UPDATE: 1 - The Tabbed WebBrowser Example Here is the code I have and How I use the webbrowser control in the most basic way. Create a new forms project and name it SimpleWeb Add a new class and name it myWeb.cs, here is the code to use. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows.Forms; using System.Security.Policy; namespace SimpleWeb { //inhert all of webbrowser class myWeb : WebBrowser { public myWeb() { //no javascript errors this.ScriptErrorsSuppressed = true; //Something we want set? AssignEvents(); } //keep near the top private void AssignEvents() { //assign WebBrowser events to our custom methods Navigated += myWeb_Navigated; DocumentCompleted += myWeb_DocumentCompleted; Navigating += myWeb_Navigating; NewWindow += myWeb_NewWindow; } #region Events //List of events:http://msdn.microsoft.com/en-us/library/system.windows.forms.webbrowser_events%28v=vs.100%29.aspx //Fired when a new windows opens private void myWeb_NewWindow(object sender, System.ComponentModel.CancelEventArgs e) { //cancel all popup windows e.Cancel = true; //beep to let you know canceled new window Console.Beep(9000, 200); } //Fired before page is navigated (not sure if its before or during?) private void myWeb_Navigating(object sender, System.Windows.Forms.WebBrowserNavigatingEventArgs args) { } //Fired after page is navigated (but not loaded) private void myWeb_Navigated(object sender, System.Windows.Forms.WebBrowserNavigatedEventArgs args) { } //Fired after page is loaded (Catch 22 - Iframes could be considered a page, can fire more than once. Ads are good examples) private void myWeb_DocumentCompleted(System.Object sender, System.Windows.Forms.WebBrowserDocumentCompletedEventArgs args) { } #endregion //Answer supplied by mo. (modified)? public void OpenUrl(string url) { try { //this.OpenUrl(url); this.Navigate(url); } catch (Exception ex) { MessageBox.Show("Your App Crashed! Because = " + ex.ToString()); //MyApplication.HandleException(ex); } } //Keep near the bottom private void RemoveEvents() { //Remove Events Navigated -= myWeb_Navigated; DocumentCompleted -= myWeb_DocumentCompleted; Navigating -= myWeb_Navigating; NewWindow -= myWeb_NewWindow; } } } On Form1 drag a standard tabControl and set the dock to fill, you can go into the tab collection and delete the pre-populated tabs if you like. Right Click on Form1 and Select "View Code" and replace it with this code. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using mshtml; namespace SimpleWeb { public partial class Form1 : Form { public Form1() { InitializeComponent(); //Load Up 10 Tabs for (int i = 0; i <= 10; i++) { newTab("Test_" + i, "http://wwww.yahoo.com"); } } private void newTab(string Title, String Url) { //Create a new Tab TabPage newTab = new TabPage(); newTab.Name = Title; newTab.Text = Title; //create webbrowser Instance myWeb newWeb = new myWeb(); //Add webbrowser to new tab newTab.Controls.Add(newWeb); newWeb.Dock = DockStyle.Fill; //Add New Tab to Tab Pages tabControl1.TabPages.Add(newTab); newWeb.OpenUrl(Url); } } } Save and Run the project. Using the answer below by mo. , you can surf the first url with no problem, but what about all the urls the user clicks on? How do we check those? I prefer not to add events to every single html element on a page, there has to be a way to run the new urls thru the function OpenUrl before it navigates without having an endless loop. Thanks.

    Read the article

  • how to link static cells to Outlet/Actions - E.G tap the call cell to call the number

    - by holtii
    The code I have. By the way, I can't get Call to work and Website does not open either! - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { NSString *urlToOpen = @""; if( indexPath.section == 0 ){ // call number urlToOpen = @"tel:442074036933"; } else if( indexPath.section == 1 ){ // open website urlToOpen = @"http://www.designmuseum.org"; } else { // open address urlToOpen = @"http://maps.apple.com/maps?daddr=Design+Museum+London"; } [[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlToOpen]]; NSString *destinationAddress = [NSString stringWithFormat:@"%@+%@+%@", [address street], [address city], [address country]]; NSString *sourceAddress = [LocalizedCurrentLocation currentLocationStringForCurrentLanguage]; NSString *url = [NSString stringWithFormat:@"http://maps.apple.com/maps?saddr=%@&daddr=%@", [sourceAddress stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding], [destinationAddress stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]; [[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]]; I need to add destination address which for my App is = 28 Shad Thames, London, United Kingdom. Which format to write it in? because I cant get it to work and really need to sort this problem of my app real quick

    Read the article

  • First time using Java Web Start in Ubuntu - Fatal Launch Exception

    - by MountainX
    I've been using Ubuntu for a while and Java Web Start applications have never "just worked" in the current or any prior version, so I ignored them until now. However, now I have a need to get them working in Firefox. When I am on a page like this: http://www.oracle.com/technetwork/java/demos-nojavascript-137100.html I want to be able to click on the demos as suggested and have them run. I'm running Ubuntu 11.10 with Gnome 3 and/or Linux Mint 12 (64 bit) with OpenJDK 6, OpenJDK 7 and Sun Java 6. My default is currently: /usr/lib/jvm/java-6-openjdk/jre/bin/java $ whereis javaws javaws: /usr/bin/javaws /etc/alternatives/javaws - /usr/lib/jvm/java-6-openjdk/jre/bin/javaws Here's the error I get when I try to run a Java Web Start application: net.sourceforge.jnlp.LaunchException: Fatal: Initialization Error: Could not initialize application. at net.sourceforge.jnlp.Launcher.createApplication(Launcher.java:776) at net.sourceforge.jnlp.Launcher.launchApplication(Launcher.java:552) at net.sourceforge.jnlp.Launcher$TgThread.run(Launcher.java:887) Caused by: net.sourceforge.jnlp.LaunchException: Fatal: Initialization Error: A fatal error occurred while trying to verify jars. at net.sourceforge.jnlp.runtime.JNLPClassLoader.initializeResources(JNLPClassLoader.java:448) at net.sourceforge.jnlp.runtime.JNLPClassLoader.<init>(JNLPClassLoader.java:176) at net.sourceforge.jnlp.runtime.JNLPClassLoader.getInstance(JNLPClassLoader.java:295) at net.sourceforge.jnlp.Launcher.createApplication(Launcher.java:767) ... 2 more Caused by: net.sourceforge.jnlp.LaunchException: Fatal: Initialization Error: A fatal error occurred while trying to verify jars. at net.sourceforge.jnlp.runtime.JNLPClassLoader.initializeResources(JNLPClassLoader.java:448) at net.sourceforge.jnlp.runtime.JNLPClassLoader.<init>(JNLPClassLoader.java:176) at net.sourceforge.jnlp.runtime.JNLPClassLoader.getInstance(JNLPClassLoader.java:295) at net.sourceforge.jnlp.Launcher.createApplication(Launcher.java:767) at net.sourceforge.jnlp.Launcher.launchApplication(Launcher.java:552) at net.sourceforge.jnlp.Launcher$TgThread.run(Launcher.java:887) Here's another example: http://docs.oracle.com/javase/tutorial/uiswing/events/keylistener.html net.sourceforge.jnlp.LaunchException: Fatal: Read Error: Could not read or parse the JNLP file. at net.sourceforge.jnlp.Launcher.fromUrl(Launcher.java:491) at net.sourceforge.jnlp.Launcher.launch(Launcher.java:283) at net.sourceforge.jnlp.runtime.Boot.run(Boot.java:199) at net.sourceforge.jnlp.runtime.Boot.run(Boot.java:51) at java.security.AccessController.doPrivileged(Native Method) at net.sourceforge.jnlp.runtime.Boot.main(Boot.java:165) Caused by: java.io.IOException: port out of range:-2147483648 at net.sourceforge.jnlp.JNLPFile.openURL(JNLPFile.java:255) at net.sourceforge.jnlp.JNLPFile.<init>(JNLPFile.java:185) at net.sourceforge.jnlp.JNLPFile.<init>(JNLPFile.java:162) at net.sourceforge.jnlp.JNLPFile.<init>(JNLPFile.java:148) at net.sourceforge.jnlp.Launcher.fromUrl(Launcher.java:477) ... 5 more Caused by: java.io.IOException: port out of range:-2147483648 at net.sourceforge.jnlp.JNLPFile.openURL(JNLPFile.java:255) at net.sourceforge.jnlp.JNLPFile.<init>(JNLPFile.java:185) at net.sourceforge.jnlp.JNLPFile.<init>(JNLPFile.java:162) at net.sourceforge.jnlp.JNLPFile.<init>(JNLPFile.java:148) at net.sourceforge.jnlp.Launcher.fromUrl(Launcher.java:477) at net.sourceforge.jnlp.Launcher.launch(Launcher.java:283) at net.sourceforge.jnlp.runtime.Boot.run(Boot.java:199) at net.sourceforge.jnlp.runtime.Boot.run(Boot.java:51) at java.security.AccessController.doPrivileged(Native Method) at net.sourceforge.jnlp.runtime.Boot.main(Boot.java:165)

    Read the article

  • Open Maps app from Code : Where to find the "Current Location"?

    - by Simon
    I am opening Maps app to show directions from user's Current Location to a destination coordinate, from my code. I am using the following code to open the Maps app. I am calling this code when a button is pressed. - (void)showDirectionsToHere { CLLocationCoordinate2D currentLocation = [self getCurrentLocation]; // LINE 1 NSString* url = [NSString stringWithFormat: @"http://maps.google.com/maps?saddr=%f,%f&daddr=%f,%f", destCoordinate.latitude + 0.1, destCoordinate.longitude, destCoordinate.latitude, destCoordinate.longitude];//8.3, 12.1 [[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]]; } Here [self getCurrentLocation] in LINE 1 uses CLLocationManager to determine the Current Location and returns the value. Note: I have not yet implemented the LINE1. I've just planned to do in that way. My question is, Is this a good practice to calculate the Current Location, at the time the Maps app is called? [self getCurrentLocation] will retrun the Current Location before openURL gets called? I have to determine the Current Location well before opening the Maps app? I am little bit confused about these things. Kindly guide me. Thanks.

    Read the article

  • Objective-C - open SMS

    - by teepusink
    Hi, How do I open SMS from my app and have the new message popped up and prepopulated? Right now this is what I have NSString *stringURL = @"sms:"; NSURL *url = [NSURL URLWithString:stringURL]; [[UIApplication sharedApplication] openURL:url]; That opens the SMS app but you have to click on new message etc. Thanks, Tee

    Read the article

  • TTNavigator three20 openURLAction

    - by disp
    I'm new to three20 and trying to find my way through the TTNavigator class. I try to push to a new view via the URL system. So I used openURL: animated: method which works just fine, but it's deprecated, and I know that I should use openURLAction instead, but this has no animated: parameter. Am I missing something?

    Read the article

  • How do I send SMS without launching Text application?

    - by Thomas
    Hello all: I am developing a simple application which has to send an SMS message from the app itself instead of launching the native Text app. Here's my action now. What should I change to achieve my desired functionality? -(IBAction)startButtonPressed { NSString *phoneNumber = @"13136296693"; NSString *url = [NSString stringWithFormat: @"sms:%@",phoneNumber]; NSLog(@"Send SMS to: %@ ", url); [[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]]; } Thanks! Thomas

    Read the article

  • How can I launch app store from my application

    - by Tankista
    Im trying to implement button which opens app store application from my app. I use this simple line of code, which opens safari but not app store application. [[UIApplication sharedApplication] openURL:[NSURL URLWithString: @"http://itunes.apple.com/sk/app/tweetie-2/id333903271?mt=8"]]; I dont know whats wrong, is the URL format correct? I was following this document. All related questions in stackoverflow are outofdate I suppose.

    Read the article

  • Launch Safari from iPhone App

    - by tarnfeld
    I know that i can use the following code to launch my own url, but i want the user to continue their workflow after using my bookmarklet so therefore don't want to open a new tab and have them re-load the url i put into the url variable? NSURL url* = [NSURL URLWithString:@"http://google.com"]; [[UIApplication sharedApplication] openUrl:""]; Can this be done?

    Read the article

  • UIAlert View Objective C - Opening app store link

    - by benhowdle89
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil message:@"An Alert!" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=301349397&amp;amp;amp;amp;mt=8"]];]; [alert show]; [alert release]; I'm trying to display a UIAlertView with one "Ok" button and one "Buy Full Version" button. How can i make the above code work? Thanks

    Read the article

  • Problem with a call button - doesn't open tel:// URL

    - by Christophe Konig
    I am trying to make a call button that will call 18 which is Fire Dept in France. So my code is : [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel://18"]]; It doesn't work and I get this message in the console : < warning Ignoring unsafe request to open URL tel://18 But I saw other application that have the same button fully working ! I am trying this on the device of course. What am I missing ?

    Read the article

  • How Can I open another App from my app?

    - by Amarpreet
    Hi I have rediATM app installed on my iphone. rediATM app is free on itunes. I want to open that app from my iphone app. I am not able to find out the way to open it. i am using the following code to open it but it takes me to the website. [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://itunes.apple.com/au/app/rediatm-finder/id358936470?mt=8"]]; Please help.

    Read the article

  • Problem with a call button - doesn't open tel:// URL

    - by Christophe Konig
    Hi, I am trying to make a call button that will call 18 which is Fire Dept in France. So my code is : [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel://18"]]; It doesn't work and I get this message in the console : < warning Ignoring unsafe request to open URL tel://18 But I saw other application that have the same button fully working ! I am trying this on the device of course. What am I missing ?

    Read the article

  • How to Add "Write a Review" / "Rate Us" Feature to My App?

    - by Ohad Regev
    I wish to add some sort of a "Write a Review" or "Rate Us" feature to my app so my customers can easily rate and review my app. Best practice I can think of is to have some sort of pop-up or open a UIWebView within my app so the user is not kicked off of my app while opening the App Store application as done in: [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"itms://itunes.com/apps/myAppName"]]; Does anyone knows of a way to do that?

    Read the article

  • Sending an image in a faceless email

    - by anurag
    I am trying to send a faceless email (sending an email without showing the interface), using the code below. I also want to attach an image to this email. Is this possible? - (void) sendEmailTo:(NSString *)toStr withSubject:(NSString *)subjectStr withBody:(NSString *)bodyStr { NSString *emailString=[[NSString alloc] initWithFormat:@"mailto:?to=%@&subject=%@&body=%@", [toStr stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding], [subjectStr stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding], [bodyStr stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding]]; [[UIApplication sharedApplication] openURL:[NSURL URLWithString:emailString]]; [emailString release]; }

    Read the article

  • How to open safari, mail and doing call by html href link in UIWebView

    - by mobapps
    Hi, I need to do three task in UIWebView, Open safari, Open mail Place the call. I know that i can do it by using UIApplication's openURL, but i need to do by using UIWebView only, because my data is coming from server, and i need to do this task in that data, if data has www.link, email addres or call number. Does anyone knows that what is the actual idea. Thanks.

    Read the article

  • sending image in a faceless email

    - by anurag
    I am trying to send a faceless(without showing the interface)email by using the code below: I also want to attach an image to this email can anybody suggest is it possible??? (void) sendEmailTo:(NSString *)toStr withSubject:(NSString *)subjectStr withBody:(NSString *)bodyStr { NSString *emailString=[[NSString alloc] initWithFormat:@"mailto:?to=%@&subject=%@&body=%@", [toStr stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding], [subjectStr stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding], [bodyStr stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding]]; [[UIApplication sharedApplication] openURL:[NSURL URLWithString:emailString]]; [emailString release]; }

    Read the article

  • How to get the Displayed Webpage source

    - by Shadow
    Hi, how can i get the web-page source displayed on a web-browser control, either in c# or Win32.even ATL COM also fine. i mean.. i dont want to create new "HTTPReqest" or "openURL" to get source.. i want to get the source from the control only..is it possible for windows mobile.. if so how?.. please let me know. Thank u

    Read the article

  • Is there any way to force an iPhone application to relaunch?

    - by Jared P
    Basically -[UIApplication openURL:] would be perfect, if it wasn't for the fact that it doesn't work within the same application (at least on simulator -- if this works on device someone please tell me). It's not a super big deal though if it just relaunches w/o URLness since I can obviously just persist some data. The goal of this is to essentially free all memory in the application and call all of the loading procedures.

    Read the article

  • Singleton method not getting called in Cocos2d

    - by jini
    I am calling a Singleton method that does not get called when I try doing this. I get no errors or anything, just that I am unable to see the CCLOG message. Under what reasons would a compiler not give you error and not allow you to call a method? [[GameManager sharedGameManager] openSiteWithLinkType:kLinkTypeDeveloperSite]; The method is defined as follows: -(void)openSiteWithLinkType:(LinkTypes)linkTypeToOpen { CCLOG(@"WE ARE IN openSiteWithLinkType"); //I NEVER SEE THIS MESSAGE NSURL *urlToOpen = nil; if (linkTypeToOpen == kLinkTypeDeveloperSite) { urlToOpen = [NSURL URLWithString:@"http://somesite.com"]; } if (![[UIApplication sharedApplication]openURL:urlToOpen]) { CCLOG(@"%@%@",@"Failed to open url:",[urlToOpen description]); [self runSceneWithID:kMainMenuScene]; } } HERE IS THE CODE TO MY SINGLETON: #import "GameManager.h" #import "MainMenuScene.h" @implementation GameManager static GameManager* _sharedGameManager = nil; @synthesize isMusicON; @synthesize isSoundEffectsON; @synthesize hasPlayerDied; +(GameManager*) sharedGameManager { @synchronized([GameManager class]) { if (!_sharedGameManager) { [[self alloc] init]; return _sharedGameManager; } return nil; } } +(id)alloc { @synchronized ([GameManager class]) { NSAssert(_sharedGameManager == nil,@"Attempted to allocate a second instance of the Game Manager singleton"); _sharedGameManager = [super alloc]; return _sharedGameManager; } return nil; } -(id)init { self = [super init]; if (self != nil) { //Game Manager initialized CCLOG(@"Game Manager Singleton, init"); isMusicON = YES; isSoundEffectsON = YES; hasPlayerDied = NO; currentScene = kNoSceneUninitialized; } return self; } -(void) runSceneWithID:(SceneTypes)sceneID { SceneTypes oldScene = currentScene; currentScene = sceneID; id sceneToRun = nil; switch (sceneID) { case kMainMenuScene: sceneToRun = [MainMenuScene node]; break; default: CCLOG(@"Unknown Scene ID, cannot switch scenes"); return; break; } if (sceneToRun == nil) { //Revert back, since no new scene was found currentScene = oldScene; return; } //Menu Scenes have a value of < 100 if (sceneID < 100) { if (UI_USER_INTERFACE_IDIOM() != UIUserInterfaceIdiomPad) { CGSize screenSize = [CCDirector sharedDirector].winSizeInPixels; if (screenSize.width == 960.0f) { //iPhone 4 retina [sceneToRun setScaleX:0.9375f]; [sceneToRun setScaleY:0.8333f]; CCLOG(@"GM: Scaling for iPhone 4 (retina)"); } else { [sceneToRun setScaleX:0.4688f]; [sceneToRun setScaleY:0.4166f]; CCLOG(@"GM: Scaling for iPhone 3G or older (non-retina)"); } } } if ([[CCDirector sharedDirector] runningScene] == nil) { [[CCDirector sharedDirector] runWithScene:sceneToRun]; } else { [[CCDirector sharedDirector] replaceScene:sceneToRun]; } } -(void)openSiteWithLinkType:(LinkTypes)linkTypeToOpen { CCLOG(@"WE ARE IN openSiteWithLinkType"); NSURL *urlToOpen = nil; if (linkTypeToOpen == kLinkTypeDeveloperSite) { urlToOpen = [NSURL URLWithString:@"http://somesite.com"]; } if (![[UIApplication sharedApplication]openURL:urlToOpen]) { CCLOG(@"%@%@",@"Failed to open url:",[urlToOpen description]); [self runSceneWithID:kMainMenuScene]; } } -(void) test { CCLOG(@"this is test"); } @end

    Read the article

  • current location from CoreLocation

    - by Christian
    I have an App which launches the google Map App. The code is: UIApplication *app = [UIApplication sharedApplication]; [app openURL:[[NSURL alloc] initWithString: @"http://maps.google.com/maps?daddr=Obere+Laube,+Konstanz,+Germany&saddr="]]; The saddr= should be the current location. I get the current location with -(void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation { NSLog(@"%f,%f", [newLocation coordinate]); The Log displays the correct coordinates like 2010-04-05 15:33:25.436 deBordeaux[60657:207] 37.331689,-122.030731 I didn't find the right way to transmit the coordinates to the url-string. Does someone can give me a hint how-to?

    Read the article

< Previous Page | 1 2 3  | Next Page >