Thursday, November 18, 2010

Windows 7 Printer not printing

 

Sometimes Windows is not really helping when you never reboot. I like my Windows 7 Sony Vaio laptop, especially the hibernation function. Quick start everytime, but sometimes Windows need to be rebooted, especially when things are becoming slow or stop functioning. This week I had a problem during printing: I was unable to print, each time it failed. My guess was that the printer spooler got lost somewhere.

So a quick tip:

Open command prompt (with Administrative priviledges: right click on shortcut, select Run as Administrator):

Issue the following command:

net stop spooler

and then

net start spooler

Your printing issues will be gone (unless something is really messed up)

(for more info see this link)

Tuesday, November 2, 2010

Android development continued

Sometimes this Eclipse is killing me Smile After I added a menu.xml, it kept giving strange errors like, XML cannot be parsed, size 0, bla bla. I double checked the xml and couldn’t find any problems. So maybe it could have been an Eclipse issue, so I restarted it.

After restarting Eclipse, this time I got the message:

Unparsed aapt error(s)! Check the console for output. <ProjectName> Unknown Android Packaging Problem.

Checking the console, revealed no errors Sad smile What to do now. Again Google Fu learned me how to resolve this issue as follows:

Right-click on the error message in the Problems view, and deleting the error. Modify the xml for forcing a build and magically it worked.

Monday, November 1, 2010

Android development

After a long time not using Eclipse, I recently started it again to experiment further with Android development. 3 things came up, which I would like to share with you and what the fix is.

image

 

After creating a test Android project, the following error showed up:

ERROR: Unable to open class file <path>\gen\com\example\test\R.java: No such file or directory.

It seems that the java compiler cannot create this R.java. In order to fix this, do the following:

  1. Open Eclipse
  2. Open Window/Preferences
  3. Expand JAVA option
  4. Select Build Path
  5. Check the option "Project" and uncheck "folder" options
  6. Click on OK
  7. Restart eclipse IDE

These steps fixed my problems regarding this issue.

 

image

 

When trying to run the application, the following error came up:

An internal error occurred during: "Launching test".com/android/ddmlib/ShellCommandUnresponsiveException

The fix for this was to update the Android DDMS by going to Help -> Software Updates select the Android DDMS and press Update button.

I had updated the Android Development tools, but had forgotten to update the Android DDMS.

 

image

 

Unable to view manifest files from within Eclipse, when you open the main.xml

When you try to open an application's manifest file from within Eclipse, you might get an error such as this one:

An error has occurred. See error log for more details.
org.eclipse.wst.sse.ui.StructuredTextEditor.isBlockSelectionModeEnabled()Z

Try reverting to the 3.0 version of the Eclipse XML Editors and Tools. If this does not work, remove the 3.1 version of the tool. To do this in Eclipse 3.4:

  1. Select Help > Software Updates...
  2. Select the Installed Software tab.
  3. Select Eclipse XML Editors and Tools.
  4. Click Uninstall.
  5. Click Finish.
  6. When you restart Eclipse, you should be able to view the manifest files.

In my case, I just uninstalled them and it magically worked Smile

 

Hope these were useful for you if you encounter the same issue.

Sunday, October 31, 2010

Samsung Galaxy S Tips

I was just surfing and encountered some tips on the usage of the Samsung Galaxy S which will help me/you to get the most of this excellent phone.

  1. Contact screen: Swipe to left to create a text/SMS message to the contact
  2. Contact screen: Swipe to right to call the contact immediately
  3. Contact screen: Move your finger in the alphabet to quickly navigate to a contact starting with the letter, then while pressing move to left to move within that letter, eg. after D you can navigate in everything starting with D by moving to the left
  4. Press and hold HOME key to get a list of recently used apps, which can be used to switch between applications (not specific to SGS)
  5. Press menu and Edit in the home screen to delete and/or reorder the home pages. In order to reorder: touch and hold the screen which will allow to drag them
  6. If your brightness is not set to auto, you can swipe from left to right in the notification bar to set brightness to maximum and the right to left to set brightness to minimum.
  7. You can have the SGS announce the title/artist of a song from the Music player by pressing and holding the Up Volume button while a song is playing
  8. You can "lock screen" while watching video by pressing Power Button while a video is playing. This is great at preventing unintended clicks while holding the phone watching a video
  9. In the browser: Access to the bookmark button and address bar by tapping the Menu button (no need to scroll all the way up)
  10. Open soft D-Pad by tap-and-hold the "?123" key on the standard Samsung Keyboard or swipe from the Swype button to the SYM button in the Swype Keyboard
  11. Pressing and holding the Power button (keep pressing it after you get the shutdown/airplane dialog) will perform a reset.
  12. Holding the Menu key for a second, will bring up the search dialog (emulating the search button available in other Android phones)
  13. You lock the camera screen to only take a shot, by pressing the Power button for a very short time. This will show a paddock on screen.
  14. When receiving a call press the volume down button to mute the ringer
  15. Use the volume +/- in camera mode to zoom in and out

