Welcome to my blog, hope you enjoy reading
RSS

Friday, 9 November 2012

How Encrypt the GWT String from Client Side


  • Download the jar file from link.
  • Add the following in the .gwt.xml file 

  •         <inherits name='com.googlecode.gwt.crypto.Crypto'/>

     
  • Use the following code in the class

                  String getSHA1for(String text) 
               {
 SHA1Digest sd = new SHA1Digest();
 byte[] bs = text.getBytes();
 sd.update(bs, 0, bs.length);
 byte[] result = new byte[20];
 sd.doFinal(result, 0);
 return byteArrayToHexString(result);
}

String byteArrayToHexString(final byte[] b) 
               {
 final StringBuffer sb = new StringBuffer(b.length * 2);
 for (int i = 0, len = b.length; i < len; i++) {
   int v = b[i] & 0xff;
   if (v < 16) sb.append('0');
   sb.append(Integer.toHexString(v));
 }
 return sb.toString().toUpperCase();
}
Share

Tuesday, 6 November 2012

How can I use my PC's keyboard on the Android emulator?


How can I use my PC's keyboard on the Android emulator?

That's howI fixed it.
  1. Eclipse > Window menu > AVD Manager
  2. Select your virtual device and click Edit
  3. Under Hardware, Click New
  4. Select Keyboard Support then click OK
  5. Edit its value to yes
My other AVDs that don't have this "keyboard support" hardware property added for sure don't accept my physical keyboard input

Share

Android requires compiler compliance level 5.0 or 6.0. Found '1.7' instead. Please use Android Tools > Fix Project Properties


Android requires compiler compliance level 5.0 or 6.0. Found '1.7' instead. Please use Android Tools > Fix Project Properties


