public static final int DEFAULT_TRANSPORT_ORDER[] = { TRANSPORT_WIFI, TRANSPORT_BES, TRANSPORT_BIS,
TRANSPORT_DIRECT_TCP, TRANSPORT_WAP2 }
Sample use:
HttpConnectionFactory factory =
new HttpConnectionFactory( "http://www.versatilemonkey.com/test.txt",
HttpConnectionFactory.TRANSPORT_WIFI | HttpConnectionFactory.TRANSPORT_BES );
while( true ) {
try {
HttpConnection connection = factory.getNextConnection();
try {
connection.setRequestMethod( "POST" );
connection.setRequestProperty( "Content-type",
"application/x-www-form-urlencoded" );
OutputStream os = connection.openOutputStream( );
os.write( "foo=bar&var2=val2".getBytes() );
os.close();
InputStream is = connection.openInputStream();
//do something with the input stream
if( whatever we did worked ) {
break;
}
}
catch( IOException ) {
// Log the error or store it for displaying to
// the end user if no transports succeed
}
}
catch( NoMoreTransportsException e ) {
//There are no more transports to attempt
Dialog.alert( "Unable to perform request" );
//Note you should never attempt network activity on the event thread
break;
}
}
When you want animated maps or zippier feedback than Google’s JavaScript mapping API can provide, you can use the Flash Maps API. Yes, even Google acknowledges that its popular, full-featured platform can’t do everything. Using the Flash API used to mean you needed to know Flash. Now, you can get the benefit, but still program in JavaScript.
If you’re using FF 3.5 to view any website and have firebug enabled,
you may encounter an annoying javascript error:
“onreadystatechange FAILS Error: Permission denied for XXXX to create
wrapper for object of class UnnamedClass Error”
This is a FF3.5/Firebug issue and is not a bug of the website
Unfortunately, there is no real good workaround if you need to have
firebug on except that disabling the Net tab may help reduce the
chances of getting the error. But if you don’t have to use firebug,
simply turn it off.
If you are using RTC API and and you are installing your bot on 64 BIT CPU, You may get this exception
System.BadImageFormatException: Retrieving the COM class factory for component
with CLSID {7A42EA29-A2B7-40C4-B091-F6F024AA89BE} failed due to the following
error: 800700c1.
This means that you have compiled your code for ANY CPU or 64x cpu and whenever you run your code on 64 bit machine then OS will try to run your application as 64 bit. Bot RTC API is 32 Bit CPU based api, so it will not be supported in 64bit cpu environment.
To solve this issue compile your code for x86 machine(i.e. 32 bit cpu). Now install your application on 64 bit machine. You application should run successfully.
Also verify that in Task Manager 32* is appearing ahead your application name. This will confirm that your application is running in 32 bit environment.
Google Wave is a new tool for communication and collaboration on the web, coming later this year. Watch the demo video below, sign up for updates and learn more about how to develop with Google Wave.
Web page load time is an important factor in we design and development, not only web developes but bloggers and site owners need to optimize their web pages so they load faster or else retaining users will be difficult. There are many tools which analyze web pages and show you ways to improve load times. Firebug for Firefox is a useful addon for analyzing web page css, js and other stuff.
Google has released a Firefox addon called Page Speed today that is integrated with Firebug, that means you need Firebug for Firefox and of course Firefox before you can install this addon. The Page speed addon when installed adds tabs to Firebug console.
You can analyze web page performance using this addon, click on “Analyze Performance” button in the page speed tab in firebug. It gives optimization tips upon examining the web pages. The tips ranges from highly recommended, moderate to least. These tips will provide short description and clicking on the link will take you to page speed documentation where you can read more on how to optimize your site.
The Show Resources link will show you the objects loaded in the web page with the type of the object, file size and transfer size. You might find some scripts and images that are too heavy here, better to get rid of them or minimize them.
Yahoo long has a similar addon called YSlow for Firebug that analyzes web pages and suggests improvements for performance of web pages.
You can not create the virtual host for SSL port in IIS. Its a UI bug. But you can achieve the same thing using the command line by using the following steps:
1. Create two websites in IIS and configure HTTPS on both of the websites.
2. At this point you will not be able to start both the websites at the same time, because https is configured on 443 port in both the websites.
3. Stop both the website if running.
4. Go to commands line and cd to C:\Inetpub\AdminScripts folder.
5. Now you have to figure out the website identity of you want to change the host. Type following command to command line. You may want to run this command two times, because first time it may try to set the VB script as default script
C:\Inetpub\AdminScripts>iisweb /query
Connecting to server ...Done.
Site Name (Metabase Path) Status IP Port Host
==============================================================================
Default Web Site (W3SVC/1) STOPPED ALL 80 N/A
Communicator Web Access (W3SVC/175074822) STOPPED 127.0.0.1 81 N/A
VMware Management Interface 1.0.4 (W3SVC/2) STARTED ALL 8222 N/A
reliance (W3SVC/1386234876) STARTED ALL 82 N/A
Note: you should get all the sites registered in your IIS server along with their site identities.
6. Modify the virtual host of SSL port using following command
C:\Inetpub\AdminScripts>cscript.exe adsutil.vbs set W3SVC/<site identifier>/SecureBindings ":443:<host header>"
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.
SecureBindings : (LIST) ":443:<host header>"
7. Make sure host name is properly configured in your DNS server.
8. Start both the websites.
9. You should be able to access both the application using different host on https communication.