For more technical tips see the also the XDA forum and see also a list of cool apps to use with the SGS.

Thursday, September 30, 2010

Samsung Galaxy MTP keeps repeating “Initializing” when connected to USB

image I have been using a Samsung Galaxy for a few weeks now and it has been the best phone ever. I think Samsung has really got a phone which can blow away the iPhone (4) without any problems. After installing the voodoo fix for the lag issue, it has been extremely fast. Just now waiting for the Froyo (Android 2.2) release and my life will be complete :)

Anyway, today I connected my Galaxy to my PC, and for the first time something strange happened. The MTP application for KIES on the phone kept initializing. It tries to initialize but for some reason it dies and then the whole process starts all over again, actually funny to see. However this meant I was unable to access my phone from my PC. I needed some Google-fu. After a while I found the solution, it seems that if you have any files with an extension longer then 16 characters, the MTP application just looses it.

For me the solution was to start up my favorite file manager (ES File Explorer) and remove the TunnyBrowser folder. This folder is used by the Dolphin browser I have been using for a while now. If the issue still exists and you are using Soundhound try also removing the SoundHound cache folder. If this does not help, get your SD card out and search for files with long extensions.

Hope this helps if you have the similar issue

Thursday, September 2, 2010

FFMpeg and WMV conversion

image

Just a quick blog entry. When converting video files (avi, mpg, etc) to WMV to play on Windows or XBOX, you will need to make sure that the correct audio encoding (wmav2) is used. If not the video file will not play and you will probably get an error.

 

You can use the –acodec wmav2 switch in ffmpeg command parameter to enforce to correct audio encoding for WMV files.

Tuesday, August 24, 2010

Creating animated gifs from movies

There are a lot of guides on explaining how to creating animated gifs by either creating them using various tools or by directly converting them from a movie. If you want to create an animated gif from scratch you can use Adobe Fireworks or Beneton Movie Gif. If you want to convert movie files (like WMV or FLV) to an animated gif, the best tool to use is ffmpeg.

The quick way

The easiest way to convert a  movie (in this example I will use a wmv, but it can also be any movie type) is using the internal function of ffmpeg. You can convert it by issuing the following command (which will create output.gif):

ffmpeg –i movie.wmv –r 5 –pix_fmt rgb24 –loop_output 0 –s 320x240 output.gif


Explanation of the switches (see also ffmpeg documentation):

































-i determines the input file name (movie.wmv)

(put your filename between “ s if it contains spaces)
-r 5 tells ffmpeg to use a framerate of 5, which is a good setting when creating animated gif files (can be omitted if you want to use the original framereate)
-pix_fmt rgb24 required when converting to gif

(due to the max colors in a gif file)
-loop_output 0 Makes sure the gif animated forever, omit if this is not required
-s 320x240 Set the gif size to 320 by 240 to make the size of the animated gif smaller. Omit this if you don’t want this


This works perfect, however personally I am not so fond of how ffmpeg chooses the GIF color palette. I have not found anyway to improve this.



The better results way



As mentioned above, depending on your movie, the converted gif does not have an optimal color palette and you will see a lot dithering. The method I use most which gives the best results is exporting the frames using ffmpeg and importing them to your favorite animate gif tool (in my case Fireworks)



To export the frames of a movie using ffmpeg use:



ffmpeg –i movie.wmv –an –r 5 –y capture%d.png


Quick explanation: -an stands for no audio, –r specifies the framerate (change accordingly) and –y just tells ffmpeg to overwrite if files are existing. You export to any image format. I use PNG because this gives the best results.



The next step is to import your files in your favorite animator app. In Fireworks, select File – Open and select multiple the files you have generated with ffmpeg. Before pressing the Open button, make sure that the you check the “Open as animation” checkbox



image



Now Fireworks will create all the frames for you based on the image you have selected. Do your usual stuff and export it to animated gif.



Hope that this was useful and happy animating!

 
Souces: ahfr.org, noeckel,