That isn't the problem, Jack. Android SDK isn't x64, but works ok with x64 jvm (and x64 eclipse IDE).
As helios said, you must set project compatibility to Java 5.0 or Java 6.0.
To do that, 2 options:
  1. right-click on your project and select "Android Tools -> Fix Project Properties" (if this din't work, try second option)
  2. right-click on your project and select "Properties -> Java Compiler", check "Enable project specific settings" and select 1.5 or 1.6 from "Compiler compliance settings" select box.
Share

how to test website google android on your pc



             The addon for the bowser is the User-Agent Switcher

For chrome:
             A.  To install the following addon click here.

             B. For add the new User Agents.

Share

how-to-change-eclipse-svn-password(Ubuntu)



    1. Remove the .keyring file from eclipse.

         1.1  Goto  /eclipse/configuration/org.eclipse.core.runtime folder

         1.2  In menu select view-->Show Hidden Files

         1.3  Remove .keyring file

    2. Restart the eclipse .
Share

Saturday, 20 October 2012

Running GWT Tests in Eclipse




You should be able to run most of your GWT tests from within Eclipse using the following steps.
  1. Right-click on a test that extends GWTTestCase and go to Run As > JUnit Test. It's likely you will see the error message below.
    Invalid launch configuration: -XstartOnFirstThread not specified.
    
    On Mac OS X, GWT requires that the Java virtual machine be invoked with the
    -XstartOnFirstThread VM argument.
    
    Example:
      java -XstartOnFirstThread -cp gwt-dev-mac.jar com.google.gwt.dev.GWTShell
    
  2. To fix this error, go to Run > Open Run Dialog. Click on the Arguments tab and add the following values. The 2nd value is to increase the amount of memory available to the test and avoid an OOM error.
    -XstartOnFirstThread -Xmx512M
  3. When you re-run the test, you will probably see the following error:
    com.google.gwt.junit.JUnitFatalLaunchException: The test class 'org.richresume.client.home.HomeControllerGwtTest' 
    was not found in module 'org.richresume.client.Application'; no compilation unit for that type was seen
      at com.google.gwt.junit.JUnitShell.checkTestClassInCurrentModule(JUnitShell.java:193)
      at com.google.gwt.junit.JUnitShell.runTestImpl(JUnitShell.java:628)
      at com.google.gwt.junit.JUnitShell.runTest(JUnitShell.java:150)
      at com.google.gwt.junit.client.GWTTestCase.runTest(GWTTestCase.java:219)
    
  4. To fix this, open the Run Dialog again, click on the Classpath tab and click on User Entries. Click on the Advanced button and select Add Folders. In the Folder Selection dialog, select your source and test directories (e.g. src/main/java andsrc/test/java).
  5. Run the test again and you should see a green bar in your JUnit tab.
  6. To create a JUnit configuration that runs all tests, duplicate the previously mentioned run configuration. Then change the name to "All Tests" and select the 2nd radio button to run all tests in the project.
  7. Click Run to execute all the tests in the project.
Share

Tuesday, 11 September 2012

Eclipse plugin for PhoneGap for Android available TODAY


Eclipse plugin for PhoneGap for Android available TODAY



Check out Announcements for the latest release and news

I'd like to let you know that the 1.0 release of the Eclipse plugin for PhoneGap for Android is available today.

You can install it into the 0.9.9 Eclipse ADT by pointing Eclipse's Install New Software to
http://www.mobiledevelopersolutions.com/home/download/pluginfilecabinet  More getting started information at http://www.mobiledevelopersolutions.com/home/start

This plugin allows you do all of your Android PhoneGap development within the Eclipse IDE.  After downloading and installing phonegap,
Eclipse is all you need - no need for droidgap, path manipulation or any other command line tools.

The plugin incorporates Eclipse JSDT's powerful development capabilities including its validator, which facilitates error detection while editing instead of deployment.

It also makes hybrid Java/JavaScript development easy, for when you have to tweak the Android Java code.

The future roadmap includes JavaScript debugging, source control integration, and improved workflow.  Let me know your ideas or participate in the open source development at http://github.com/paulb777/Eclipse-Plugin-for-Phonegap

Thanks to the Eclipse Foundation's Tools for Mobile Web (TMW) and Android's ADT open source projects which greatly facilitated the development.

I'm eager to hear any feedback and comments, either here or at the Eclipse for PhoneGap Google Group.
Share

Thursday, 16 August 2012

creating war file in eclipse


creating war file in eclipse 


If you are using eclipse 3.5 then goto window menu-> Preferences ->Server (on left side) -> Runtime Environment then click Add button then select the web server, which ever you want and click next -> browse the location of server.
Now,
Create Dynamic Web Project ,build it, right click on your project in Project Explorer, click Export->WAR file and browse the location where you want to create WAR file.
Share

Monday, 30 July 2012

Different Ways To Embed A Free MP3 Player On Your Website


Different Ways To Embed A Free MP3 Player On Your Website.

links 

HTML Audio





Google Reader Podcast Player For Single MP3s


The Digital Inspiration blog has the details on embedding MP3 files with the Google Player, but to summarize the article, you just have to insert this code, replacing “MP3URL” with the correct URL of the MP3 file hosted on the web that you want to embed in your index.html file that hosts the main page:

<embed type=”application/x-shockwave-flash” src=”http://www.google.com/reader/ui/3523697345-audio-player.swf” flashvars=”audioUrl=MP3URL” width=”400″ height=”27″ quality=”best”></embed>

While this player is very simple in appearance, it doesn’t carry the Google logo, it even has volume controls and is probably one of the easiest ways to embed an MP3 player working fast.


embed mp3 player

Yahoo Media Player For Any MP3 URL On A Page

So let’s say you already have a bunch of MP3 files listed on your webpage and you just need a player. Instead of inserting the Google player code for each and every one of those MP3s, you could just use the handy Yahoo Media Player.
embed mp3
As long as you have linked to those MP3 files in your webpage, you can use the following code to include the Yahoo Media Player, which will detect the MP3 files and display the playbuttons next to each MP3 file.
<script src=”http://mediaplayer.yahoo.com/js” type=”text/javascript”></script>
With that one line of HTML, you get a floating media player that can play all the MP3 files in one webpage.
embed mp3

JW FLV Player For Playlists

The JW Player is an open-source player for non-commercial use. You can download the player, which comes with a few more files, namely swfobject.js and player.swf, all of which you’ll upload to the same location where your website is. Having the JW Player for playlists means you’ll need to insert code in your index.html page and also have a separate XML file with the track list, which really isn’t that hard to put together.
First, you’ll need to insert the following code on your index.html page:
<script type=’text/javascript’ src=’URLofSWFOBJECT.JS’></script>
<div id=’mediaspace’>This text will be replaced</div>
<script type=’text/javascript’>
var so = new SWFObject(‘URLofPLAYER.SWF’,’mpl’,’470′,’320′,’9′);
so.addParam(‘allowfullscreen’,'true’);
so.addParam(‘allowscriptaccess’,'always’);
so.addParam(‘wmode’,'opaque’);
so.addVariable(‘playlistfile’,’URLofPLAYLISTFILE.XML‘);
so.addVariable(‘playlist’,'left’);
so.write(‘mediaspace’);
</script>
The items in bold are the ones you need to replace with the correct URLs of the object, player, and XML file (URLofSWFOBJECT.JS, URLofPLAYER.SWF, URLofPLAYLISTFILE.XML). If this code doesn’t show anything on your page, try this code that’s meant to embed MP3 players in blogs and sites like MySpace:
<object classid=’clsid:D27CDB6E-AE6D-11cf-96B8-444553540000′ width=’470′ height=’300′ id=’single1′ name=’single1′>
<param name=’movie’ value=’URLofPLAYER.SWF‘>
<param name=’allowfullscreen’ value=’true’>
<param name=’allowscriptaccess’ value=’always’>
<param name=’wmode’ value=’transparent’>
<param name=’flashvars’ value=’playlistfile=URLofPLAYLISTFILE.XML&playlist=left&dock=false’>
<embed
type=’application/x-shockwave-flash’
id=’single2′
name=’single2′
src=’URLofPLAYER.SWF
width=’470′
height=’300′
bgcolor=’undefined’
allowscriptaccess=’always’
allowfullscreen=’true’
wmode=’transparent’
flashvars=’playlistfile=URLofPLAYLISTFILE.XML&playlist=left&dock=false’
/>
</object>
As for the XML file, all you need to do is to save a file with the XML file extension using Notepad in Windows or any text editor. If you’re using Notepad, make sure in the Save type as field has “All Files (*.*)”. Inside the XML file, paste this and replace bold items with the appropriate entries:
<?xml version=”1.0″ encoding=”UTF-8″?>
<playlist version=”1″ xmlns=”http://xspf.org/ns/0/”>
<title>Your MP3 Playlist</title>
<info>http://YourWebpageHere/</info>
<trackList>
<track>
<title>NAMEofMP3file1</title>
<location>URLofMP3file1.MP3</location>
</track>
<track>
<title>NAMEofMP3file2</title>
<location>URLofMP3file2.MP3</location>
</track>
<track>
<title>NAMEofMP3file3</title>
<location>URLofMP3file2.MP3</location>
</track>
</trackList>
</playlist>
You can add more tracks if you want with the
<track>
tag, just make sure you adjust the height of the player accordingly. This is what the player looks like with the playlist on the left.
embed mp3
To customize the color of the player, head over to the setup page from the official JW Player website. This setup page will also let you input your desired player parameters (e.g. whether to autoplay or not) and preview the results, while you don’t even have to figure out the code as it painlessly spits out the code for you to just copy.
how embed mp3 website
Not only does this awesome, free player take care of an entire playlist, it also can play single MP3 files. You’d only need to insert this code in your index.html file:
<script type=’text/javascript’ src=’PATHtoSWFOBJECT.JS‘></script>
<div id=’mediaspace’>This text will be replaced</div>
<script type=’text/javascript’>
var so = new SWFObject(‘URLofPLAYER.SWF‘,’ply’,’470′,’24′,’9′,’#000000′);
so.addParam(‘allowfullscreen’,'true’);
so.addParam(‘allowscriptaccess’,'always’);
so.addParam(‘wmode’,'opaque’);
so.addVariable(‘file’,’MP3URL‘);
so.addVariable(‘duration’,’DURATION‘);
so.write(‘mediaspace’);
</script>
You should also input the duration of the MP3 file, or you can also omit that line altogether.
If you would rather not mess with codes and would rather just copy and paste embed codes without having to modify them, you can always upload single MP3 to an online storage site, such as 4shared and Box.net, which offer embed codes for MP3 files.
how embed mp3 website
embed mp3 player
Did I miss an MP3 player that’s available for free? Let us know in the comments!

Share

Thursday, 26 July 2012

Increase Import Size of File in phpmyadmin (Ubuntu)


Increase Import Size of File in phpmyadmin (Ubuntu)

Increase Size of import File in phpmyadmin

Try these different settings in /etc/php5/apache2/php.ini

Find:
post_max_size = 8M
upload_max_filesize = 2M
max_execution_time = 30
max_input_time = 60
memory_limit = 8M

Change the values to your requirements.
Share