How to use the google search from inside a java program
Hi guys
How can i use google search in my java program?
What will be the type of the reply i get back from google?
Thanks in advance
[http://javamilestone.blogspot.com/|http://javamilestone.blogspot.com/]
Hi,
You have here some examples about how to make search on google from a Java application.
The type of reply is JSON
Here some documentation about it:
[http://code.google.com/apis/ajaxsearch/documentation/#fonje|http://code.google.com/apis/ajaxsearch/documentation/#fonje]
And here some snippets:
[http://code.google.com/apis/ajaxsearch/documentation/#fonje_snippets|http://code.google.com/apis/ajaxsearch/documentation/#fonje_snippets]
Regards,
David.
Similar Messages
-
How to change the browser used for Google search from context menu of selected text?
How to change the browser used for Google search from context menu of selected text?
It uses Safari. But I want to use Chrome (it's my default browser).How to change the browser used for Google search from context menu of selected text?
It uses Safari. But I want to use Chrome (it's my default browser). -
I want to remove the yahoo search bar from Firefox and use the google search bar.
I did go to about:config and made the keyword.URL to default (Google). It is not getting affected. Please help me to know how can I set it in Firefox.
I need to remove yahoo search from my Firefox and use the Google search. I did the following steps for the same.
about:config, searched keyword:URL and reset to default.
But the change is not getting affected. Pls helpWork around that I have used (my machine is running Windows XP SP3 might work on other systems as well):
1) Ensure Firefox is closed, if necessary read this in another browser
2. Open the Firefox directory on the hard drive (typically: C:\Program Files\Mozilla Firefox)
3. Go into the 'searchplugins' folder
4. Delete the file named 'yahoo.xml'
5. Immediately restart your machine -
How to use the Google Android Emulator in Flash Builder on Windows 7?
I want to try out Flash Builder to create an app, but I cannot find out how to use the Google Android Emulator in Flash Builder. The simulators in Flash Builder work, and the android emulator is installed correctly and can run. I just can't seem to connect them. How do I do that?
Hi Pahup,
Thank you for your reply!!
I adapted an Android App using Flash CC on a Mac. I already published this App for the Apple App Store. When I published the App for Android I chose Air 3.7.xxx for Android. I also created the p12 certificate using Flash CC in the publishing settigns for Android. So my App is theoretically finished and ready for Upload.
When I went to the Google Play Store Developer Console I had the options to
1.) Upload APK
or
2.) Prepare Store Entry
...so I prepared the Store entry first. When I go to "APK"-Tab in the console it looks like this:
... it says "Upload APK" and the Button below "Get Licence Key". When I click on the license Key Button it looks like this:
So I think I should enter this RSA-Key somehow into my App BEFORE uploading it to the Google Play Store. This is recommended when an Ap is set to be paid. My Application is set to paid.
I did not use any kind of licensing API (until now - cause I don´t know how and what it is for)
This is all new to me. It is the first App I want to bringt to the Android market. I really hoped it would be as easy as getting an app into the Apple App Store. I found so many step by step instructions for dummies on "How to get an Flash iOS App into the App Store plus creating all the certificates needed", so I thought it would be the same for Android. But there is no help at all at the moment. I am totally confused.
So any help, hint or instrusction would be great!!
By the way - this is the App I want to get into the Google Play Store -
Sometimes when using the Google search engine, after using the Back button in the Firefox 4.0.1 browser, I am no longer able to click in the Google search box.
This problems has been occurring on two different machines over the last two days.I think this may not be a browser problem but rather a Google problem.
I am getting the same problem with the Google Chrome browser. -
How to clear the Google search history
Does any one know how to clear the google search history, as you can clear your cache, history and cookies but not the google search history.
This has been asked and answered before. A forum search will turn up a few threads like this one:
http://discussions.apple.com/thread.jspa?messageID=8205045� -
i cant use the "google search" button with firefox 3.6.6 or even 3.5. I have no problem with searching google on internet explorer. The" Im feeling lucky" button works. The google search tab on the top right corner of firefox browser works fine. But the main google search button on the google site doesnt work. I havent changed anything. i cant do anymore google searches.
== URL of affected sites ==
http://www. google.comWhen click on search, the Google search result didn't update (the google search page didn't change). BUT the url bar on top did have the Google URL updated with the new search term.
Something like
http://www.google.com/#hl=en&q=firefox+3.6+problem+with+google+search+button&aq=f&aqi=&aql=&oq=&gs_rfai=&fp=dd2d1939af06a5a
So the URL is changed when I click the Google SEARCH button on the page. Just the page not changed nor updated.
And when I click "Reload current Page", then the page is reloaded with the new google search result. -
I use the google search bar for everything and since downloading FF4 i can not select any of the suggestions in the google drop down menu.
I have tried to select one of the suggestions that google give me for my search but FF it wont let me. I have type everything out in full. I hate FF4 it is rubbish. I loved firefox before this one came out but now I am seriously thinking of going over to google chrome.Many thanks for the prompt reply, ideato.
One of the reasons I abandoned Chrome in favour of Firefox was due to the "black band of doom" that appears on the top of the Google page - so setting up my homepage to google.co.uk just puts that back in the ugly spotlight.
I was, though, pleasantly surprised to see a Google search bar on the Mozilla Firefox Start Page (without the black band and Google options that I am just not interested in) but bitterly disappointed that it is Google.fr (due to my ISP being French).
I shall learn to live with Yahoo (or worse case scenario, Bing!)
rgds, PG -
How to use the pps function from JCOP?
Hi
I'm trying to use the pps function from JCTerminal (JCOP API: [url http://www.cs.ru.nl/~woj/jcopapi/com/ibm/jc/JCTerminal.html#pps(int, int)]pps function ) to connect my client to a virtual card with a specific protocol (T=0).
But I always got the error: "Protocol and parameter selection not supported by this terminal!"
I've tried to make an ATR that support both protocol : [url http://smartcard-atr.appspot.com/parse?ATR=3b909580811fc7dc]3B 90 95 80 81 1F C7 DC.
I really don't know what value to put in the second parameter (baud rate), I've tried with 150000, which is in the range of the ATR but I'm not sure this is correct. And I could't find any example of it.
I'm also not sure where to put the pps command, the specification say directly after a reset, so I tried this implementation:
System.out.print("Start");
readers = TerminalFactory.getDefault().terminals().list(State.CARD_PRESENT);
//If no readers has a card it ends the process
if(readers.isEmpty()){
System.out.println("\nNo card in the reader...");
return;
System.out.println("\nReader Type: "+readers.get(0).toString());
term = (PCSCJCTerminal)JCTerminal.getInstance("PCSC", readers.get(0).toString().substring(15));
term.open();
System.out.println("\nTerminal opened");
//Getting the ATR
atr = new ATR(term.waitForCard(2000));
try {
term.pps(JCTerminal.PROTOCOL_T0, (int)150000);
} catch (Exception e) {
e.printStackTrace();
System.out.println("ATR: "+toHex(atr.getBytes()));
//sending a data 11223344
System.out.println("\nsending data: 11223344");
byte[] responsesend = term.send(0,cmdsend,0,cmdsend.length);
System.out.println("Response data is:" + toHex(responsesend));
//close terminal
term.close();
System.out.println("\nTerminal closed");I've got this output on the console:
<font size="2">StartReader Type: PC/SC terminal Virtual CAD Reader 0
Terminal opened
ATR: 3b 90 95 90 00 81 1f c7 cc
sending data: 11223344
<font color="red">Protocol and parameter selection not supported by this terminal!</font>
at com.ibm.jc.JCTerminal.pps(Unknown Source)
at com.test.essai.main(essai.java:46)
</font>>
And If I take a look at the data exchanged with the card:
<font size="2">Running in Virtual Card mode...
ATR: 3B909580811FC7DC
Waiting for event (power: off, protocol: unknown/undefined)...
Waiting for event (power: off, protocol: unknown/undefined)...
Raw event data: 01
Event: VCAD_EC_POWER_ON (0x01)
Reply: VCAD_SC_OK (0x00) (in reply to VCAD_EC_POWER_ON) ATR: 3b909580811fc7dc
Raw reply data: 003b909580811fc7dc
Sending reply...
Waiting for event (power: on, protocol: unknown/undefined)...
Waiting for event (power: on, protocol: unknown/undefined)...
Raw event data: 06ff11957b
Event: VCAD_EC_EXCHANGE_TPDU (0x06) C-TPDU: ff11957b
Accepting any PPS request parameters: Protocol: t=1; FI=9, DI=5
Reply: VCAD_SC_OK (0x00) (in reply to VCAD_EC_EXCHANGE_TPDU) R-TPDU: ff11957b
Raw reply data: 00ff11957b
Sending reply...
</font>>
This (above) is the PPS command but not from the PPS function, it is always sent with protocol T=1
<font size="2">Waiting for event (power: on, protocol: t=1)...
Raw event data: 0501
Event: VCAD_EC_SET_PROTOCOL (0x05) Protocol: t=1
Reply: VCAD_SC_OK (0x00) (in reply to VCAD_EC_SET_PROTOCOL)
Raw reply data: 00
Sending reply...
Waiting for event (power: on, protocol: t=1)...
Raw event data: 0600c10120e0
Event: VCAD_EC_EXCHANGE_TPDU (0x06) C-TPDU: 00c10120e0
Handling protocol-specific command...
Protocol block:
NAD: 0x00
PCB: 0xc1 (T1_S_BLOCK); S-Block type: T1_SBT_IFS_REQ
LEN: 1
INF:
IFS: 20
EDC: 0xe0
Changing IFS(other) from 32 to 32
Reply: VCAD_SC_OK (0x00) (in reply to VCAD_EC_EXCHANGE_TPDU) R-TPDU: 00e10120c0
Raw reply data: 0000e10120c0
Sending reply...
Waiting for event (power: on, protocol: t=1)...
Raw event data: 0600001300a404000d54657374436c69656e7441707000f0
Event: VCAD_EC_EXCHANGE_TPDU (0x06) C-TPDU: 00001300a404000d54657374436c69656e74
41707000f0
Processing app. command...
App. block:
NAD: 0x00
PCB: 0x00 (T1_I_BLOCK); Seq. #: 0; More data: 0
LEN: 13
INF:
00a404000d54657374436c69656e7441707000
EDC: 0xf0
cmd name: N/A (class #4)
cmd: 00a40400 0d 54657374436c69656e74417070 70
Responding with the reversed command data, SW is hardcoded to 90<INS>
rsp: 707041746e65696c4374736554 90a4
Reply: VCAD_SC_OK (0x00) (in reply to VCAD_EC_EXCHANGE_TPDU) R-TPDU: 00000f70704
1746e65696c437473655490a475
Raw reply data: 0000000f707041746e65696c437473655490a475
Sending reply...
Waiting for event (power: on, protocol: t=1)...
Raw event data: 060040041122334400
Event: VCAD_EC_EXCHANGE_TPDU (0x06) C-TPDU: 0040041122334400
Processing app. command...
App. block:
NAD: 0x00
PCB: 0x40 (T1_I_BLOCK); Seq. #: 1; More data: 0
LEN: 4
INF:
11223344
EDC: 0x00
cmd name: N/A (class #1)
cmd: 11223344
Responding with the reversed command data, SW is hardcoded to 90<INS>
rsp: 9022
Reply: VCAD_SC_OK (0x00) (in reply to VCAD_EC_EXCHANGE_TPDU) R-TPDU: 0040029022f
0
Raw reply data: 000040029022f0
Sending reply...
Waiting for event (power: on, protocol: t=1)...
Raw event data: 03
Event: VCAD_EC_POWER_OFF (0x03)
Reply: VCAD_SC_OK (0x00) (in reply to VCAD_EC_POWER_OFF)
Raw reply data: 00
Sending reply...
Waiting for event (power: off, protocol: unknown/undefined)...
</font>>
If someone know how to use this function or have any advice to help me to select a specific protocol with Jcop API, please let me know.
If you you need any more information don't hesitate to ask.
Best regards
Edited by: Cyril on Sep 22, 2011 9:54 AM-1
I'm using a virtual terminal (windows driver), and I don't see how I could turn off the Auto-pps. I've also tried with a real reader and a card and I have the same error.
-2
I've tried value in the range of the atr (based on this analysis: [url http://smartcard-atr.appspot.com/parse?ATR=3b909580811fc7dc]http://smartcard-atr.appspot.com/parse?ATR=3b909580811fc7dc ). But I don't know if only I value of baud-rate is possible in the range. Anyway I just would like to change the protocol, not the baud-rate.
-3
I've already tried to call pps function before, after the first reset, or with another reset later and I always got the same thing.
term = (PCSCJCTerminal)JCTerminal.getInstance("PCSC", readers.get(0).toString().substring(15));
term.open();
System.out.println("\nTerminal opened");
//Getting the ATR
atr = new ATR(term.waitForCard(2000));
System.out.println("ATR: "+toHex(atr.getBytes()));
jcard = new JCard(term,atr,0);
jcard.reset();
try {
term.pps(JCTerminal.PROTOCOL_T0, (int)312500);
} catch (Exception e) {
e.printStackTrace();
}The same pps is always send after each reset... -
How to use the created search helps in the program?
Hi Everyone,
I know how to create Search help elementary / collective search help through SE 11. I have a question, how can I make use of the created search help in the program.
How to use the Search help in the programs, which is created through SE11
Subbu.Hi,
In case if you want to use in parameters statement, then we can use the suffix MATCHCODE OBJECT syntax.
Eg.
report abc.
parameters : a(10) type c matchcode object ZBELNR.
Hope this helps.
regards,
amit m. -
Seems like Yahoo is the new Firefox default browser.
Then why not get rid of the Google search box if it's not going to work?
-
How to use the Worklist API from Java (classpath ??)
Hi all,
Sorry for a novice question but I couldn't find the way to go about this (probably because it's such common knowldge...)
I would like to try and use the Worklist API from my Java code in Eclipse, and according to the BPEL dev-guide I need to add an Import command for oracle.tip.pc.api.worklist. Where do I find these classes ?????
I guess I need to change my CLASSPATH but I couldn't find a single word about this in the BPEL dev-guide (chapter 17), BPEL installation guide or elseware.
thanks.Hi all,
Ok now.
To summarize - I was trying the code from BPEL developer guide, chapter 17, page 40 for using the Worklist local API's.
Only after adding the following JAR's to the build path, was I able to compile it:
orabpel-common.jar
orabpel.jar
bpm-infra.jar
bpm-services.jar
So, these 4 JAR's are required for using the Worklist local API's (not a clue in the dev guide itself for this requirement though...)
Thank you very much for your help,
assaf. -
How to put the text "BottomCENTER" from inside JLabel1 out of Jlabel1??
Dear friends:
I have following code,
It can run.
I hope to move the text "BottomCENTER" from inside JLabel1 out of Jlabel1,
I mean Text "BottomCENTER" should be display outside of JLabel1
import java.awt.Color;
import java.awt.GridLayout;
import javax.swing.BorderFactory;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
public class AlignmentExample {
public static void main(String[] args) {
// Create the labels and set alignment
JLabel label1 = new JLabel("BottomCENTER", SwingConstants.CENTER);
JLabel label2 = new JLabel("CenterLeft", SwingConstants.LEFT);
JLabel label3 = new JLabel("TopCenter", SwingConstants.CENTER);
label1.setVerticalAlignment(SwingConstants.BOTTOM);
label2.setVerticalAlignment(SwingConstants.CENTER);
label3.setVerticalAlignment(SwingConstants.TOP);
// Add borders to the labels . . . more on Borders later in the book!
label1.setBorder(BorderFactory.createLineBorder(Color.black));
label2.setBorder(BorderFactory.createLineBorder(Color.black));
label3.setBorder(BorderFactory.createLineBorder(Color.black));
label1.setBounds(10, 10, 200, 150);
// Put it all together . . .
JFrame frame = new JFrame("AlignmentExample");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel p = new JPanel(new GridLayout(3, 1, 8, 8));
p.add(label1);
p.add(label2);
p.add(label3);
p.setBorder(BorderFactory.createEmptyBorder(8, 8, 8, 8));
frame.setContentPane(p);
frame.setSize(400, 500);
frame.setVisible(true);
Thanks so much!!change following JLabel1
| |
| |
| |
| JLabel1 |
| |
| |
| |
into following Jlabel1:
| |
| |
| |
| |
| |
| |
| |
JLabel1
Thanks -
If you login to an SAP session and then create another session via the system menu option (not a second login), transaction SM04 will show two different values for the parameter:
modeinfo[n].context_id_uuid
I need to know how to retrieve the value of this parameter from inside an ABAP program.
This question is related to the one Rich and Naren and I were discussing - about how to create a unique shared buffer memory id that will distinugish between a two sesssions of a single user who happens to be "MIGO'ng" twice.
Thanks for whatever answer anyone can provide ...
djh
Note: also posted in ABAP General ...Rich answered in ABAP general:
REPORT ZRICH_0001 .
type-pools: thfb.
data: context_id type THFB_CONTEXT_ID.
CALL FUNCTION 'TH_GET_CONTEXT_ID'
IMPORTING
CONTEXT_ID = context_id .
write:/ context_id . -
Problem with creation of a jar file from inside a java program
Hi,
I am trying to create a jar file at runtime from within a java program.
I am able to create a jar file just fine using:
String[] jarArgs = new String[3];
jarArgs[0] = "cvf";
jarArgs[1] = "C:\temp\myjar.jar";
jarArgs[2] = "C:\temp\this";
sun.tools.jar.Main main1 = new sun.tools.jar.Main(System.out, System.err, "jar");
main1.run(jarArgs);However, when I look at the jar it puts the absolute path to the files inside such as:
C:\temp\this\is\my\package\Class.class
instead of only this\is\my\package\Class.class
When running the jar command from the command line it works just fine and I have the relative paths in my jar file.
Does anyone have any experience with this and could help me out?
Thanks in advance
Edited by: mruf on Apr 11, 2008 1:51 AMShouldn't jarArgs[2] = "-C C:\temp\this"
Maybe you are looking for
-
How to import images from web via CSV in Indesign CS4?
Hi, I am using Indesign CS4 and i want to import pictures from my homepage. I have a CSV export from a database with products and the url to the product picture. I want to import the information for the products and the picture via data merge. I adde
-
Javascript Error in IE, works fine in FF
I have this page : http://www.gamertags.com.br/jogos.html The filters and spry data works fine in Firefox, but when using IE the page won´t load and the browser gives these errors : Agente de Usuário: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1
-
Authentication with Multiple SSIDs AP521G, using Autonomous
I have an AP521G access point that I am trying to setup authentication for multiple SSIDs. One SSID is for domain users with WPA/TKIP authentication to a radius server and the other SSID is for guest to have access to Internet with no authentication.
-
Nested properties & cluster error
Hi everybody, twice the same is not for a long time yet the same in LabVIEW. Setting two properties causes the overwriting of the first property. This behavior will presumably apply to nested clusters / classes, too. Please see attached example vi fo
-
hai this is sakri working as a technical consultant. we have a query like arcIMS should integrate with sap. please guide the steps. with regards, sakri