Search Results

Search found 2 results on 1 pages for 'docno'.

Page 1/1 | 1 

  • How to tell an iphone app user what will happen before opening Facebook login dialogue

    - by docno
    Apps that allow users to log in over a 3rd party authentication provider (e.g. Facebook, Google, Twoitter,...) should open a browser window to let the user authenticate against the provider. That means, at some point, an app is backgrounded and the user interacts with a browser window. Just before the browser opens, it's a recommended pratctice to inform the user about what will happen (see e.g. Getting Started with OAuth 2.0 - O'Reilly), let's say an alert window with something like "you will leave now the XYZ app and a browser window will open where you can enter your credentials safely". My question: How can that be done if I use the facebook SDK for ios? Looking at the SDK, there seem to be no notifications and no designated states that would allow me to detect that the sdk is about to background my app and about to opening either Safari or the Facebook app.

    Read the article

  • Java File I/O problems

    - by dwwilson66
    This is my first time working with file i/o in java, and it's not working. The section of the program where I parse individual lines and output a semicolon delimited line works like a charm when I hardcode a file and display on screen. Whne I try to write to a file public static OutputStream... errors out as an illegal start to expression, and I've been unable to get the program to step through an entire directory of files instead of one at a time. Where I'm not clear: I'm note setting an output filename anywhere...whare am I supposed to do that? The path variable won't pass. What's the proper format for a path? Can anyone see what I need to debug here? import java.io.*; public class FileRead { public static void main(String args[]) { try { // Open the file(s) // single file works OK FileInputStream fstream = new FileInputStream("testfile.txt"); Path startingDir = R:\Data\cs\RoboHelp\CorrLib\Output\Production\WebHelp; PrintFiles pf = new PrintFiles(); Files.walkFileTree(startingDir, pf); // Get the object of DataInputStream DataInputStream in = new DataInputStream(fstream); BufferedReader br = new BufferedReader(new InputStreamReader(in)); String inputLine; String desc = ""; String docNo = ""; String replLtr = ""; String specCond = ""; String states = ""; String howGen = ""; String whenGen = ""; String owner = ""; String lastChange = ""; //Read File Line By Line while ((inputLine = br.readLine()) != null) { int testVal=0; int stringMax = inputLine.length(); // if(inputLine.startsWith("Description")) {desc = inputLine.substring(13,inputLine.length());} else if(inputLine.startsWith("Reference Number")) {docNo = inputLine.substring(20,inputLine.length());} else if(inputLine.startsWith("Replaces Letter")) {replLtr = inputLine.substring(17,inputLine.length());} else if(inputLine.startsWith("Special Conditions")) {specCond = inputLine.substring(21,inputLine.length());} else if(inputLine.startsWith("States Applicable")) {states = inputLine.substring(19,inputLine.length());} else if(inputLine.startsWith("How Generated")) {howGen = inputLine.substring(15,inputLine.length());} else if(inputLine.startsWith("When Generated")) {whenGen = inputLine.substring(16,inputLine.length());} else if(inputLine.startsWith("Owner")) {owner = inputLine.substring(7,inputLine.length());} else if(inputLine.startsWith("Last Change Date")) {lastChange = inputLine.substring(17,inputLine.length());} } //close while loop // Print the content on the console String outStr1 = (desc + ";" + docNo + ";" + replLtr + ";" + specCond + ";" + states); String outStr2 = (";" + howGen + ";" + whenGen + ";" + owner + ";" + lastChange); String outString = (outStr1 + outStr2); System.out.print(inputLine + "\n" + outString); String lineItem = (outStr1+outStr2); // try (OutputStream out = new BufferedOutputStream (logfile.newOutputStream(CREATE, APPEND))) { out.write(lineItem, 0, lineItem.length); } catch (IOException x) { System.err.println(x); } public static OutputStream newOutputStream() throws IOException { // append to an existing file, create file if it doesn't initially exist out = Files.newOutputStream(c:, CREATE, APPEND); } //Close the input stream in.close(); } catch (Exception e) { //Catch exception if any System.err.println("Error: " + e.getMessage()); } } }

    Read the article

1