<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5503003700585906386</id><updated>2012-03-11T23:52:32.733-07:00</updated><category term='GRE'/><category term='Windows 2003'/><category term='Visual Studio'/><category term='Twitter'/><category term='MAPI'/><category term='Performance'/><category term='Outlook'/><category term='SQL Server'/><category term='AJAX'/><category term='GPEH'/><category term='x86'/><category term='SQLite'/><category term='Windows'/><category term='MSI'/><category term='App Promotion'/><category term='Oracle'/><category term='ASP.NET'/><category term='Windows Phone'/><category term='.NET Debugging'/><category term='VPN'/><category term='AndEngine'/><category term='Access'/><category term='Google Earth'/><category term='Chrome'/><category term='HP dv6000'/><category term='trouble shooting'/><category term='MOSS'/><category term='JSON'/><category term='cellular'/><category term='Android'/><category term='MooTools'/><category term='x64'/><category term='RDP'/><category term='Windows 7'/><category term='WinSNMP'/><category term='Quotes'/><category term='Windows Vista'/><category term='jQuery'/><category term='GoDaddy'/><category term='TFS'/><category term='WordPress'/><category term='GridView'/><category term='HyperLinkField'/><category term='Localization'/><category term='SharePoint'/><category term='XML'/><category term='Prototype'/><category term='WSP'/><category term='Memory Leak'/><category term='Scheduled Task'/><category term='Java'/><category term='AjaxToolkit'/><category term='IIS'/><category term='WSS'/><category term='KMZ'/><category term='Qoutes'/><category term='C#'/><category term='PHP'/><category term='Microsoft CRM'/><category term='administration'/><category term='Eclipse'/><category term='parser'/><category term='JavaScript'/><category term='Telminal Services'/><category term='.NET'/><category term='MDB'/><title type='text'>Sagi's Tech</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default?start-index=101&amp;max-results=100'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>116</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-4110780437861634592</id><published>2012-03-11T04:48:00.005-07:00</published><updated>2012-03-11T23:52:32.739-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows Phone'/><title type='text'>Enum.GetValues does not exist on Windows Phone</title><content type='html'>Enum.GetValues does not exist on Windows Phone. The solutions &lt;a href="http://cjbhaines.wordpress.com/2011/07/12/enum-getvalues-in-silverlight/"&gt;here&lt;/a&gt; and &lt;a href="http://stackoverflow.com/questions/105372/how-to-enumerate-an-enum"&gt;here &lt;/a&gt;requires LINQ.&lt;div&gt;I've changed the solutions so they would fit Windows Phone without LINQ. I also reduced memory allocations (not using enumerators and generic collections):&lt;/div&gt;&lt;br /&gt;&lt;pre name="code" class="csharp"&gt;public static T[] GetValues&amp;lt;T&amp;gt;()&lt;br /&gt;{&lt;br /&gt;   Type enumType = typeof(T);&lt;br /&gt;   if (!enumType.IsEnum)&lt;br /&gt;      throw new ArgumentException("Type '" + enumType.Name + "' is not an enum");&lt;br /&gt;&lt;br /&gt;   FieldInfo[] fields = enumType.GetFields();&lt;br /&gt;   int literalCount = 0;&lt;br /&gt;   for (int i = 0; i &lt; fields.Length; i++)&lt;br /&gt;      if (fields[i].IsLiteral == true)&lt;br /&gt;         literalCount++;&lt;br /&gt;&lt;br /&gt;   T[] arr = new T[literalCount];&lt;br /&gt;   int pos = 0;&lt;br /&gt;   for (int i = 0; i &lt; fields.Length; i++)&lt;br /&gt;      if (fields[i].IsLiteral == true)&lt;br /&gt;      {&lt;br /&gt;         arr[pos] = (T)fields[i].GetValue(enumType);&lt;br /&gt;         pos++;&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;   return arr;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-4110780437861634592?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/4110780437861634592/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=4110780437861634592' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/4110780437861634592'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/4110780437861634592'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2012/03/enumgetvalues-does-not-exist-on-windows.html' title='Enum.GetValues does not exist on Windows Phone'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-7377300238944144225</id><published>2012-02-20T22:16:00.000-08:00</published><updated>2012-02-20T22:40:45.403-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><category scheme='http://www.blogger.com/atom/ns#' term='App Promotion'/><title type='text'>Android Market Optimization</title><content type='html'>This subject also known as App Store Optimization (ASO). Few people started to write posts on this subject for Android, this post is an on-going work to collect links to those posts:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;There's a series of posts on &lt;a href="http://droid-blog.net"&gt;Droid-Blog&lt;/a&gt; blog: &lt;a href="http://droid-blog.net/2011/06/23/app-store-optimization-aso-14-keywords-description/"&gt;Keyworks &amp;amp; Description&lt;/a&gt;, &lt;a href="http://droid-blog.net/2011/06/28/app-store-optimization-aso-25-icons/"&gt;Icons&lt;/a&gt;, &lt;a href="http://droid-blog.net/2011/10/19/app-store-optimization-aso-35-graphics-videos/"&gt;Graphics &amp;amp; Videos&lt;/a&gt;&lt;/li&gt;&lt;li&gt;A post called &lt;a href="http://altdevblogaday.com/2011/09/27/hacking-the-app-stores/"&gt;Hacking the app stores&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-7377300238944144225?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/7377300238944144225/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=7377300238944144225' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/7377300238944144225'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/7377300238944144225'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2012/02/android-market-optimization.html' title='Android Market Optimization'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-6090389951225464730</id><published>2012-02-15T22:43:00.000-08:00</published><updated>2012-02-20T22:16:48.048-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><category scheme='http://www.blogger.com/atom/ns#' term='App Promotion'/><title type='text'>Android promotion: pay per install</title><content type='html'>I tried looking for ways to promote Android apps. It was hard. Why companies aren't saying: we're doing Pay-Per-Install campaigns? (alternative names include: Cost-Per-Install, CPI, Cost-Per-Action, CPA)&lt;br /&gt;&lt;br /&gt;Here's a list of pay-per-install for Android I've found so far (on going work, please correct me if there's something wrong here):&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.appbrain.com/"&gt;AppBrain&lt;/a&gt; - Free apps only, Minimum bid: 0.20$, minimal daily budget: 25$, minimal campaign budget: 100$. See more details &lt;a href="http://www.appbrain.com/info/advertise"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="https://www.tapjoy.com/"&gt;TapJoy&lt;/a&gt; - Pay-per-install plus optional pay-per-action (which probably cost much more). Couldn't find minimal prices for pay-per-install.&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.radiumone.com/"&gt;RadiumOne&lt;/a&gt; - ???&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.w3i.com/"&gt;W3I&lt;/a&gt; - ???&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.flurry.com/product/appcircle/index.html"&gt;Flurry AppCircle&lt;/a&gt; - Free &amp;amp; paid apps. Minimum bid: 0.75$&lt;/li&gt;&lt;li&gt;&lt;a href="http://everbadge.com/"&gt;Everbadge&lt;/a&gt; - Free &amp;amp; paid apps. Minimum bid: 0.15$&lt;/li&gt;&lt;li&gt;&lt;a href="http://appredeem.com/"&gt;AppRedeem&lt;/a&gt; - Free &amp;amp; paid apps. Minimum bid: 0.50$ (paid apps), 0.15$ (free apps)&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.heyzap.com/"&gt;HeyZap&lt;/a&gt; - ???&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;References:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="https://groups.google.com/forum/#%21msg/android-discuss/tlYilbiPhDc/nxKsnze59tEJ"&gt;https://groups.google.com/forum/#!msg/android-discuss/tlYilbiPhDc/nxKsnze59tEJ&lt;/a&gt;&lt;/li&gt;&lt;li&gt;User comment: updated Everbadge minimum bid.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-6090389951225464730?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/6090389951225464730/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=6090389951225464730' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/6090389951225464730'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/6090389951225464730'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2012/02/android-promotion-pay-per-install.html' title='Android promotion: pay per install'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-207094173929233675</id><published>2012-01-30T02:17:00.001-08:00</published><updated>2012-02-16T04:27:15.830-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>Downloading Android source code on Windows</title><content type='html'>Here's the short-short version:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Download and install command line Git client: &lt;a href="http://code.google.com/p/msysgit/"&gt;msysgit&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;Download the root Android project using Git.exe (located in /bin folder of msysgit)&lt;br /&gt;    git clone https://android.googlesource.com/platform/manifest &lt;targetfolder&gt;&lt;/targetfolder&gt;&lt;/li&gt;&lt;li&gt;In the target folder you'll find few XML files. Open &lt;span style="font-weight: bold;"&gt;default.xml&lt;/span&gt;. You can see multiple tags &lt;project&gt;. Choose the project you want to download. You need the &lt;span style="font-weight: bold;"&gt;name &lt;/span&gt;attribute of the project. Write the following line to download:&lt;br /&gt;  git clone https://android.googlesource.com/&lt;project name=""&gt; &lt;targetfolder&gt;&lt;/targetfolder&gt;&lt;/project&gt;&lt;/project&gt;&lt;/li&gt;&lt;/ol&gt;&lt;span style="font-weight: bold;font-size:100%;" &gt;Example: &lt;/span&gt;&lt;br /&gt;To download the most interesting project (IMHO) frameworks/base, the GIT command is:&lt;br /&gt; git clone https://android.googlesource.com/platform/frameworks/base &lt;targetfolder&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-weight: bold;"&gt;Projects of interest:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;packages/apps/XXXX - The project names of the apps that comes bundled with Android (excluding proprietry Google apps such as the Android Market) such as the Gallery, Camera etc.&lt;/li&gt;&lt;li&gt;external/XXXX - 3rd party software (ping, bzip, etc).&lt;/li&gt;&lt;li&gt;frameworks/base - The sources of the Java system.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;/targetfolder&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-207094173929233675?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/207094173929233675/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=207094173929233675' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/207094173929233675'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/207094173929233675'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2012/01/downloading-android-source-code-on.html' title='Downloading Android source code on Windows'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-4176741977477977994</id><published>2012-01-21T22:42:00.000-08:00</published><updated>2012-01-21T22:50:36.749-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>Android (Java) object pool</title><content type='html'>There are many ways to implement an object pool. Here's the way it's implemented in some classes in Android (Message, MotionEvent, Parcel, VelocityTracker):&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;private MyObjectName next;&lt;br /&gt;private static Object mPoolSync = new Object();&lt;br /&gt;private static MyObjectName mPool;&lt;br /&gt;private static int mPoolSize = 0;&lt;br /&gt;private static final int MAX_POOL_SIZE = 10;&lt;br /&gt;&lt;br /&gt;public static MyObjectName obtain() {&lt;br /&gt;  synchronized (mPoolSync) {&lt;br /&gt;    if (mPool != null) {&lt;br /&gt;      MyObjectName m = mPool;&lt;br /&gt;      mPool = m.next;&lt;br /&gt;      m.next = null;&lt;br /&gt;      return m;&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;  return new Message();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void recycle() {&lt;br /&gt;  synchronized (mPoolSync) {&lt;br /&gt;    if (mPoolSize &lt; MAX_POOL_SIZE) {&lt;br /&gt;      clearForRecycle();&lt;br /&gt;                &lt;br /&gt;      next = mPool;&lt;br /&gt;      mPool = this;&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-4176741977477977994?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/4176741977477977994/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=4176741977477977994' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/4176741977477977994'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/4176741977477977994'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2012/01/android-java-object-pool.html' title='Android (Java) object pool'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-3721483064198274733</id><published>2012-01-11T04:22:00.000-08:00</published><updated>2012-01-11T23:37:52.747-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>Reducing ArrayList add()/remove() memory re-allocation/shifts</title><content type='html'>This post is Android related, but probably goes to all java systems.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Reason:&lt;/span&gt; ArrayList implementation is based on an array, with a pointers to the start and end of the array.&lt;br /&gt;(1) When you remove the first or last items, the pointers are moved. If you remove and items from the middle all the items after the removed location are shifted.&lt;br /&gt;(2) After many removes/adds the start pointer is set so high the ArrayList is forced to shift all the items.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Solution:&lt;/span&gt; when removing item - swap the item with the last item, and remove the last item. Drawback - you lose the order of the items in the ArrayList.&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="Java"&gt;import java.util.ArrayList;&lt;br /&gt;import java.util.ArrayList;&lt;br /&gt;import java.util.Collection;&lt;br /&gt;&lt;br /&gt;public class SwapArrayList&lt;E&gt; extends ArrayList&lt;E&gt; {&lt;br /&gt; private static final long serialVersionUID = 2995040970224168173L;&lt;br /&gt;&lt;br /&gt; public SwapArrayList() {&lt;br /&gt;        this(0);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public SwapArrayList(int capacity) {&lt;br /&gt;     super(capacity);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public SwapArrayList(Collection&lt;? extends E&gt; collection) {&lt;br /&gt;     super(collection);&lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;    @Override&lt;br /&gt;    public boolean remove(Object object) {&lt;br /&gt;        int index = indexOf(object);&lt;br /&gt;        if (index &gt;= 0) {&lt;br /&gt;         int size = this.size();&lt;br /&gt;         if (index &lt; size - 1) {&lt;br /&gt;          // Swap the last item with the item to be removed&lt;br /&gt;       E tmp = this.get(size - 1);&lt;br /&gt;       this.set(size - 1, this.get(index));&lt;br /&gt;       this.set(index, tmp);&lt;br /&gt;       index = size - 1;&lt;br /&gt;         }&lt;br /&gt;         &lt;br /&gt;            remove(index);&lt;br /&gt;            return true;&lt;br /&gt;        }&lt;br /&gt;        return false;&lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;    @Override&lt;br /&gt;    public E remove(int location) {&lt;br /&gt;     int size = this.size();&lt;br /&gt;     if (0 &lt;= location &amp;&amp; location &lt; size) {&lt;br /&gt;      if (location &lt; size - 1) {&lt;br /&gt;       // Swap the last item with the item to be removed&lt;br /&gt;       E tmp = this.get(size - 1);&lt;br /&gt;       this.set(size - 1, this.get(location));&lt;br /&gt;       this.set(location, tmp);&lt;br /&gt;       location = size - 1;&lt;br /&gt;      }&lt;br /&gt;     } else {&lt;br /&gt;      throw new IndexOutOfBoundsException();&lt;br /&gt;     }&lt;br /&gt;     &lt;br /&gt;     return super.remove(location);&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-3721483064198274733?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/3721483064198274733/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=3721483064198274733' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/3721483064198274733'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/3721483064198274733'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2012/01/reducing-arraylist-addremove-memory-re.html' title='Reducing ArrayList add()/remove() memory re-allocation/shifts'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-8413273121291339130</id><published>2012-01-08T04:56:00.000-08:00</published><updated>2012-01-08T05:04:52.282-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>onKeyDown/onKeyUp/onTrackballEvent does not fire in a View</title><content type='html'>When trying to get keypad events in a view, the view does not get those events unless explicitly sent by the Activity, so to fix this add the following code in the Activity:&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;@Override&lt;br /&gt;public boolean onTrackballEvent(MotionEvent event) {&lt;br /&gt;    if (mView.dispatchTrackballEvent(event) == true)&lt;br /&gt;        return true;&lt;br /&gt;       &lt;br /&gt;    return super.onTrackballEvent(event);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-8413273121291339130?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/8413273121291339130/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=8413273121291339130' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/8413273121291339130'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/8413273121291339130'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2012/01/onkeydownontrackballeventetc-does-not.html' title='onKeyDown/onKeyUp/onTrackballEvent does not fire in a View'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-6873437951406459958</id><published>2011-12-15T01:35:00.000-08:00</published><updated>2011-12-15T01:40:35.068-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Finding table by column name in a database</title><content type='html'>From time to time I need to find a table in a database which I know the column name but I have to search for the table.&lt;br /&gt;&lt;br /&gt;Here's how to do it in &lt;span style="font-weight: bold;"&gt;Oracle&lt;/span&gt;:&lt;br /&gt;SELECT TABLE_NAME, COLUMN_NAME&lt;br /&gt;FROM USER_TAB_COLUMNS -- COLS,&lt;br /&gt;WHERE COLUMN_NAME = 'ColumnNameHere'&lt;br /&gt;GROUP BY TABLE_NAME, COLUMN_NAME;&lt;br /&gt;&lt;br /&gt;Here's how to do it in &lt;span style="font-weight: bold;"&gt;SQL Server&lt;/span&gt;:&lt;br /&gt;SELECT obj.Name, col.Name&lt;br /&gt;FROM sysobjects obj, syscolumns col&lt;br /&gt;WHERE obj.id = col.id&lt;br /&gt;AND col.Name = 'ColumnNameHere'&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-6873437951406459958?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/6873437951406459958/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=6873437951406459958' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/6873437951406459958'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/6873437951406459958'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2011/12/finding-table-by-column-name-in.html' title='Finding table by column name in a database'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-5420906413153079495</id><published>2011-11-24T06:11:00.000-08:00</published><updated>2011-11-24T06:36:21.638-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>Protected free Android applications</title><content type='html'>One issue I'm facing from time to time is people copying my apps &amp;amp; change the ad network code.&lt;br /&gt;&lt;br /&gt;I found the following methods good fighting them:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Use &lt;a href="http://developer.android.com/guide/developing/tools/proguard.html"&gt;ProGuard &lt;/a&gt;to obfuscate the code. If the code is obfuscated it's harder to remove other protective measures listed below. Some notes on ProGuard:&lt;br /&gt;(a) Move important functionality from non-obfuscated functions (such as onCreate)&lt;/li&gt;&lt;li&gt;Check application signature, use: &lt;span style="font-weight: bold;"&gt;getPackageManager().getPackageInfo(getPackageName(), PackageManager.GET_SIGNATURES).signatures[0]&lt;/span&gt;&lt;/li&gt;&lt;li&gt;CRC/Checksum validation of resources&lt;/li&gt;&lt;li&gt;&lt;a href="http://androidcracking.blogspot.com/2011/06/anti-tampering-with-crc-check.html"&gt;CRC/Checksum validation of the APK.&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://androidcracking.blogspot.com/2011/06/protection-by-checking-for-debuggers.html"&gt;Check if the application is running in debugger&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;&lt;a href="http://androidcracking.blogspot.com/2011/01/anti-cracking-example.html"&gt;Check installed package name&lt;/a&gt;.&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;When you discover an issue DO NOT stop the application. Start a sequence that will cause the application crash (for example, clear a list that should not be empty).&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-5420906413153079495?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/5420906413153079495/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=5420906413153079495' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/5420906413153079495'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/5420906413153079495'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2011/11/protected-free-android-applications.html' title='Protected free Android applications'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-8932058106898429937</id><published>2011-10-24T23:28:00.000-07:00</published><updated>2011-10-24T23:38:31.379-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><category scheme='http://www.blogger.com/atom/ns#' term='AndEngine'/><title type='text'>AndEngine BitmapTextureAtlas extension</title><content type='html'>Last few days I played with &lt;a href="http://www.andengine.org/"&gt;AndEngine&lt;/a&gt;, an open source, free, games framework for Android. I'm not sure yet if AndEngine will save time building new games.&lt;br /&gt;&lt;br /&gt;Anyhow, one weird part in AndEngine is the way you load all the resources into a single canvas. You have to define the location of each resource on the canvas, and if you change the resource size you have to recalculate everything.&lt;br /&gt;&lt;br /&gt;Here is a simple extension to BitmapTextureAtlas that calculate everything automatically and saves you the trouble of positioning the resources on the canvas.&lt;br /&gt;&lt;br /&gt;&lt;pre style="display: none;" name="code" class="Java"&gt;public class BitmapTextureAtlasEx extends BitmapTextureAtlas {&lt;br /&gt; int mUsedWidth;&lt;br /&gt; &lt;br /&gt; public BitmapTextureAtlasEx(int width, int height, TextureOptions options) {&lt;br /&gt;  super(width, height, options);&lt;br /&gt;  &lt;br /&gt;  mUsedWidth = 0;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; public TextureRegion appendTextureAsset(Context c, String assetPath) {&lt;br /&gt;  TextureRegion region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(&lt;br /&gt;         this, c, assetPath, mUsedWidth, 0);&lt;br /&gt;  mUsedWidth += region.getWidth();&lt;br /&gt;  &lt;br /&gt;  return region;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; public TiledTextureRegion appendTiledAsset(Context c, String assetPath, int tiledColumns, int tiledRows) {&lt;br /&gt;  TiledTextureRegion region = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(&lt;br /&gt;         this, c, assetPath, mUsedWidth, 0, tiledColumns, tiledRows);&lt;br /&gt;  mUsedWidth += region.getWidth();&lt;br /&gt;  &lt;br /&gt;  return region;&lt;br /&gt; } &lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And this is how to use it (in the onLoadResources funcation):&lt;br /&gt;&lt;pre style="display: none;" name="code" class="Java"&gt;mTexture = new BitmapTextureAtlasEx(1024, 128, TextureOptions.BILINEAR_PREMULTIPLYALPHA);&lt;br /&gt;      &lt;br /&gt;mTextureRegion = this.mTexture.appendTextureAsset(this, "texture.png");&lt;br /&gt;mTiledRegion = this.mTexture.appendTiledAsset(this, "tile.png", 1, 1);&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-8932058106898429937?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/8932058106898429937/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=8932058106898429937' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/8932058106898429937'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/8932058106898429937'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2011/10/andengine-bitmaptextureatlas-extension.html' title='AndEngine BitmapTextureAtlas extension'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-498417174854477066</id><published>2011-10-18T05:55:00.000-07:00</published><updated>2012-02-19T07:38:39.329-08:00</updated><title type='text'>Free resources for applications</title><content type='html'>This post is a work in progress.&lt;br /&gt;&lt;br /&gt;Here are few places I've found for useful for free resources. You should verify if the specific resource license fit your needs.&lt;br /&gt;&lt;br /&gt;Free fonts:&lt;br /&gt;*. &lt;a href="http://www.fontsquirrel.com/"&gt;http://www.fontsquirrel.com/&lt;/a&gt; (verify the copy rights per font, most are not really free)&lt;br /&gt;*. &lt;a href="http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&amp;amp;id=OFL"&gt;http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&amp;amp;id=OFL&lt;/a&gt; (read the OFL license first)&lt;br /&gt;&lt;br /&gt;Free clip arts:&lt;br /&gt;*. &lt;a href="http://www.openclipart.org/"&gt;http://www.openclipart.org/&lt;/a&gt;.&lt;br /&gt;*. &lt;a href="http://en.wikipedia.org/wiki/Wikipedia:Public_domain_image_resources"&gt;Huge list&lt;/a&gt; of sites that contain free images.&lt;br /&gt;&lt;br /&gt;Free music/sound affects:&lt;br /&gt;*. &lt;a href="http://www.freesound.org/"&gt;http://www.freesound.org&lt;/a&gt; - Creative common license.&lt;br /&gt;*. There are many sites that looks OK, just search for 'free sound effects'.&lt;br /&gt;&lt;br /&gt;A bit off-topic - royalty free resources (not free):&lt;br /&gt;*. &lt;a href="http://www.musicloops.com/"&gt;Music loops&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-498417174854477066?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/498417174854477066/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=498417174854477066' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/498417174854477066'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/498417174854477066'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2011/10/free-resources-for-applications.html' title='Free resources for applications'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-3998976578185511511</id><published>2011-10-11T02:57:00.000-07:00</published><updated>2011-10-15T02:01:12.362-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>Monetizing Android applications</title><content type='html'>In a recent talk I've heard by Itay Rokni of &lt;a href="http://www.StartApp.com"&gt;StartApp.com&lt;/a&gt; he listed the various monetizing options Android developer has (to date):&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-weight:bold;"&gt;In app ads&lt;/span&gt; - Ads inside the application: banners, full page, leads generators etc. See for example &lt;a href="http://www.admob.com"&gt;AdMob&lt;/a&gt;.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-weight:bold;"&gt;Paid apps&lt;/span&gt; - The user pay to get the application. Not free options.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-weight:bold;"&gt;Freemium&lt;/span&gt; - Basic application is free, the user can buy the full application or in-app buy more features.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-weight:bold;"&gt;Notification bar ads&lt;/span&gt; - Ads that appear not inside the application, but in the notification bar. For example see &lt;a href="http://www.airpush.com/"&gt;airpush.com&lt;/a&gt;.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-weight:bold;"&gt;Search icon&lt;/span&gt; - Create a search icon after app installation. The provider pay per installation or revenue share. For example see &lt;a href="http://www.StartApp.com"&gt;StartApp.com&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Few notes if you're using In app ads:&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-weight:bold;"&gt;Trust no one&lt;/span&gt; - AdMob is the industry benchmark and every says 'we're better than AdMob'. I found this statement to be almost always wrong.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-weight:bold;"&gt;Use mediation layer&lt;/span&gt; - Use mediation layer such as &lt;a href="http://www.adwhirl.com"&gt;AdWhirl&lt;/a&gt; to control which ad networks you're using. Ad networks go up and down, it's better to control the follow of ads dynamically and not depend on updating the APK in the market.&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-3998976578185511511?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/3998976578185511511/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=3998976578185511511' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/3998976578185511511'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/3998976578185511511'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2011/10/monetizing-android-applications.html' title='Monetizing Android applications'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-4762069744787606592</id><published>2011-09-27T20:31:00.000-07:00</published><updated>2011-09-27T20:37:00.108-07:00</updated><title type='text'>Bulk image resizing/changing format</title><content type='html'>Sometimes there's a need to resize images or just changes their formats. Mostly if the original is on high resolution or improper format for mobile applications. While there are many tools to do this, the best I've found is a plug-in for &lt;a href="http://www.getpaint.net/"&gt;Paint.NET&lt;/a&gt; called &lt;a href="http://pdnbulkupdater.codeplex.com/"&gt;Paint.NET Bulk Image Processor&lt;/a&gt;. It's free, open source and super easy to use.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-4762069744787606592?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/4762069744787606592/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=4762069744787606592' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/4762069744787606592'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/4762069744787606592'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2011/09/bulk-image-resizingchanging-format.html' title='Bulk image resizing/changing format'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-2359837654009815790</id><published>2011-08-10T05:30:00.000-07:00</published><updated>2011-08-10T08:57:45.648-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>innerActive &amp; AdWhirl, take 2</title><content type='html'>Few days ago I've &lt;a href="http://sagistech.blogspot.com/2011/08/using-inneractive-ads-on-android.html"&gt; published a post how to make an AdWhirl adapter for innerActive&lt;/a&gt;. Just after publishing the post I've noticed &lt;a href="http://www.inner-active.com/"&gt;innerActive&lt;/a&gt; released a major version for their Android SDK (3.0.3).&lt;br /&gt;&lt;br /&gt;Here is the new adapter:&lt;br /&gt;&lt;pre style="display: none;" name="code" class="Java"&gt;import android.app.Activity;&lt;br /&gt;import android.util.Log;&lt;br /&gt;import android.view.View;&lt;br /&gt;&lt;br /&gt;import com.adwhirl.AdWhirlLayout;&lt;br /&gt;import com.adwhirl.AdWhirlLayout.AdWhirlInterface;&lt;br /&gt;import com.inneractive.api.ads.InneractiveAdEventsListener;&lt;br /&gt;import com.inneractive.api.ads.InneractiveAdView;&lt;br /&gt;import com.inneractive.api.ads.InneractiveAdComponent;&lt;br /&gt;&lt;br /&gt;public class InnerActiveCustomEvents implements AdWhirlInterface {&lt;br /&gt;	private static final String INNERACTIVE_PUBLISHER_ID = "TBD";&lt;br /&gt;	&lt;br /&gt;	private AdWhirlLayout mAdWhirlLayout;&lt;br /&gt;	private Activity mActivity;&lt;br /&gt;&lt;br /&gt;	public AdWhirlMultipleCustomEvents(AdWhirlLayout mAdWhirlLayout, Activity mActivity) {&lt;br /&gt;		super();&lt;br /&gt;		this.mAdWhirlLayout = mAdWhirlLayout;&lt;br /&gt;		this.mActivity = mActivity;&lt;br /&gt;	}&lt;br /&gt;&lt;br /&gt;	public void adWhirlGeneric() {&lt;br /&gt;	}&lt;br /&gt;	&lt;br /&gt;	public void inneractiveBanner() {&lt;br /&gt;	    // BUGBUG - This fixes the Android OS bug with 'getCacheTotalSize' which causes&lt;br /&gt;		// NullPointerException prior to Android 2.3, see also:&lt;br /&gt;		// http://code.google.com/p/android/issues/detail?id=10789&lt;br /&gt;		android.webkit.WebViewDatabase webViewDB = android.webkit.WebViewDatabase.getInstance(mActivity);&lt;br /&gt;		if (webViewDB == null) {&lt;br /&gt;			mAdWhirlLayout.rollover();&lt;br /&gt;			return;&lt;br /&gt;		}&lt;br /&gt;		&lt;br /&gt;		InneractiveAdView banner = InneractiveAdComponent.getAdView(mAdWhirlLayout.getContext(), INNERACTIVE_PUBLISHER_ID, InneractiveAdComponent.BANNER_AD_TYPE, 0);&lt;br /&gt;&lt;br /&gt;		banner.setListener(new InneractiveAdEventsListener() {			&lt;br /&gt;			@Override&lt;br /&gt;			public void onReceiveAd(InneractiveAdView adView) {&lt;br /&gt;				adView.setVisibility(View.VISIBLE);&lt;br /&gt;				Log.v("InnerActive Banner Listener", "Received Ad.");&lt;br /&gt;&lt;br /&gt;				mAdWhirlLayout.handler.post(new AdWhirlLayout.ViewAdRunnable(mAdWhirlLayout, adView));&lt;br /&gt;				mAdWhirlLayout.adWhirlManager.resetRollover();&lt;br /&gt;				mAdWhirlLayout.rotateThreadedDelayed();   				&lt;br /&gt;			}&lt;br /&gt;			&lt;br /&gt;			@Override&lt;br /&gt;			public void onFailedToReceiveAd(InneractiveAdView adView) {&lt;br /&gt;				Log.v("InnerActive Banner Listener", "Failed To Receive Ad.");&lt;br /&gt;				mAdWhirlLayout.rollover();&lt;br /&gt;			}&lt;br /&gt;			&lt;br /&gt;			@Override&lt;br /&gt;			public void onClickAd(InneractiveAdView adView) {&lt;br /&gt;			}&lt;br /&gt;		});&lt;br /&gt;	}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-2359837654009815790?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/2359837654009815790/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=2359837654009815790' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/2359837654009815790'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/2359837654009815790'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2011/08/inneractive-adwhirl-take-2.html' title='innerActive &amp; AdWhirl, take 2'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-1677496726116567872</id><published>2011-08-04T05:04:00.000-07:00</published><updated>2011-08-11T01:06:56.946-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>Using innerActive ads on Android (with AdWhirl)</title><content type='html'>&lt;span style="font-weight:bold;"&gt;UPDATE&lt;/span&gt;- This post is obsolete, please check &lt;a href="http://sagistech.blogspot.com/2011/08/inneractive-adwhirl-take-2.html"&gt;this update post&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I've decided to try using multiple ad agencies, and one of them was &lt;a href="http://www.inner-active.com/"&gt;innerActive&lt;/a&gt;. I had 2 problems with innerActive: (1) They don't supply an AdWhirl adapter, (2) There's seem to be a bug in their SDK as of version 2.0625&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Problem A:&lt;/span&gt; The bug&lt;br /&gt;The function &lt;span style="font-weight:bold;"&gt;onWindowFocusChanged &lt;/span&gt;which runs on the UI thread calls the function &lt;span style="font-weight: bold;"&gt;setRefreshInterval &lt;/span&gt;which has the keyword synchronized which means it waits for a lock. The lock is taken by the ad request thread. If the &lt;span style="font-weight: bold;"&gt;onWindowsFocusChanged &lt;/span&gt;will be called during an ad request there will be an ANR exception due to a delay on the UI thread.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Solution&lt;/span&gt;:&lt;br /&gt;I wrote a wrapper that seems to fix this issue.&lt;br /&gt;&lt;pre style="display: none;" name="code" class="Java"&gt;import java.util.concurrent.locks.ReentrantLock;&lt;br /&gt;&lt;br /&gt;import android.content.Context;&lt;br /&gt;import android.util.AttributeSet;&lt;br /&gt;&lt;br /&gt;import com.innerActive.ads.InnerActiveAdView;&lt;br /&gt;&lt;br /&gt;public class InnerActiveAdViewFixed extends InnerActiveAdView {&lt;br /&gt;private ReentrantLock mLock = new ReentrantLock();&lt;br /&gt;&lt;br /&gt;public InnerActiveAdViewFixed(Context context) {&lt;br /&gt; super(context);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public InnerActiveAdViewFixed(Context context, AttributeSet attrs) {&lt;br /&gt; super(context, attrs);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public InnerActiveAdViewFixed(Context context, AttributeSet attrs, int defStyle) {&lt;br /&gt; super(context, attrs, defStyle);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// Patch&lt;br /&gt;@Override&lt;br /&gt;public void onWindowFocusChanged(boolean hasWindowFocus) {&lt;br /&gt; if (mLock.tryLock() == true) {&lt;br /&gt;  try {&lt;br /&gt;   super.onWindowFocusChanged(hasWindowFocus);&lt;br /&gt;  } finally {&lt;br /&gt;   mLock.unlock();&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;@Override&lt;br /&gt;public byte start() {&lt;br /&gt; mLock.lock();&lt;br /&gt; try {&lt;br /&gt;  return super.start();&lt;br /&gt; } finally {&lt;br /&gt;  mLock.unlock();&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Problem B&lt;/span&gt;: No AdWhirl adapter&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Solution&lt;/span&gt;:&lt;br /&gt;I wrote a custom AdWhirl adapter for innerActive.&lt;br /&gt;&lt;pre style="display: none;" name="code" class="Java"&gt;import android.util.Log;&lt;br /&gt;import android.view.View;&lt;br /&gt;&lt;br /&gt;import com.adwhirl.AdWhirlLayout;&lt;br /&gt;import com.adwhirl.AdWhirlLayout.AdWhirlInterface;&lt;br /&gt;import com.innerActive.ads.InnerActiveAdView;&lt;br /&gt;&lt;br /&gt;public class InnerActiveCustomEvents implements AdWhirlInterface{&lt;br /&gt;private AdWhirlLayout mAdWhirlLayout;&lt;br /&gt;&lt;br /&gt;public InnerActiveCustomEvents(AdWhirlLayout adWhirlLayout) {&lt;br /&gt; super();&lt;br /&gt; this.mAdWhirlLayout = adWhirlLayout;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;@Override&lt;br /&gt;public void adWhirlGeneric() {&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void inneractiveBanner() {&lt;br /&gt; final InnerActiveAdViewFixed banner = new InnerActiveAdViewFixed(mAdWhirlLayout.getContext());&lt;br /&gt; banner.setVisibility(View.VISIBLE);&lt;br /&gt; banner.setRefreshInterval(0);&lt;br /&gt; banner.setScrollContainer(true);&lt;br /&gt; banner.setBgColor(0xFF000000);&lt;br /&gt; banner.setTxtColor(0xFFFFFFFF);&lt;br /&gt;&lt;br /&gt; banner.setListener(new InnerActiveAdView.AdEventsListener() {&lt;br /&gt; &lt;br /&gt;  @Override&lt;br /&gt;  public void onReceiveAd(InnerActiveAdView arg0) {&lt;br /&gt;   banner.setVisibility(View.VISIBLE);&lt;br /&gt;   Log.v("InnerActive Banner Listener", "Received Ad.");&lt;br /&gt;&lt;br /&gt;   mAdWhirlLayout.handler.post(new AdWhirlLayout.ViewAdRunnable(mAdWhirlLayout, banner)); &lt;br /&gt;&lt;br /&gt;   mAdWhirlLayout.adWhirlManager.resetRollover();&lt;br /&gt;   mAdWhirlLayout.rotateThreadedDelayed();   &lt;br /&gt;  }&lt;br /&gt; &lt;br /&gt;  @Override&lt;br /&gt;  public void onFailedToReceiveAd(InnerActiveAdView arg0) {&lt;br /&gt;   Log.v("InnerActive Banner Listener", "Failed To Receive Ad.");   &lt;br /&gt;   mAdWhirlLayout.rollover();   &lt;br /&gt;  }&lt;br /&gt; });   &lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I'm not going to write a step-by-step guide, but here is the key notes:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Integrate innerActive ads &amp;amp; make sure everything works.&lt;/li&gt;&lt;li&gt;Remove the ad view from the layout &amp;amp; the appropriate code the the ad view.&lt;/li&gt;&lt;li&gt;Integrate AdWhirl:&lt;br /&gt;3.1. Create an application in AdWhirl web site &amp;amp; get SDK Key&lt;br /&gt;3.2. Add AdWhirl JAR&lt;br /&gt;3.3. Add the AdWhirl SDK Key to the AndroidManifest.xml&lt;br /&gt;3.4. Add the com.adwhirl.AdWhirlLayout to the application layout&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Add the following code (in the onCreate functions)&lt;br /&gt;&lt;span style="font-style: italic;"&gt;AdWhirlLayout adWhirlLayout = (AdWhirlLayout)findViewById(R.id.adwhirl_layout);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; adWhirlLayout.setAdWhirlInterface(new InnerActiveCustomEvents(adWhirlLayout));&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Add innerActive to AdWhirl as custom event - name: innerActive, function name: inneractiveBanner&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;Notes - &lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;If you're using multiple custom events, they should all be in the same function, so copy only the inneractiveBanner function.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;If you're using ProGaurd  make sure you read my previous post &amp;amp; also add the custom events adapter &amp;amp; innerActive ad views to the ProGuard exceptions list.&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-1677496726116567872?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/1677496726116567872/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=1677496726116567872' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/1677496726116567872'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/1677496726116567872'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2011/08/using-inneractive-ads-on-android.html' title='Using innerActive ads on Android (with AdWhirl)'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-4086225459081307173</id><published>2011-07-15T23:56:00.000-07:00</published><updated>2011-08-05T09:07:05.042-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>ProGuard &amp; AdWhirl</title><content type='html'>Compilation of an application with AdWhirl &amp;amp; ProGuard throws many warning, for all those AdWhirl adapter libraries not compiled with the application. I found multiple solutions online, some saying just ignore all the warning ProGuard throws:&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;-ignorewarnings&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Don't use it - there's a better solution, ignoring only the problematic parts:&lt;span style="font-style: italic;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;-dontwarn com.adwhirl.adapters.*&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Here's the best solution for Proguard &amp;amp; AdWhirl as far as I know:&lt;br /&gt;&lt;br /&gt;-dontwarn com.adwhirl.adapters.*&lt;br /&gt;&lt;br /&gt;-keep class com.adwhirl.** { *;}&lt;br /&gt;-keep public class com.adwhirl.adapters.AdMobAdapter {*;}&lt;br /&gt;-keep public class com.adwhirl.adapters.ZestAdzAdapter {*;}&lt;br /&gt;-keep public class com.adwhirl.adapters.MillennialAdapter {*;}&lt;br /&gt;-keep public class com.admob.android.ads.** {*;}&lt;br /&gt;-keep public class com.millennialmedia.android.** {*;}&lt;br /&gt;-keep public class com.zestadz.android.** {*;}&lt;br /&gt;&lt;br /&gt;-keep public class * extends Android.view.View {&lt;br /&gt;    public &lt;init&gt;(android.content.Context);&lt;br /&gt;    public &lt;init&gt;(android.content.Context, android.util.AttributeSet);&lt;br /&gt;    public &lt;init&gt;(android.content.Context, android.util.AttributeSet, int);&lt;br /&gt;    public void set*(...);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;-keepclassmembers class *{&lt;br /&gt;    public void *(android.view.View);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/init&gt;&lt;/init&gt;&lt;/init&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-4086225459081307173?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/4086225459081307173/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=4086225459081307173' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/4086225459081307173'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/4086225459081307173'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2011/07/proguard-adwhirl.html' title='ProGuard &amp; AdWhirl'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-9063132754243122249</id><published>2011-07-10T04:13:00.000-07:00</published><updated>2011-12-25T05:09:57.259-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>Error conversion to Dalvik format failed with error 1</title><content type='html'>&lt;span style="font-weight: bold;"&gt;UPDATE:&lt;/span&gt; &lt;span style="font-weight: bold;"&gt;This issue still exists as of SDK Tools 15. You should use Solution 2.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;There is a bug in the latest Android SDK Tools (revisions 12, 13, 14 &amp;amp; 15) which cause the following error:&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Error conversion to Dalvik format failed with error 1&lt;/span&gt;&lt;br /&gt;when you try to export your Android application &amp;amp; got Proguard enabled.&lt;br /&gt;&lt;br /&gt;Google will probably fix it within few days, until then DO NOT UPDATE to Android SDK Tools revision 12. &lt;a href="http://code.google.com/p/android/issues/detail?id=18359"&gt;Someone already opened a bug on this issue&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Solution 1 - Restore SDK Tools v11 (ugly but it works):&lt;/span&gt;&lt;br /&gt;If you did upgrade, the instructions how to install Android SDK Tools v11 on top can be found &lt;a href="http://stackoverflow.com/questions/6605971/android-sdk-tools-revision-12-has-problem-with-proguard-error-conversion-to-d"&gt;here&lt;/a&gt;. I did something similar which I think is safer &amp;amp; easy to undo:&lt;br /&gt;1. Download Android SDK Tools v11 installer from here: &lt;a href="http://dl.google.com/android/installer_r11-windows.exe" rel="nofollow"&gt;http://dl.google.com/android/installer_r11-windows.exe&lt;/a&gt;&lt;br /&gt;2. Rename the existing Android SDK\Tools folder to Tools-v12&lt;br /&gt;3. Open the installer using 7zip,  go to folder $_OUTDIR, and copy the folder 'Tools' the the position under Android SDK folder.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Solution 2 - Upgrade to Proguard 4.7 &lt;/span&gt;&lt;span style="font-weight: bold;"&gt;(needs to be reapplied after every SDK Tools upgrade)&lt;/span&gt;:&lt;br /&gt;Manually update Proguard to version 4.7. You'll have to do it again after each update of the SDK Tools.&lt;br /&gt;1. Download Proguard 4.7 (zip): &lt;a href="http://sourceforge.net/projects/proguard/files/proguard/4.6/"&gt;http://sourceforge.net/projects/proguard/files/proguard/4.7/&lt;/a&gt;&lt;br /&gt;2. Extract the folders "bin" &amp;amp; "lib" from the zip on top the existing Proguard installation in the SDK Tools Proguard folders "bin" &amp;amp; "lib", should be around here (Win x64):&lt;br /&gt;C:\Program Files (x86)\Google\Android SDK\tools\proguard&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-9063132754243122249?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/9063132754243122249/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=9063132754243122249' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/9063132754243122249'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/9063132754243122249'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2011/07/error-conversion-to-dalvik-format.html' title='Error conversion to Dalvik format failed with error 1'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-7555394383702126860</id><published>2011-06-20T07:59:00.000-07:00</published><updated>2011-12-25T01:05:22.130-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>Android SDK Error: Unable to resolve target 'Google Inc.:Google APIs:X'</title><content type='html'>I the past I wrote a &lt;a href="http://sagistech.blogspot.com/2010/05/android-sdk-error-unable-to-resolve.html"&gt;post on a similar issue&lt;/a&gt;, but here goes -&lt;br /&gt;There are few variants of this error message:&lt;br /&gt;Unable to resolve target 'Google Inc.:Google APIs:1'&lt;br /&gt;Unable to resolve target 'Google Inc.:Google APIs:2'&lt;br /&gt;Unable to resolve target 'Google Inc.:Google APIs:3'&lt;br /&gt;Unable to resolve target 'Google Inc.:Google APIs:4'&lt;br /&gt;Unable to resolve target 'Google Inc.:Google APIs:5'&lt;br /&gt;Unable to resolve target 'Google Inc.:Google APIs:6'&lt;br /&gt;Unable to resolve target 'Google Inc.:Google APIs:7'&lt;br /&gt;Unable to resolve target 'Google Inc.:Google APIs:8'&lt;br /&gt;Unable to resolve target 'Google Inc.:Google APIs:9'&lt;br /&gt;Unable to resolve target 'Google Inc.:Google APIs:10'&lt;br /&gt;Unable to resolve target 'Google Inc.:Google APIs:11'&lt;br /&gt;Unable to resolve target 'Google Inc.:Google APIs:12'&lt;br /&gt;Unable to resolve target 'Google Inc.:Google APIs:13'&lt;br /&gt;Unable to resolve target 'Google Inc.:Google APIs:14'&lt;br /&gt;Unable to resolve target 'Google Inc.:Google APIs:15'&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Reason&lt;/span&gt;: Could not find the proper Google APIs Android SDK version. If the android SDK is installed correctly the problem is that the platform SDK requested by the "AndroidManifest.xml" android:minSdkVersion is not installed. For example:&lt;br /&gt;'Google Inc.:Google APIs:1' - Upgrade the requested SDK&lt;br /&gt;'Google Inc.:Google APIs:2' - Upgrade the requested SDK&lt;br /&gt;'Google Inc.:Google APIs:3' - install Google APIs SDK Android 1.5&lt;br /&gt;'Google Inc.:Google APIs:4' - install Google APIs SDK Android 1.6&lt;br /&gt;'Google Inc.:Google APIs:5' - install Google APIs SDK Android 2.0&lt;br /&gt;'Google Inc.:Google APIs:6' - install Google APIs SDK Android 2.0.1&lt;br /&gt;'Google Inc.:Google APIs:7' - install Google APIs SDK Android 2.1&lt;br /&gt;'Google Inc.:Google APIs:8' - install Google APIs SDK Android 2.2&lt;br /&gt;'Google Inc.:Google APIs:9' - install Google APIs SDK Android 2.3&lt;br /&gt;'Google Inc.:Google APIs:10' - install Google APIs SDK Android 2.3.3&lt;br /&gt;'Google Inc.:Google APIs:11' - install Google APIs SDK Android 3.0&lt;br /&gt;'Google Inc.:Google APIs:12' - install Google APIs SDK Android 3.1&lt;br /&gt;'Google Inc.:Google APIs:13' - install Google APIs SDK Android 3.2&lt;br /&gt;'Google Inc.:Google APIs:14' - install Google APIs SDK Android 4.0&lt;br /&gt;'Google Inc.:Google APIs:14' - install Google APIs SDK Android 4.0.3&lt;br /&gt;&lt;br /&gt;You can do this using the Android SDK Setup utility:&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Option 1:&lt;/span&gt; Eclipse -&lt;br /&gt;"Windows" -&amp;gt; "Android SDK and AVD Manager" -&amp;gt; "Available packages" -&amp;gt; "Third Party" -&amp;gt; "Google"&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Option 2:&lt;/span&gt; Command line - start the "SDK Setup" here (x86):&lt;br /&gt;C:\Program Files\Google\Android SDK\SDK Setup.exe&lt;br /&gt;or here (x64)&lt;br /&gt;C:\Program Files (x86)\Google\Android SDK\SDK Setup.exe&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-7555394383702126860?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/7555394383702126860/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=7555394383702126860' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/7555394383702126860'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/7555394383702126860'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2011/06/android-sdk-error-unable-to-resolve.html' title='Android SDK Error: Unable to resolve target &apos;Google Inc.:Google APIs:X&apos;'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-3069085332102519809</id><published>2011-06-01T00:10:00.000-07:00</published><updated>2011-06-03T01:16:42.726-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>getCacheTotalSize causes NullPointerException</title><content type='html'>After starting to use a new AdMob SDK I noticed the following exception in the Android Market Developer Console:http://www.blogger.com/img/blank.gif&lt;br /&gt;&lt;span style="font-style:italic;"&gt;java.lang.NullPointerException&lt;br /&gt;at android.webkit.WebViewDatabase.getCacheTotalSize(WebViewDatabase.java:735)&lt;br /&gt;at android.webkit.CacheManager.trimCacheIfNeeded(CacheManager.java:557)&lt;br /&gt;at android.webkit.WebViewWorker.handleMessage(WebViewWorker.java:195)&lt;br /&gt;at android.os.Handler.dispatchMessage(Handler.java:99)&lt;br /&gt;at android.os.Looper.loop(Looper.java:123)&lt;br /&gt;at android.os.HandlerThread.run(HandlerThread.java:60)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I solved it using a &lt;a href="http://code.google.com/p/android/issues/detail?id=10789"&gt;suggestion I found online&lt;/a&gt;. You can use other ways to disable the ads, depending which SDK you use:&lt;br /&gt;&lt;pre style="display: none;" name="code" class="Java"&gt;&lt;br /&gt;WebViewDatabase webViewDB = WebViewDatabase.getInstance(this);&lt;br /&gt;if (webViewDB == null) {&lt;br /&gt;  View adView = findViewById(R.id.adView);&lt;br /&gt;  if (adView != null)&lt;br /&gt;    adView.setVisibility(View.GONE);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Anyhow, as far as I remember this issue was fixed in the Android OS 2.3+, so until this OS version will catch you have to disable the ads to people with this problem.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-3069085332102519809?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/3069085332102519809/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=3069085332102519809' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/3069085332102519809'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/3069085332102519809'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2011/06/getcachetotalsize-causes.html' title='getCacheTotalSize causes NullPointerException'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-5285545205801261299</id><published>2011-05-24T17:54:00.000-07:00</published><updated>2011-05-24T18:02:39.451-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows Vista'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows 7'/><category scheme='http://www.blogger.com/atom/ns#' term='RDP'/><title type='text'>Improving Remote Desktop speed on Vista/Win7</title><content type='html'>A fellow kept complaining that his Remote Desktop (mstsc) connection to the office is super slow. I told him that I had the same problem since I moved from Windows XP to Windows 7 &amp;amp; he found the following solution:&lt;br /&gt;&lt;br /&gt;Run the following command line:&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;netsh interface tcp set global autotuninglevel=disabled&lt;/span&gt;&lt;br /&gt;to undo it:&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;netsh interface tcp set global autotuninglevel=normal&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;For full details &lt;a href="http://blog.tmcnet.com/blog/tom-keating/microsoft/remote-desktop-slow-problem-solved.asp"&gt;check this post&lt;/a&gt;. It's not optimal, but it works &amp;amp; I didn't notice any problem since.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-5285545205801261299?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/5285545205801261299/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=5285545205801261299' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/5285545205801261299'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/5285545205801261299'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2011/05/improving-remote-desktop-speed-on.html' title='Improving Remote Desktop speed on Vista/Win7'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-8149613402405941491</id><published>2011-05-13T21:21:00.000-07:00</published><updated>2011-08-04T05:51:46.605-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>Memory debugging and Android application</title><content type='html'>&lt;font style="font-weight: bold;" size="4"&gt;Using DDMS&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;*. Compile &amp;amp; run the application on an enumlator in debug (e.g. Manifest.xml, android:debuggable="true").&lt;br /&gt;*. open DDMS&lt;br /&gt;&lt;br /&gt;Checking the heap status:&lt;br /&gt;*. Select your application, click on 'Show heap updates' on the toolbar.&lt;br /&gt;*. Play around with your application and check the results.&lt;br /&gt;&lt;br /&gt;Checking the allocations:&lt;br /&gt;*. Select the allocation tracker tab, click on 'Start Tracking'&lt;br /&gt;*. Press 'Get Allocations' when you want to check the allocations.&lt;br /&gt;&lt;br /&gt;Note: do not use both heap status &amp;amp; allocations - the heap monitoring will cause a lot of allocations.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-8149613402405941491?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/8149613402405941491/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=8149613402405941491' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/8149613402405941491'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/8149613402405941491'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2011/05/memory-debugging-and-android.html' title='Memory debugging and Android application'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-106042930876658656</id><published>2011-05-03T04:22:00.000-07:00</published><updated>2011-05-03T04:34:46.238-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>Display ListPreference value in the preferences screen</title><content type='html'>One missing feature in the preferences activity in Android applications is to display the selected value of a ListPreference. By default, to view the selected value of a ListPreference you must click the preference and see what's selected in the combo box.&lt;br /&gt;&lt;br /&gt;Here's an example how to create a preferences activity which displays the selected value of any number of ListPreferences in the activity.&lt;br /&gt;&lt;br /&gt;&lt;pre style="display: none;" name="code" class="Java"&gt;&lt;br /&gt;public class MyPreferenceActivity extends PreferenceActivity &lt;br /&gt;  implements SharedPreferences.OnSharedPreferenceChangeListener {&lt;br /&gt;    &lt;br /&gt;    private ArrayList&amp;lt;ListPreference&amp;gt; mListPreferences;&lt;br /&gt;    private String[] mListPreferencesKeys = new String[] {&lt;br /&gt;     "prefKey1", // The 'android:key' value of the ListPreference&lt;br /&gt;     "prefKey2"  // The 'android:key' value of the ListPreference&lt;br /&gt;     ....&lt;br /&gt;     ....&lt;br /&gt;     ....&lt;br /&gt;    };&lt;br /&gt;&lt;br /&gt;    @Override&lt;br /&gt;    protected void onCreate(Bundle savedInstanceState) {&lt;br /&gt;        super.onCreate(savedInstanceState);&lt;br /&gt;&lt;br /&gt;        addPreferencesFromResource(R.xml.preferences);&lt;br /&gt;        &lt;br /&gt;        mListPreferences = new ArrayList&amp;lt;ListPreference&amp;gt;();&lt;br /&gt;        SharedPreferences sharedPrefs = getPreferenceManager().getSharedPreferences();&lt;br /&gt;        sharedPrefs.registerOnSharedPreferenceChangeListener(this);&lt;br /&gt;        for (String prefKey : mListPreferencesKeys) {&lt;br /&gt;         ListPreference pref = (ListPreference)getPreferenceManager().findPreference(prefKey);&lt;br /&gt;         mListPreferences.add(pref);&lt;br /&gt;         onSharedPreferenceChanged(sharedPrefs, prefKey);&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    @Override&lt;br /&gt; public void onSharedPreferenceChanged(SharedPreferences pref, String prefKey) {&lt;br /&gt;     for (ListPreference listPref : mListPreferences) {&lt;br /&gt;      if (listPref.getKey().equals(prefKey))&lt;br /&gt;       listPref.setSummary(listPref.getEntry());&lt;br /&gt;     }&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Notes:&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;This code will update the values if the user selects a new value&lt;/li&gt;&lt;br /&gt;&lt;li&gt;If you're defining preferences keys in the strings.xml file, make the mListPreferencesKeys list an integer list, and get the string at run time using 'getString'&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-106042930876658656?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/106042930876658656/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=106042930876658656' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/106042930876658656'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/106042930876658656'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2011/05/display-listpreference-value-in.html' title='Display ListPreference value in the preferences screen'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-3749013946436694959</id><published>2011-04-20T23:07:00.000-07:00</published><updated>2011-04-20T23:13:52.276-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>Problem uninstalling android application</title><content type='html'>From time to time I'm facing an application that refuses to uninstall using the market. Here is the procedure I'm using (if any step works - there's no need to continue):&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Uninstall using the Android Market application&lt;/li&gt;&lt;li&gt;Uninstall using the settings menu from the home screen: 'Menu' -&amp;gt;  'Settings' -&amp;gt; 'Applications' -&amp;gt; 'Manage Applications' -&amp;gt; select  the application &amp;amp; uninstall.&lt;/li&gt;&lt;li&gt;Uninstall  using a 3rd party tool, for example: ASTRO file manager (in  the application click 'Menu' -&amp;gt; 'Tools' -&amp;gt; 'Application  Manager/Backup' -&amp;gt; long click the application -&amp;gt; 'Uninstall')&lt;/li&gt;&lt;li&gt;Reboot the phone and try steps 2 &amp;amp; 3 again.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-3749013946436694959?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/3749013946436694959/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=3749013946436694959' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/3749013946436694959'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/3749013946436694959'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2011/04/problem-uninstalling-android.html' title='Problem uninstalling android application'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-1067421813471898100</id><published>2011-04-06T23:16:00.000-07:00</published><updated>2011-04-06T23:27:39.131-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>Performing research on the Android Market</title><content type='html'>There are various out there that can help perform a research on Android applications.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Android Market application&lt;/li&gt;&lt;li&gt;&lt;a href="http://market.android.com/"&gt;Android Market web site&lt;/a&gt; - Has difference number of downloads scale. While the highest value in the Market application is &amp;gt;250K, in the web site there are different values: 50K-100K, 100K-500K, 500K-1M, 1M-5M, 5M-10M, 10M-50M &lt;/li&gt;&lt;li&gt;&lt;a href="http://www.androlib.com/"&gt;AndroLib &lt;/a&gt;- Has application rating (stars) history&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.androidzoom.com/"&gt;AndroidZoom &lt;/a&gt;- Has application history: release dates &amp;amp; events (when the application passed a download group (e.g. 10K-50K, 50K-250K).&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.androidapptracker.com/"&gt;Android App Tracker&lt;/a&gt; - Has application market ranking history.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;If you have more interesting sites, please share.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-1067421813471898100?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/1067421813471898100/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=1067421813471898100' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/1067421813471898100'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/1067421813471898100'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2011/04/performing-research-on-android-market.html' title='Performing research on the Android Market'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-7561719310086548386</id><published>2011-04-02T00:04:00.000-07:00</published><updated>2011-04-02T00:21:28.041-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>onActivityResult not called in time</title><content type='html'>I wrote a small program that needed to use a preference screen. After the preferences were updated the application needs to update. To do that I used &lt;span style="font-weight:bold;"&gt;startActivityForResult&lt;/span&gt; to start the preferences screen, and &lt;span style="font-weight: bold;"&gt;onActivityResult &lt;/span&gt;to update the application.&lt;br /&gt;&lt;br /&gt;Problem: &lt;span style="font-weight: bold;"&gt;onActivityResult &lt;/span&gt;wasn't called in time. Using Toast I've noticed it was called BEFORE the preferences screen opens.&lt;br /&gt;&lt;br /&gt;Solution: In my case - the application was defined as &lt;span style="font-weight: bold;"&gt;launchMode=singleInstance&lt;/span&gt;, removing this put things back to place.&lt;br /&gt;&lt;br /&gt;Note: This is true for Android 2.3.3. I didn't check the documentation to see if it's a normal behavior or an issue.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-7561719310086548386?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/7561719310086548386/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=7561719310086548386' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/7561719310086548386'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/7561719310086548386'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2011/04/onactivityresult-not-called-in-time.html' title='onActivityResult not called in time'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-2569249716873819676</id><published>2011-02-13T05:35:00.000-08:00</published><updated>2011-02-13T05:42:39.568-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>Problem uninstalling Android SDK samples</title><content type='html'>This is the second time it happens to me so I've decided to write a post about it.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Problem&lt;/span&gt;: in the "Android SDK and AVD Manager"/"SDK Setup" selecting "Samples for SDK ..." package and clicking 'delete' deletes the content of the samples folder, but does not remove the entry from the "Android SDK and AVD Manager".&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Solution&lt;/span&gt;: &lt;br /&gt;1. Close the "Android SDK and AVD Manager"/"SDK Setup" (close the eclipse if it's running).&lt;br /&gt;2. Delete the SDK specific samples folder. If the folder is locked kill any 'java.exe' process running (or reboot).&lt;br /&gt;3. Restart the "Android SDK and AVD Manager"/"SDK Setup"&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-2569249716873819676?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/2569249716873819676/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=2569249716873819676' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/2569249716873819676'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/2569249716873819676'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2011/02/problem-uninstalling-android-sdk.html' title='Problem uninstalling Android SDK samples'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-8221339516471072767</id><published>2011-02-13T04:18:00.000-08:00</published><updated>2011-02-13T04:23:58.517-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Distance on earth calculation in SQL</title><content type='html'>Here's how to create an SQL function to calculate the distance (in KM) between to points on earth. This is an estimation since the distance is calculated as if the earth was round, but it's close enough for most purposes:&lt;br /&gt;&lt;br /&gt;&lt;pre  style="display: none;" name="code" class="sql"&gt;&lt;br /&gt;CREATE FUNCTION dist (@latFrom float, @longFrom float,@latTo float, @longTo float)&lt;br /&gt;        RETURNS float&lt;br /&gt;AS&lt;br /&gt;BEGIN&lt;br /&gt;        DECLARE @Distance float&lt;br /&gt;        SET @Distance =&lt;br /&gt;                (SIN(RADIANS(@latFrom)) *&lt;br /&gt;                SIN(RADIANS(@latTo)) +&lt;br /&gt;                COS(RADIANS(@latFrom)) *&lt;br /&gt;                COS(RADIANS(@latTo)) *&lt;br /&gt;               &lt;br /&gt;                COS(RADIANS(@longFrom - @longTo)))&lt;br /&gt; &lt;br /&gt;        SET @Distance = (DEGREES(ACOS(@Distance))) * 69.09 * 1.609344&lt;br /&gt;       &lt;br /&gt;        RETURN(@Distance)&lt;br /&gt;END&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-8221339516471072767?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/8221339516471072767/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=8221339516471072767' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/8221339516471072767'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/8221339516471072767'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2011/02/distance-on-earth-calculation-in-sql.html' title='Distance on earth calculation in SQL'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-7952571537359982507</id><published>2011-01-21T08:53:00.000-08:00</published><updated>2011-01-21T08:58:23.081-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>TimePicker &amp; DatePicker with keyboard edit problem</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Problem:&lt;/span&gt; When using the TimePicker &amp;amp; DatePicker objects in an AlertDialog (and probably anywhere else), the time &amp;amp; date seem to not to update when the user is editing the value using a keyboard (or soft keyboard).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Solution:&lt;/span&gt; Before calling the functions to get the date &amp;amp; time from the objects call TimePicker or DatePicker &lt;span style="font-weight: bold;"&gt;clearFocus()&lt;/span&gt; method.&lt;br /&gt;&lt;br /&gt;I found few threads talking about this problem without a solution. I found the solution when I looked at the TimePickerDialog source code which did not suffer from this problem.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-7952571537359982507?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/7952571537359982507/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=7952571537359982507' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/7952571537359982507'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/7952571537359982507'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2011/01/timepicker-datepicker-with-keyboard.html' title='TimePicker &amp; DatePicker with keyboard edit problem'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-1814107766109106865</id><published>2011-01-21T03:14:00.001-08:00</published><updated>2011-01-24T09:59:37.018-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQLite'/><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>Android SQLite Alter Table</title><content type='html'>When upgrading SQLite database sometimes you need to change the tables scheme. The problem is that &lt;a href="http://sqlite.org/lang_altertable.html"&gt;SQLite Alter Table SQL format&lt;/a&gt; does not support all the options you might need (specifically - dropping columns, changing column types, renaming columns).&lt;br /&gt;&lt;br /&gt;One way around this issue is to create a new table &amp;amp; copy the data to the new table. There are few options here, but the best way (I think) is as follows:&lt;br /&gt;1. Create new table in the new format.&lt;br /&gt;2. Copy the data.&lt;br /&gt;3. Drop the original table&lt;br /&gt;4. Rename the new table&lt;br /&gt;&lt;br /&gt;For example:&lt;br /&gt;&lt;pre&gt;BEGIN TRANSACTION;&lt;br /&gt;CREATE TABLE t_new(a,b);&lt;br /&gt;INSERT INTO t_new SELECT a,b FROM t;&lt;br /&gt;DROP TABLE t;&lt;br /&gt;ALTER TABLE t_new RENAME TO t;&lt;br /&gt;COMMIT;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;IMPORTANT:&lt;/span&gt; As far as I know 'execSQL' of 'SQLiteDatabase' will NOT run multiple commands. You should run each SQL command in a separate 'execSQL' call (the transaction can be handled from the SQLiteDatabase, not need for explicit SQL commands).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-1814107766109106865?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/1814107766109106865/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=1814107766109106865' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/1814107766109106865'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/1814107766109106865'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2011/01/android-sqlite-alter-table.html' title='Android SQLite Alter Table'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-7515561057145612426</id><published>2011-01-20T04:12:00.000-08:00</published><updated>2011-05-29T04:03:08.634-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>Build.VERSION.SDK_INT on Android 1.5</title><content type='html'>It won't be long before all Android 1.5 devices will disappear, until then it's a good idea to support them. The problem is the 'Build.VERSION.SDK_INT' was introduced only on Android 1.6, and before that there were only string values.&lt;br /&gt;&lt;br /&gt;Here's a work-around this issue - it will return the correct value for Android 1.5+:&lt;br /&gt;&lt;pre style="display: none;" name="code" class="Java"&gt;public static int getSdkInt() {&lt;br /&gt;   if (Build.VERSION.RELEASE.startsWith("1.5"))&lt;br /&gt;       return 3;&lt;br /&gt; &lt;br /&gt;   try {&lt;br /&gt;       return HelperInternal.getSdkIntInternal();&lt;br /&gt;   } catch (VerifyError e) {&lt;br /&gt;       return 3;&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private static class HelperInternal {&lt;br /&gt;   private static int getSdkIntInternal() {&lt;br /&gt;       return Build.VERSION.SDK_INT;              &lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Note: the internal class is required since the Java virtual machine checks if a class is valid before loading it. In our case, a java VM running Android 1.5 will not be able to load Build.VERSION.SDK_INT and will crash.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;UPDATE&lt;/span&gt;: Added VerifyError catch to prevent exceptions on some weird Android 1.5 devices.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-7515561057145612426?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/7515561057145612426/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=7515561057145612426' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/7515561057145612426'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/7515561057145612426'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2011/01/buildversionsdkint-on-android-15.html' title='Build.VERSION.SDK_INT on Android 1.5'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-6591346947336987817</id><published>2010-12-24T00:28:00.000-08:00</published><updated>2010-12-24T00:38:07.763-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>Finding Android screen orientation</title><content type='html'>There are multiple way to get Android screen orientation (landscape/portrait), however some of them are problematic:&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;this.getWindowManager().getDefaultDisplay().getOrientation()&lt;/span&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;Is depricated&lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;this.getWindowManager().getDefaultDisplay().getRotation()&lt;/span&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;Works only from Android 2.2&lt;br /&gt;&lt;br /&gt;I Found this to be the best resource until now, since it's exists since API 1 &amp;amp; it's not deprecated, yet:&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;this.getResources().getConfiguration().orientation&lt;/span&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Compare it with:&lt;br /&gt;Configuration.ORIENTATION_LANDSCAPE&lt;br /&gt;Configuration.ORIENTATION_PORTRAIT&lt;br /&gt;Configuration.ORIENTATION_SQUARE&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-6591346947336987817?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/6591346947336987817/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=6591346947336987817' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/6591346947336987817'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/6591346947336987817'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2010/12/finding-android-screen-orientation.html' title='Finding Android screen orientation'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-3925065126638657197</id><published>2010-12-14T10:48:00.000-08:00</published><updated>2010-12-14T10:54:01.247-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>Spinner.setSelection doesn't work correctly</title><content type='html'>&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;Problem:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;There are a lot of posts around regarding a problem with &lt;span style="font-style: italic;"&gt;Spinner.setSelection(i)&lt;/span&gt; function. I encountered this issue when I've tried to replace the adapter in the &lt;span style="font-style: italic;"&gt;Spinner &lt;/span&gt;and select a new item. The &lt;span style="font-style: italic;"&gt;setSelection &lt;/span&gt;function seems like it's not working, but when I click the spinner the selected item was the correct one.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;Solution:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Use &lt;span style="font-style: italic;"&gt;Spinner.setSelection(i, true)&lt;/span&gt; instead&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-3925065126638657197?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/3925065126638657197/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=3925065126638657197' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/3925065126638657197'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/3925065126638657197'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2010/12/spinnersetselection-doesnt-work.html' title='Spinner.setSelection doesn&apos;t work correctly'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-1803152780607921304</id><published>2010-12-08T00:07:00.000-08:00</published><updated>2010-12-08T00:16:31.965-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>Multiple substitutions specified in non-positional format</title><content type='html'>Since Android SDK 2.3 there's a new error:&lt;br /&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;error: Multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Description:&lt;br /&gt;This error indicates you're using a string resource with %s in it. See how to use it &lt;a href="http://developer.android.com/guide/topics/resources/string-resource.html#FormattingAndStyling"&gt;here&lt;/a&gt; under 'Formatting strings'. In general, instead of:&lt;br /&gt;&lt;pre class="prettyprint"&gt;&lt;span class="pln"&gt;&lt;string&gt;&lt;span class="tag"&gt;&lt;/span&gt;&lt;span class="pln"&gt;Hello, %s! You have %d new messages.&lt;/span&gt;&lt;/string&gt;&lt;/span&gt;&lt;/pre&gt;Should be:&lt;br /&gt;&lt;pre class="prettyprint"&gt;&lt;span class="atn"&gt;&lt;string&gt;&lt;span class="pln"&gt;Hello, %1$s! You have %2$d new messages.&lt;/span&gt;&lt;/string&gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-1803152780607921304?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/1803152780607921304/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=1803152780607921304' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/1803152780607921304'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/1803152780607921304'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2010/12/multiple-substitutions-specified-in-non.html' title='Multiple substitutions specified in non-positional format'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-8910898934182994861</id><published>2010-12-07T23:01:00.000-08:00</published><updated>2010-12-14T10:58:51.872-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>Can not find adb.exe after Android SDK update</title><content type='html'>After updating the Android SDK I got the following message when I opened Eclipse:&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Can not find C:\Program Files\Google\Android SDK\tools\adb.exe&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Please check the Android plugin's preferences&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;And when I checked the adb.exe was really missing!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;Solution:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Update the Android add-ins for Eclipse, in Eclipse: "Help" -&gt; "Check for Updates".&lt;br /&gt;&lt;br /&gt;The reason for this error (in my case) was that since SDK 2.3 the 'adb.exe' was moved to:&lt;br /&gt;&lt;span style="font-style: italic;"&gt;C:\Program Files\Google\Android SDK\&lt;span style="font-weight: bold;"&gt;platform-tools&lt;/span&gt;\adb.exe&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;UPDATE&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;:&lt;/span&gt;&lt;span style="font-style: italic;"&gt; ddms.bat&lt;/span&gt;&lt;span&gt; does not work as well (can not find adb.exe). The work-around I'm using until I'll find a better solution is adding the platform-tools folder to the environment PATH variable.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-8910898934182994861?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/8910898934182994861/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=8910898934182994861' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/8910898934182994861'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/8910898934182994861'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2010/12/can-not-find-adbexe-after-android-sdk.html' title='Can not find adb.exe after Android SDK update'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-983956868218124686</id><published>2010-11-26T06:10:00.000-08:00</published><updated>2010-11-26T06:15:12.242-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>AdMob as shows in Landscape but not in Portrait</title><content type='html'>This was really weird. I added AdMob Ad to an Android application, and it didn't show. I tried rotating to landscape &amp;amp; the ad appeared.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Solution:&lt;/span&gt; &lt;a href="http://stackoverflow.com/questions/4281349/android-xml-layout-works-in-landscape-but-not-in-normal-orientation"&gt;I found the solution here&lt;/a&gt; - the AdMob ad must not be padded, or be in a padded container.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-983956868218124686?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/983956868218124686/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=983956868218124686' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/983956868218124686'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/983956868218124686'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2010/11/admob-as-shows-in-landscape-but-not-in.html' title='AdMob as shows in Landscape but not in Portrait'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-6955842175638598942</id><published>2010-11-08T22:14:00.000-08:00</published><updated>2010-11-08T22:27:56.035-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>Android application installation stuck on "Downloading"/"Installation"</title><content type='html'>&lt;span style="font-weight: bold; font-style: italic;"&gt;Problem&lt;/span&gt;: Application installation hangs/stuck on "downloading" or "installing" from the Market. Reboot does not help.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;Solution&lt;/span&gt;: Clearing the Android Market application cache -&lt;br /&gt;* Menu =&gt; Settings =&gt; Applications =&gt; Manage Applications =&gt; "All" tab =&gt; Market&lt;br /&gt;* Click on "Clear cache" (you might get 'Force Close' on the Market application after that).&lt;br /&gt;* Reopen the market &amp;amp; download&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Note&lt;/span&gt;: This is an issue with the Android Market application not the application you're downloading.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-6955842175638598942?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/6955842175638598942/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=6955842175638598942' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/6955842175638598942'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/6955842175638598942'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2010/11/android-application-hangs-during.html' title='Android application installation stuck on &quot;Downloading&quot;/&quot;Installation&quot;'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-900626101985950294</id><published>2010-10-14T02:48:00.000-07:00</published><updated>2010-10-14T02:54:23.338-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>Attachment disappears after e-mail sent programatically</title><content type='html'>I banged my head in the wall for about an hour to fix this issue.&lt;br /&gt;&lt;br /&gt;I wrote a small function in Android that let the user send an e-mail from my application. Everything worked just fine, but when the e-mail was sent the attachment disappeared (the attachment appeared within the GMail client on the android device before sending).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Solution:&lt;/span&gt; use the external storage (SD Card) instead of the application cache. The GMail client probably can't access the application cache folder, buf for some reason it shows as if the attachment is OK in the client).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-900626101985950294?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/900626101985950294/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=900626101985950294' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/900626101985950294'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/900626101985950294'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2010/10/attachment-disappears-after-e-mail-sent.html' title='Attachment disappears after e-mail sent programatically'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-8850231872786777348</id><published>2010-10-12T01:03:00.000-07:00</published><updated>2010-10-12T01:17:16.702-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>Android's ListView performance for large list</title><content type='html'>I needed to use a large ListView however the performance of the ListView loading time was very poor. Since I've used SimpleAdapter to map the data to the layout I was forced to populate all the data when creating the SimpleAdapter.&lt;br /&gt;&lt;br /&gt;The solution I've decided to take is creating an adapter specific for the task, which populate the data from the objects only during creation of the item's view.&lt;br /&gt;&lt;br /&gt;This is the pseudo code (note that the object data retrieval should by lazy too):&lt;br /&gt;&lt;pre name="code" class="Java"&gt;&lt;br /&gt;public class MyObjectAdapter extends BaseAdapter {&lt;br /&gt; private ArrayList&lt;MyObject&gt; mData;&lt;br /&gt; private int mResource;&lt;br /&gt; private LayoutInflater mInflater;&lt;br /&gt;&lt;br /&gt; public TimeZoneDisplayAdapter(Context context, ArrayList&lt;MyObject&gt; data,&lt;br /&gt;   int resource) {&lt;br /&gt;  mData = data;&lt;br /&gt;  mResource = resource;&lt;br /&gt;  mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; @Override&lt;br /&gt; public int getCount() {&lt;br /&gt;  return mData.size();&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; @Override&lt;br /&gt; public Object getItem(int position) {&lt;br /&gt;  return mData.get(position);&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; @Override&lt;br /&gt; public long getItemId(int position) {&lt;br /&gt;  return position;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; @Override&lt;br /&gt; public View getView(int position, View convertView, ViewGroup parent) {&lt;br /&gt;  View v;&lt;br /&gt;  if (convertView == null) &lt;br /&gt;   v = mInflater.inflate(mResource, parent, false);&lt;br /&gt;  else&lt;br /&gt;   v = convertView;&lt;br /&gt;   &lt;br /&gt;  bindView(position, v);&lt;br /&gt;  return v;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; private void bindView(int position, View view) {&lt;br /&gt;  MyObject o = mData.get(position);&lt;br /&gt;  &lt;br /&gt;  ((TextView)view.findViewById(R.id.list_item_resource_id)).setText(o.getData1());&lt;br /&gt;  ......&lt;br /&gt;  ......&lt;br /&gt;  ......&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Note:&lt;/span&gt; there are few examples online how to load data to ListView using threads. This wasn't my problem, and it's like killing a fly with a sledge-hammer. The loading time of a specific item was very short, the problem was that there were simply too many items to load at construction time.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-8850231872786777348?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/8850231872786777348/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=8850231872786777348' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/8850231872786777348'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/8850231872786777348'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2010/10/androids-listview-performance-for-large.html' title='Android&apos;s ListView performance for large list'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-7944775222453272301</id><published>2010-10-08T09:26:00.000-07:00</published><updated>2010-10-08T09:35:14.265-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>Making TextView clickable (http)</title><content type='html'>The problem: I had a TextView which I wanted to make clickable, and open a web browser.&lt;br /&gt;&lt;br /&gt;1. Brute force solution: change the TextView style to blue &amp; underline. Set the onClick event to open web browser.&lt;br /&gt;&lt;br /&gt;2. The following code:&lt;br /&gt;&lt;pre name="code" class="Java"&gt;&lt;br /&gt;SpannableString s = SpannableString.valueOf(entryText);&lt;br /&gt;URLSpan span = new URLSpan(urlText);&lt;br /&gt;s.setSpan(span, 0, entryText.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);&lt;br /&gt;mTextView.setText(s);&lt;br /&gt;mTextView.setMovementMethod(LinkMovementMethod.getInstance());&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-7944775222453272301?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/7944775222453272301/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=7944775222453272301' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/7944775222453272301'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/7944775222453272301'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2010/10/making-textview-clickable-http.html' title='Making TextView clickable (http)'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-5840908932455402530</id><published>2010-08-23T04:59:00.000-07:00</published><updated>2010-08-23T05:07:08.717-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>AlertDialog with single selection &amp; no radio button</title><content type='html'>Current Android version AlertDialog.Builder default behavior of  "setSingleChoiceItems" creates a list with radio buttons from which you can select.&lt;br /&gt;&lt;br /&gt;I wanted to get this list without the radio button. After digging a bit in AlertDialog.Builder &amp;amp; AlertController.AlertParams I found the solution: instead of using&lt;span style="font-weight: bold;"&gt; setSingleChoiceItems&lt;/span&gt; use &lt;span style="font-weight: bold;"&gt;setAdapter&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="Java"&gt;&lt;br /&gt;     ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this, android.R.layout.select_dialog_item, itemActionsList);&lt;br /&gt;     dialog.setAdapter(adapter,&lt;br /&gt;       new OnClickListener() {&lt;br /&gt;     @Override&lt;br /&gt;     public void onClick(DialogInterface arg0, int arg1) {&lt;br /&gt;      // Do something&lt;br /&gt;      arg0.dismiss();&lt;br /&gt;     }        &lt;br /&gt;       });&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-5840908932455402530?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/5840908932455402530/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=5840908932455402530' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/5840908932455402530'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/5840908932455402530'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2010/08/alertdialog-with-single-selection-no.html' title='AlertDialog with single selection &amp; no radio button'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-4047888558330812134</id><published>2010-08-23T04:03:00.000-07:00</published><updated>2010-08-23T04:09:52.840-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>Android hangs: "Waiting For Debugger"</title><content type='html'>I developed an application that worked just fine, and then it started to hang with the message: "Waiting For Debugger". Even when I disconnected the device from the computer the application insisted that it's waiting for the debugger...&lt;br /&gt;&lt;br /&gt;Solution:&lt;br /&gt;1. Restart Eclipse [it's probably not needed].&lt;br /&gt;2. Restart the Android device.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-4047888558330812134?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/4047888558330812134/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=4047888558330812134' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/4047888558330812134'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/4047888558330812134'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2010/08/android-hangs-waiting-for-debugger.html' title='Android hangs: &quot;Waiting For Debugger&quot;'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-1534378989739464312</id><published>2010-08-20T21:34:00.000-07:00</published><updated>2010-08-20T21:43:38.711-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>Android requires .class compatibility set to 5.0. Please fix project properties.</title><content type='html'>I've created a new workspace in Eclipse &amp;amp; imported an Android project.&lt;br /&gt;&lt;br /&gt;* &lt;span style="font-style: italic;"&gt;Issue #1&lt;/span&gt;:&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Android requires .class compatibility set to 5.0. Please fix project properties.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;* &lt;span style="font-style: italic;"&gt;Solution&lt;/span&gt;:&lt;br /&gt;1. Fix project:&lt;br /&gt;    Package Explorer -&gt;&lt;br /&gt;    Right click the project -&gt;&lt;br /&gt;    "Android Tools" -&gt; "Fix Project Properties"&lt;br /&gt;2. Restart Eclipse:&lt;br /&gt;    "File" -&gt; "Restart"&lt;br /&gt;&lt;br /&gt;* &lt;span style="font-style: italic;"&gt;Issue #2&lt;/span&gt;: The following error appears many times&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;The method xyz() of type ABC must override a superclass method&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;* &lt;span style="font-style: italic;"&gt;Solution&lt;/span&gt;:&lt;br /&gt;1. Fix the project again:&lt;br /&gt;    Package Explorer -&gt;&lt;br /&gt;    Right click the project -&gt;&lt;br /&gt;    "Properties" -&gt; "Java Compiler" -&gt; "Compiler Compliance Level" = 1.6&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-1534378989739464312?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/1534378989739464312/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=1534378989739464312' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/1534378989739464312'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/1534378989739464312'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2010/08/android-requires-class-compatibility.html' title='Android requires .class compatibility set to 5.0. Please fix project properties.'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-744818800012951392</id><published>2010-08-16T12:24:00.000-07:00</published><updated>2010-08-16T12:32:11.314-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>DataView RowFilter performance</title><content type='html'>I needed to use DataView but the performance I got was very poor. Searching the web I found &lt;span style="text-decoration: underline;"&gt;&lt;/span&gt;&lt;a href="http://geekswithblogs.net/chrisfalter/archive/2006/08/15/88057.aspx"&gt;this resource&lt;/a&gt; which explains the root cause for this issue: after each RowFilter the DataView is re-indexed.&lt;br /&gt;&lt;br /&gt;Searching a bit more yield &lt;a href="http://msdn.microsoft.com/en-us/library/13wb36xf%28VS.71%29.aspx"&gt;the answer from Microsoft&lt;/a&gt;: &lt;span style="font-weight: bold;"&gt;don't use RowFilter if you don't have to. Use FindRows&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;For my scenario, using FindRows instead of Row filter resulted in at least factor of 6 improvement (i.e. 1 second instead of 6).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-744818800012951392?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/744818800012951392/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=744818800012951392' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/744818800012951392'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/744818800012951392'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2010/08/dataview-rowfilter-performance.html' title='DataView RowFilter performance'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-6631322262387817271</id><published>2010-08-12T10:10:00.000-07:00</published><updated>2010-08-12T10:18:41.907-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>Eclipse hangs during building Android projects workspace</title><content type='html'>Problem: Eclipse kept on hanging during auto-building Android projects.&lt;br /&gt;I found a &lt;a href="http://www.eclipsezone.com/eclipse/forums/t61566.html"&gt;resource which said&lt;/a&gt; (escalating solutions):&lt;br /&gt;1. Clean the projects.&lt;br /&gt;2. Create a new workspace &amp;amp; import all projects.&lt;br /&gt;3. Reinstall Eclipse&lt;br /&gt;&lt;br /&gt;After trying 1 &amp;amp; 2, I found the following weird solution:&lt;br /&gt;- Remove the auto-build (Project =&gt; Build Automatically). Kill the Eclipse (since it hangs...)&lt;br /&gt;- Restart Eclipse.&lt;br /&gt;- Delete the 'gen' folder of all the projects (using the Package Explorer)&lt;br /&gt;- Project =&gt; Clean (clean all projects)&lt;br /&gt;- Build the projects&lt;br /&gt;&lt;br /&gt;Don't know why it worked (at least until now).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-6631322262387817271?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/6631322262387817271/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=6631322262387817271' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/6631322262387817271'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/6631322262387817271'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2010/08/eclipse-hangs-during-building-android.html' title='Eclipse hangs during building Android projects workspace'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-7400697040345530932</id><published>2010-08-12T09:54:00.000-07:00</published><updated>2010-08-12T10:01:03.104-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>Android/Eclipse: Project 'MyProject' is missing required source folder: 'gen'</title><content type='html'>I'm having lots of problems with my Eclipse (when I'll solve them I'll write about it).&lt;br /&gt;&lt;br /&gt;Anyhow, after creating a new project in a new workspace I get the following error:&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Project 'MyProject' is missing required source folder: 'gen' &lt;/span&gt;&lt;br /&gt;After building the project there's a second error:&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;The project cannot be built until build path errors are resolved&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;A temporary solution: in the Package Explorer delete &lt;span style="font-weight: bold;"&gt;gen &lt;/span&gt;folder. Rebuilding the project again will fix the problem. Why it's temporary? you'll have to do it with every new project.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-7400697040345530932?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/7400697040345530932/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=7400697040345530932' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/7400697040345530932'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/7400697040345530932'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2010/08/androideclipse-project-myproject-is.html' title='Android/Eclipse: Project &apos;MyProject&apos; is missing required source folder: &apos;gen&apos;'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-670431749920796282</id><published>2010-08-05T02:40:00.000-07:00</published><updated>2010-08-05T02:42:12.749-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>Starting android calculator programmatically</title><content type='html'>Here goes:&lt;br /&gt;&lt;pre name="code" class="Java"&gt;&lt;br /&gt;public static final String CALCULATOR_PACKAGE = &lt;br /&gt; "com.android.calculator2";&lt;br /&gt;public static final String CALCULATOR_CLASS = &lt;br /&gt; "com.android.calculator2.Calculator";&lt;br /&gt;&lt;br /&gt;public static void OpenCalculator(Context context) { &lt;br /&gt; Intent i = new Intent();&lt;br /&gt; i.setAction(Intent.ACTION_MAIN);&lt;br /&gt; i.addCategory(Intent.CATEGORY_LAUNCHER);&lt;br /&gt;&lt;br /&gt; i.setFlags(&lt;br /&gt;  Intent.FLAG_ACTIVITY_NEW_TASK | &lt;br /&gt;  Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);&lt;br /&gt; i.setComponent(new ComponentName(&lt;br /&gt;  CALCULATOR_PACKAGE, &lt;br /&gt;  CALCULATOR_CLASS));&lt;br /&gt; context.startActivity(i);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-670431749920796282?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/670431749920796282/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=670431749920796282' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/670431749920796282'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/670431749920796282'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2010/08/starting-android-calculator.html' title='Starting android calculator programmatically'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-8418203626284699181</id><published>2010-07-31T01:38:00.000-07:00</published><updated>2010-08-02T22:50:57.905-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>Colors in AlertDialog</title><content type='html'>I wanted to use colors in AlertDialog and I found &lt;a href="http://dtmilano.blogspot.com/2010/01/android-ui-colored-dialogs.html"&gt;this post&lt;/a&gt;. It work great although the solution there is not full (there are features of AlertDialog that will not work). One issue with that post - the code &amp; XML there can not be easily copied. &lt;br /&gt;&lt;br /&gt;Here's that code again, with some changes/improvements:&lt;br /&gt;* Renamed the class name to ColorAlertDialog&lt;br /&gt;* ColorAlertDialog.Builder does not inherits AlertDialog.Builder. This caused some confusion (you could call function but they didn't do anything).&lt;br /&gt;* Added functionality to ColorAlertDialog.Builder &lt;br /&gt;* Fixed force-close on Android 1.5&lt;br /&gt;&lt;br /&gt;Class (I've renamed the class):&lt;br /&gt;&lt;pre name="code" class="Java"&gt;&lt;br /&gt;import java.util.ArrayList;&lt;br /&gt;import java.util.Iterator;&lt;br /&gt;&lt;br /&gt;import android.app.AlertDialog;&lt;br /&gt;import android.content.Context;&lt;br /&gt;import android.content.res.TypedArray;&lt;br /&gt;import android.content.res.Resources.Theme;&lt;br /&gt;import android.graphics.PorterDuff.Mode;&lt;br /&gt;import android.graphics.drawable.Drawable;&lt;br /&gt;import android.view.View;&lt;br /&gt;import android.view.ViewGroup;&lt;br /&gt;import android.widget.Button;&lt;br /&gt;import android.widget.ImageView;&lt;br /&gt;&lt;br /&gt;public class ColorAlertDialog extends AlertDialog {&lt;br /&gt; private static int NONE = -1;&lt;br /&gt; private int tint = NONE;&lt;br /&gt;&lt;br /&gt; /**&lt;br /&gt; * @param context&lt;br /&gt; * @param theme&lt;br /&gt; */&lt;br /&gt; protected ColorAlertDialog(Context context) {&lt;br /&gt;  super(context);&lt;br /&gt;  init();&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; /**&lt;br /&gt; * @param context&lt;br /&gt; * @param theme&lt;br /&gt; */&lt;br /&gt; protected ColorAlertDialog(Context context, int theme) {&lt;br /&gt;  super(context, theme);&lt;br /&gt;  init();&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; /**&lt;br /&gt; * &lt;br /&gt; */&lt;br /&gt; private void init() {      &lt;br /&gt;  final Theme theme = getContext().getTheme();&lt;br /&gt;  final TypedArray attrs = theme.obtainStyledAttributes(new int[] { android.R.attr.tint });&lt;br /&gt;  tint = attrs.getColor(0, NONE);&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; /* (non-Javadoc)&lt;br /&gt; * @see android.app.Dialog#show()&lt;br /&gt; */&lt;br /&gt; @Override&lt;br /&gt; public void show() {&lt;br /&gt;  super.show();&lt;br /&gt;  setTint(tint);&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; /**&lt;br /&gt; * @param tint&lt;br /&gt; */&lt;br /&gt; public void setTint(int tint) {&lt;br /&gt;  this.tint = tint;&lt;br /&gt;&lt;br /&gt;  if ( tint != NONE ) {&lt;br /&gt;   Iterator&lt;View&gt; vi = iterator(android.R.id.content);&lt;br /&gt;   while ( vi.hasNext() ) {&lt;br /&gt;    tintView(vi.next(), tint);&lt;br /&gt;   }&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; /**&lt;br /&gt; * Set the {@link tint} color for the {@link View}&lt;br /&gt; * &lt;br /&gt; * @param v the {@link View} to change the tint&lt;br /&gt; * @param tint color tint&lt;br /&gt; */&lt;br /&gt; private static void tintView(final View v, final int tint) {&lt;br /&gt;  if ( v != null ) {&lt;br /&gt;   final Mode mode = Mode.SRC_ATOP;&lt;br /&gt;   if ( v instanceof ImageView ) {&lt;br /&gt;    final Drawable d = ((ImageView)v).getDrawable();&lt;br /&gt;    if ( d != null ) {&lt;br /&gt;     try {&lt;br /&gt;     d.mutate().setColorFilter(tint, mode);&lt;br /&gt;     } catch (Exception ex) {&lt;br /&gt;      // Patch for Android 1.5&lt;br /&gt;     }&lt;br /&gt;    }&lt;br /&gt;   }&lt;br /&gt;   else {&lt;br /&gt;    final Drawable d = v.getBackground();&lt;br /&gt;    if ( d != null ) {&lt;br /&gt;     d.setColorFilter(tint, mode);&lt;br /&gt;    }&lt;br /&gt;   }&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; /**&lt;br /&gt; * @param button&lt;br /&gt; */&lt;br /&gt; public void setCancelButton(Button button) {&lt;br /&gt;  button.setOnClickListener(new View.OnClickListener() {&lt;br /&gt;   @Override&lt;br /&gt;   public void onClick(View v) {&lt;br /&gt;    cancel();&lt;br /&gt;   }&lt;br /&gt;  });&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; /**&lt;br /&gt; * @param button&lt;br /&gt; */&lt;br /&gt; public void setPositiveButton(Button button) { &lt;br /&gt;  button.setOnClickListener(new View.OnClickListener() {&lt;br /&gt;   @Override&lt;br /&gt;   public void onClick(View v) {&lt;br /&gt;    dismiss();  &lt;br /&gt;   }&lt;br /&gt;  });&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; /**&lt;br /&gt; * Return a {@link ChildrenIterator} starting at the {@link ViewGroup}&lt;br /&gt; * identified by the specified resource id.&lt;br /&gt; *  &lt;br /&gt; * @param res resource id of the {@link ViewGroup} to start the iteration&lt;br /&gt; * @return iterator&lt;br /&gt; */&lt;br /&gt; public Iterator&lt;View&gt; iterator(int res) {&lt;br /&gt;  final ViewGroup vg = (ViewGroup)findViewById(res);&lt;br /&gt;  return new ChildrenIterator&lt;View&gt;(vg);&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public static class Builder {&lt;br /&gt;  private ColorAlertDialog dialog;&lt;br /&gt;&lt;br /&gt;  public Builder(Context context) {&lt;br /&gt;   dialog = new ColorAlertDialog(context);&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public Builder(Context context, int theme) {&lt;br /&gt;   dialog = new ColorAlertDialog(context, theme);&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public ColorAlertDialog create() {&lt;br /&gt;   return dialog;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public Builder setMessage(CharSequence message) {&lt;br /&gt;   dialog.setMessage(message);&lt;br /&gt;   return this;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public Builder setTitle(CharSequence title) {&lt;br /&gt;   dialog.setTitle(title);&lt;br /&gt;   return this;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public Builder setPositiveButton(int resId, OnClickListener listener) {&lt;br /&gt;   return setPositiveButton(dialog.getContext().getString(resId), listener);&lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt;  public Builder setPositiveButton(CharSequence text, OnClickListener listener) {&lt;br /&gt;   dialog.setButton(BUTTON_POSITIVE, text, listener);&lt;br /&gt;   return this;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public Builder setNegativeButton(int resId, OnClickListener listener) {&lt;br /&gt;   return setNegativeButton(dialog.getContext().getString(resId), listener);&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public Builder setNegativeButton(CharSequence text, OnClickListener listener) {&lt;br /&gt;   dialog.setButton(BUTTON_NEGATIVE, text, listener);&lt;br /&gt;   return this;&lt;br /&gt;  }&lt;br /&gt;    &lt;br /&gt;  public Builder setIcon(int iconId) {&lt;br /&gt;   dialog.setIcon(iconId);&lt;br /&gt;   return this;&lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt;  public Builder setCancelable(boolean flag) {&lt;br /&gt;   dialog.setCancelable(flag);&lt;br /&gt;   return this;   &lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt;  public ColorAlertDialog show() {&lt;br /&gt;   dialog.show();&lt;br /&gt;   return dialog;&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; public class ChildrenIterator&lt;V extends View&gt; implements Iterator&lt;V&gt; {&lt;br /&gt;  ArrayList&lt;V&gt; list;&lt;br /&gt;  private int i;&lt;br /&gt;  &lt;br /&gt;  public ChildrenIterator(ViewGroup vg) {&lt;br /&gt;   super();&lt;br /&gt;        &lt;br /&gt;   if ( vg == null ) &lt;br /&gt;    throw new RuntimeException("ChildrenIterator needs a ViewGroup != null to find its children");&lt;br /&gt;&lt;br /&gt;   init();&lt;br /&gt;   findChildrenAndAddToList(vg, list);&lt;br /&gt;  }&lt;br /&gt;     &lt;br /&gt;  private void init() {&lt;br /&gt;   list = new ArrayList&lt;V&gt;();&lt;br /&gt;   i = 0;         &lt;br /&gt;  }&lt;br /&gt;     &lt;br /&gt;  @Override&lt;br /&gt;  public boolean hasNext() {&lt;br /&gt;   return ( i &lt; list.size() );&lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt;  @Override&lt;br /&gt;  public V next() {&lt;br /&gt;   return list.get(i++);&lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt;  @Override&lt;br /&gt;  public void remove() {&lt;br /&gt;   list.remove(i);&lt;br /&gt;  }&lt;br /&gt;     &lt;br /&gt;  @SuppressWarnings("unchecked")&lt;br /&gt;  private void findChildrenAndAddToList(final ViewGroup root, final ArrayList&lt;V&gt; list) {&lt;br /&gt;   for (int i=0; i &lt; root.getChildCount(); i++) {&lt;br /&gt;    V v = (V)root.getChildAt(i);&lt;br /&gt;    list.add(v);&lt;br /&gt;    if ( v instanceof ViewGroup ) &lt;br /&gt;     findChildrenAndAddToList((ViewGroup)v, list);&lt;br /&gt;                &lt;br /&gt;   }       &lt;br /&gt;  }&lt;br /&gt; } &lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And the styles (put in an XML file under the 'res/values' folder):&lt;br /&gt;&lt;pre name="code" class="Xml"&gt;&lt;br /&gt;&lt;resources&gt;&lt;br /&gt; &lt;!-- Orange --&gt;&lt;br /&gt; &lt;style name="OrangeDialogTheme" parent="@android:style/Theme.Dialog"&gt;&lt;br /&gt;    &lt;item name="android:tint"&gt;@color/orange_tint&lt;/item&gt;&lt;br /&gt; &lt;/style&gt;&lt;br /&gt; &lt;style name="OrangeAlertDialogTheme" parent="OrangeDialogTheme"&gt;&lt;br /&gt;    &lt;item name="android:windowBackground"&gt;@color/transparent&lt;/item&gt;&lt;br /&gt; &lt;/style&gt;&lt;br /&gt; &lt;br /&gt; &lt;!-- Red --&gt;   &lt;br /&gt; &lt;style name="RedDialogTheme" parent="@android:style/Theme.Dialog"&gt;&lt;br /&gt;    &lt;item name="android:tint"&gt;@color/red_tint&lt;/item&gt;&lt;br /&gt; &lt;/style&gt;&lt;br /&gt; &lt;style name="RedAlertDialogTheme" parent="RedDialogTheme"&gt;&lt;br /&gt;    &lt;item name="android:windowBackground"&gt;@color/transparent&lt;/item&gt;&lt;br /&gt; &lt;/style&gt;&lt;br /&gt; &lt;br /&gt; &lt;!-- Colors --&gt;&lt;br /&gt; &lt;color name="red_tint"&gt;#88FF0000&lt;/color&gt;&lt;br /&gt; &lt;color name="blue_tint"&gt;#880000FF&lt;/color&gt;&lt;br /&gt; &lt;color name="yellow_tint"&gt;#88FFFF00&lt;/color&gt;&lt;br /&gt; &lt;color name="purple_tint"&gt;#88995f86&lt;/color&gt;&lt;br /&gt; &lt;color name="orange_tint"&gt;#aaffbf00&lt;/color&gt;&lt;br /&gt; &lt;color name="magenta_tint"&gt;#88ff33cc&lt;/color&gt;&lt;br /&gt; &lt;color name="transparent"&gt;#0000&lt;/color&gt;&lt;br /&gt;&lt;/resources&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-8418203626284699181?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/8418203626284699181/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=8418203626284699181' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/8418203626284699181'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/8418203626284699181'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2010/07/colors-in-alertdialog.html' title='Colors in AlertDialog'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-96610054039160766</id><published>2010-07-25T21:46:00.000-07:00</published><updated>2012-01-11T23:56:10.817-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>Notes on Android SQLite bulk insert</title><content type='html'>There's no real bulk insert in SQLite I'm aware of to date. I've tried various ways to insert data fast into Android's SQLite DB, and here are my notes:&lt;br /&gt;1. Use transactions. (e.g. db.beginTransaction, etc..).&lt;br /&gt;2. Use compiled statement: db.compileStatement(insertStatementString), it's much faster than db.insert().&lt;br /&gt;&lt;br /&gt;So, in short:&lt;br /&gt;&lt;pre name="code" class="Java"&gt;&lt;br /&gt;db.beginTransaction();&lt;br /&gt;try {&lt;br /&gt;    string sql = "insert into products (id) values (?)";&lt;br /&gt;    SQLiteStatement insert = db.compileStatement(sql);&lt;br /&gt;&lt;br /&gt;    for (.....) {&lt;br /&gt;        insert.bindLong(1, 12345);&lt;br /&gt;        insert.executeInsert();&lt;br /&gt;    }&lt;br /&gt;    db.setTransactionSuccessful();&lt;br /&gt;} finally {&lt;br /&gt;    db.endTransaction();&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-96610054039160766?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/96610054039160766/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=96610054039160766' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/96610054039160766'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/96610054039160766'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2010/07/notes-on-android-sqlite-bukl-insert.html' title='Notes on Android SQLite bulk insert'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-8732378771525182036</id><published>2010-07-20T00:51:00.000-07:00</published><updated>2010-11-25T23:11:19.675-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>ASP.NET error: Object Expected / ScriptResource.axd</title><content type='html'>What this error means in plain English: JavaScript error.&lt;br /&gt;&lt;br /&gt;The following case is how I solved a specific error in ASP.NET. It might give you ideas how to solve similar issues of ("Object Expected" with ScriptResource.axd). The easiest way to solve it is to use Firefox &amp;amp; firebug to trace down the specific JavaScript line which cause the problem.&lt;br /&gt;&lt;br /&gt;In the scenario bellow a resource (JavaScript) could not be loaded by the browser because the clock on the computer was set back in time. This caused this problem in another JavaScript (missing definition) which caused the error message to pop-up.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Step by step how I traced down the problem:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-size:180%;"&gt;1&lt;/span&gt;.&lt;/span&gt; When running an ASP.NET site with Menu item I got the "Object expected" error with the following information: "ScriptResource.axd". When I clicked the detailed information it gave me the URL of the resource which cause the problem.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Bottom line:&lt;br /&gt;* &lt;/span&gt;This error is a result of an unspecified JavaScript Error which accrued during running of a JavaScript file embedded in an ASP.NET project.&lt;br /&gt;* Verify you can open the JavaScript URL using the browser.&lt;br /&gt;* Debug the page using Firebug (on Firefox), see (2)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-size:180%;"&gt;2&lt;/span&gt;.&lt;/span&gt; When opening the page in Firefox with Firebug and setting the Firebug "console" to "enabled" (with "Show JavaScript errors") it caught the following exception:&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;"WebForm_GetElementByTagName is not defined"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The function "WebForm_GetElementByTagName" is declared in an embedded resource called: "WebForms.js", which is in many cases the first Java script included in an HTML generated by an ASP.NET page.&lt;br /&gt;&lt;br /&gt;Searching about this error online yielded only the following result:&lt;br /&gt;http://forums.asp.net/p/1439101/3253854.aspx&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Buttom line:&lt;/span&gt;&lt;br /&gt;* Try to open in the browser each and every JavaScript include files (.AXD) in the page.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-size:180%;"&gt;3&lt;/span&gt;.&lt;/span&gt; The error I got when I've tried to open the first ".AXD" JavaScript include file was - Parameter: "utmDate" out of range/out of date - which basically pointed me to check the computer date, since I've taken it back in time.&lt;br /&gt;&lt;br /&gt;Setting the date forward again fixed my problem.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-8732378771525182036?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/8732378771525182036/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=8732378771525182036' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/8732378771525182036'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/8732378771525182036'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2010/07/aspnet-error-object-expected.html' title='ASP.NET error: Object Expected / ScriptResource.axd'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-3510945380660963409</id><published>2010-07-18T04:03:00.000-07:00</published><updated>2011-01-24T06:51:39.778-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>Combo box / Drop down list box in Android</title><content type='html'>As usual doing something simple in Android is frustrating - this time: a simple Combo (or DropDownList). The little and important tweak - calling "setDropDownViewResource" to set the style of the items in the dialog box.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;XML:&lt;/span&gt;&lt;br /&gt;&amp;lt;spinner id="@+id/spinner" layout_width="wrap_content" android:layout_height="wrap_content" /&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Code to add the data:&lt;/span&gt;&lt;br /&gt;&lt;pre name="code" class="Java"&gt;&lt;br /&gt;Spinner spinner = (Spinner)this.findViewById(R.id.spinner);&lt;br /&gt;ArrayAdapter&amp;lt;String&amp;gt; adapter = new ArrayAdapter&amp;lt;String&amp;gt;(&lt;br /&gt;        this,&lt;br /&gt;        android.R.layout.simple_spinner_item,&lt;br /&gt;        new String[] { "1", "2", "3" });&lt;br /&gt;adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);&lt;br /&gt;spinner.setAdapter(adapter);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;A common task is to populate a spinner using a string array defined in a resource file. Here's a function which do just that:&lt;br /&gt;&lt;pre name="code" class="Java"&gt;&lt;br /&gt; public static void populateSpinnerWithArray(Spinner spinner, int stringArrayResId) {&lt;br /&gt;     ArrayAdapter&amp;lt;String&amp;gt; adapter = new ArrayAdapter&amp;lt;String&amp;gt;(&lt;br /&gt;             spinner.getContext(),  &lt;br /&gt;             android.R.layout.simple_spinner_item,&lt;br /&gt;             spinner.getContext().getResources().getStringArray(stringArrayResId));  &lt;br /&gt;     adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);  &lt;br /&gt;     spinner.setAdapter(adapter);  &lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-3510945380660963409?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/3510945380660963409/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=3510945380660963409' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/3510945380660963409'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/3510945380660963409'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2010/07/combo-box-drop-down-list-box-in-android.html' title='Combo box / Drop down list box in Android'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-6160548302062512513</id><published>2010-07-18T03:57:00.000-07:00</published><updated>2010-07-18T04:01:50.484-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>App crash when setting layout_weight without layout_width</title><content type='html'>While playing with the layout on Android I encountered the following weird problem: when using "&lt;span style="font-style: italic;"&gt;android:layout_weight&lt;/span&gt;" attribute for an element without "&lt;span style="font-style: italic;"&gt;android:layout_width&lt;/span&gt;" attribute it works just fine in the emulator but on the real phone it crash (Nexus One, Android 2.2).&lt;br /&gt;&lt;br /&gt;Since using "android:layout_width" gives me unwanted results I've tried to work around this issue and found the following solution:&lt;br /&gt;&lt;span style="font-style: italic;"&gt;android:layout_width="0dip"&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-6160548302062512513?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/6160548302062512513/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=6160548302062512513' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/6160548302062512513'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/6160548302062512513'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2010/07/app-crash-when-setting-layoutweight.html' title='App crash when setting layout_weight without layout_width'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-6810737354626588423</id><published>2010-07-08T00:06:00.000-07:00</published><updated>2010-07-31T01:33:21.344-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>Displaying a simple message box in Android</title><content type='html'>There are 2 options to display a pop-up in Android (both are not blocking):&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Toast&lt;/span&gt; - display a short balloon pop-up that will disappear after few seconds&lt;br /&gt;&lt;span style="font-style: italic;"&gt;AlertDialog &lt;/span&gt;- display a pop-up window with buttons.&lt;br /&gt;&lt;br /&gt;Toast:&lt;br /&gt;&lt;pre name="code" class="Java"&gt;&lt;br /&gt;Toast.makeText(this, "Hello World", Toast.LENGTH_SHORT).show();&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;AlertDialog:&lt;br /&gt;&lt;pre name="code" class="Java"&gt;&lt;br /&gt;AlertDialog ad = new AlertDialog.Builder(this).create();&lt;br /&gt;ad.setCancelable(false); // This blocks the 'BACK' button&lt;br /&gt;ad.setMessage("Hello World");&lt;br /&gt;ad.setButton("OK", new DialogInterface.OnClickListener() {&lt;br /&gt;    @Override&lt;br /&gt;    public void onClick(DialogInterface dialog, int which) {&lt;br /&gt;        dialog.dismiss();                    &lt;br /&gt;    }&lt;br /&gt;});&lt;br /&gt;ad.show();&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Note: it's better to use "&lt;span style="font-style: italic;"&gt;this.getString(R.string.ok)&lt;/span&gt;" and get the string from a resource file.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-6810737354626588423?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/6810737354626588423/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=6810737354626588423' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/6810737354626588423'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/6810737354626588423'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2010/07/displaying-simple-message-box-in.html' title='Displaying a simple message box in Android'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-5532342884034574752</id><published>2010-07-04T07:58:00.001-07:00</published><updated>2010-07-04T08:00:23.184-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>Android Debug.startMethodTracing() failed</title><content type='html'>With the following exception: "file open failed".&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Reason:&lt;/span&gt; No SD card write permission was given to the application (Android 1.6+)&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Solution:&lt;/span&gt; Make sure you add the permission to the Manifest file -&lt;br /&gt;&lt;span style="font-style: italic;"&gt;&lt;uses-permission name="android.permission.WRITE_EXTERNAL_STORAGE"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-5532342884034574752?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/5532342884034574752/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=5532342884034574752' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/5532342884034574752'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/5532342884034574752'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2010/07/android-debugstartmethodtracing-failed.html' title='Android Debug.startMethodTracing() failed'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-3391704747494100326</id><published>2010-07-02T05:39:00.000-07:00</published><updated>2010-07-02T05:44:18.788-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>Setting Android volume programmatically to maximum</title><content type='html'>I searched a bit how to the volume of an Android application to maximum, and I saw few post regarding people asking about &lt;span style="font-style: italic;"&gt;MediaPlayer.setValue&lt;/span&gt; function.&lt;br /&gt;&lt;br /&gt;It's not the right function for setting the volume (see the help).&lt;br /&gt;To set the volume to maximum (or any relative value):&lt;br /&gt;&lt;br /&gt;// Get the AudioManager&lt;br /&gt;AudioManager audioManager =   &lt;br /&gt;            (AudioManager)this.getSystemService(Context.AUDIO_SERVICE);&lt;br /&gt;// Set the volume of played media to maximum.&lt;br /&gt;audioManager.setStreamVolume (&lt;br /&gt;             AudioManager.STREAM_MUSIC,&lt;br /&gt;             audioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC),&lt;br /&gt;             0);&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-3391704747494100326?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/3391704747494100326/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=3391704747494100326' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/3391704747494100326'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/3391704747494100326'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2010/07/setting-android-volume-programmatically.html' title='Setting Android volume programmatically to maximum'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-1608410159538019109</id><published>2010-06-22T22:41:00.000-07:00</published><updated>2010-06-22T23:09:27.531-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>Polishing Android application</title><content type='html'>Before deployment of an Android application there are few common steps that you should consider to ensure the application has a professional look:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Add an EULA - &lt;a href="http://androiddevstudio.com/tutorials/adding-eula-to-android-app"&gt;See here how&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;Set the correct sound control - Android has multiple sound controls (alarm volume, sound volume, phone volume etc.). You should me sure that when the user click on the volume buttons the correct volume is set (&lt;a href="http://www.stealthcopter.com/blog/2010/02/how-to-tell-android-which-volume-mediaringtone-etc-should-be-controlled-by-your-app/"&gt;See here how&lt;/a&gt;). For example, to set the volume button to control the media volume:&lt;br /&gt;&lt;span style="font-style: italic;"&gt;this.setVolumeControlStream(AudioManager.STREAM_MUSIC);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Disable buttons that are not in use - Except the "Home" buttons, all other buttons can be disabled by overriding "onKeyDown" function.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Hide the window title bar &amp;amp; the Android status bar - To hide the status bar:&lt;br /&gt;&lt;span style="font-style: italic;"&gt;getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN)&lt;/span&gt;&lt;br /&gt;To hide the window title:&lt;br /&gt;&lt;span style="font-style: italic;"&gt;requestWindowFeature(Window.FEATURE_NO_TITLE);&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-1608410159538019109?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/1608410159538019109/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=1608410159538019109' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/1608410159538019109'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/1608410159538019109'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2010/06/polishing-android-application.html' title='Polishing Android application'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-5374473262252563340</id><published>2010-06-21T12:10:00.000-07:00</published><updated>2010-06-21T12:16:18.890-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>Android app requires un-needed permissions</title><content type='html'>After finishing writing Android app, during installation the application request permissions for:&lt;br /&gt;* Storage&lt;br /&gt;* Phone calls&lt;br /&gt;&lt;br /&gt;However those permissions are not requested in the AndroidManifest.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Solution:&lt;/span&gt;&lt;br /&gt;This is a backward compatibility issue with Android 1.5 or less. Just add: android:targetSdkVersion="4" to the  &lt;span style="font-style: italic;"&gt;uses-sdk &lt;/span&gt;tag, for example:&lt;br /&gt;&lt;uses-sdk minsdkversion="3" targetsdkversion="4"&gt;&lt;br /&gt;(you must compile the application with platform SDK 1.6 or later).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-5374473262252563340?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/5374473262252563340/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=5374473262252563340' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/5374473262252563340'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/5374473262252563340'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2010/06/android-app-requires-un-needed.html' title='Android app requires un-needed permissions'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-6669350079040699903</id><published>2010-06-16T00:28:00.001-07:00</published><updated>2010-06-16T00:32:30.301-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>Project wouldn't run after importing to Eclipse</title><content type='html'>With the following error message:&lt;br /&gt;"The selection cannot be launched, and there are no recent launches"&lt;br /&gt;&lt;br /&gt;I got it for my Android project, but it's not limited to android.&lt;br /&gt;Since I'm newbie to Eclipse I started to googling but I couldn't find a solution. Playing with the UI got me to the right place:&lt;br /&gt;&lt;br /&gt;In the main menu: "Run" -&gt; "Run configurations..."&lt;br /&gt;Double click the project type you want (in my case "Android Application") &amp;amp; select the project you want to run.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-6669350079040699903?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/6669350079040699903/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=6669350079040699903' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/6669350079040699903'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/6669350079040699903'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2010/06/project-wouldnt-run-after-importing-to.html' title='Project wouldn&apos;t run after importing to Eclipse'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-4997644212151649455</id><published>2010-06-03T22:59:00.000-07:00</published><updated>2010-06-03T23:13:46.402-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows 7'/><title type='text'>How to delete VPN or Dail-up connection in Windows 7</title><content type='html'>It took me a while to find out how to delete a VPN connection I've setup on Windows 7. &lt;br /&gt;&lt;br /&gt;So here's how:&lt;br /&gt;1. Click on the connection icon in the icon tray (right-bottom side of the screen)&lt;br /&gt;2. Click on "Open Network and Sharing Center" (you can open it also from the Control Panel)&lt;br /&gt;3. On the left side of the window, click on "Change adapter settings"&lt;br /&gt;4. Delete the VPN/Dail-up&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-4997644212151649455?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/4997644212151649455/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=4997644212151649455' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/4997644212151649455'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/4997644212151649455'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2010/06/how-to-delete-vpn-or-dail-up-in-windows.html' title='How to delete VPN or Dail-up connection in Windows 7'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-8018900280454108989</id><published>2010-06-02T00:52:00.000-07:00</published><updated>2010-06-02T00:58:58.019-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint'/><category scheme='http://www.blogger.com/atom/ns#' term='WSS'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><title type='text'>SharePoint web part deployment error: Object reference not set to an instance of an object error</title><content type='html'>After deploying a SharePoint web-part developed using VSeWSS I get:&lt;br /&gt;"Object reference not set to an instance of an object error"&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Solution&lt;/span&gt;: copy the web part DLL to the GAC (it's also possible to register the DLL to the GAC on the batch file 'setup.bat' created by VSeWSS by calling gacutil.exe).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-8018900280454108989?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/8018900280454108989/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=8018900280454108989' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/8018900280454108989'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/8018900280454108989'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2010/06/sharepoint-web-part-deployment-error.html' title='SharePoint web part deployment error: Object reference not set to an instance of an object error'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-2806316956316217337</id><published>2010-05-31T04:02:00.000-07:00</published><updated>2010-05-31T04:08:39.085-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>Exception: Error executing child request for ChartImg.axd</title><content type='html'>I got this exception when I used the charts built-in to .NET 3.5. The scenario in which I got this exception was only when the charts first appeared after postback.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Solution&lt;/span&gt;: In the web.config file add 'POST' to the DataVisualization verbs:&lt;br /&gt;The old syntax:&lt;br /&gt;&lt;&lt;span style="color: rgb(255, 0, 0);"&gt;add path&lt;/span&gt;="&lt;span style="color: rgb(102, 102, 204);"&gt;ChartImg.axd&lt;/span&gt;" &lt;span style="color: rgb(255, 0, 0);"&gt;verb&lt;/span&gt;="&lt;span style="color: rgb(102, 102, 204);"&gt;GET,HEAD&lt;/span&gt;" &lt;span style="color: rgb(255, 0, 0);"&gt;type&lt;/span&gt;="&lt;span style="color: rgb(102, 102, 204);"&gt;System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35&lt;/span&gt;"&lt;br /&gt;   &lt;span style="color: rgb(255, 0, 0);"&gt;validate&lt;/span&gt;="&lt;span style="color: rgb(102, 102, 204);"&gt;false&lt;/span&gt;" /&gt;&lt;br /&gt;&lt;br /&gt;The new syntax:&lt;br /&gt;&lt;span style="font-style: italic;"&gt;&lt;/span&gt;&lt;&lt;span style="color: rgb(255, 0, 0);"&gt;add path&lt;/span&gt;="&lt;span style="color: rgb(102, 102, 204);"&gt;ChartImg.axd&lt;/span&gt;"  &lt;span style="color: rgb(255, 0, 0);"&gt;verb&lt;/span&gt;="&lt;span style="color: rgb(102, 102, 204);"&gt;GET,HEAD&lt;span style="font-weight: bold;"&gt;,POST&lt;/span&gt;&lt;/span&gt;" &lt;span style="color: rgb(255, 0, 0);"&gt;type&lt;/span&gt;="&lt;span style="color: rgb(102, 102, 204);"&gt;System.Web.UI.DataVisualization.Charting.ChartHttpHandler,  System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral,  PublicKeyToken=31bf3856ad364e35&lt;/span&gt;"&lt;br /&gt;   &lt;span style="color: rgb(255, 0, 0);"&gt;validate&lt;/span&gt;="&lt;span style="color: rgb(102, 102, 204);"&gt;false&lt;/span&gt;"  /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-2806316956316217337?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/2806316956316217337/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=2806316956316217337' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/2806316956316217337'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/2806316956316217337'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2010/05/exception-error-executing-child-request.html' title='Exception: Error executing child request for ChartImg.axd'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-3074204007594077188</id><published>2010-05-11T08:55:00.000-07:00</published><updated>2011-12-25T01:04:00.737-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>Android SDK Error: Unable to resolve target 'android-X'</title><content type='html'>There are few variants of this error message:&lt;br /&gt;Unable to resolve target 'android-1'&lt;br /&gt;Unable to resolve target 'android-2'&lt;br /&gt;Unable to resolve target 'android-3'&lt;br /&gt;Unable to resolve target 'android-4'&lt;br /&gt;Unable to resolve target 'android-5'&lt;br /&gt;Unable to resolve target 'android-6'&lt;br /&gt;Unable to resolve target 'android-7'&lt;br /&gt;Unable to resolve target 'android-8'&lt;br /&gt;Unable to resolve target 'android-9'&lt;br /&gt;Unable to resolve target 'android-10'&lt;br /&gt;Unable to resolve target 'android-11'&lt;br /&gt;Unable to resolve target 'android-12'&lt;br /&gt;Unable to resolve target 'android-13'&lt;br /&gt;Unable to resolve target 'android-14'&lt;br /&gt;Unable to resolve target 'android-15'&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Reason&lt;/span&gt;: Could not find the proper Android SDK version. If the android SDK is installed correctly the problem is that the platform SDK requested by the "default.properties" is not installed. For example:&lt;br /&gt;Unable to resolve target 'android-1' - (Android 1.0) change the "default.properties"&lt;br /&gt;Unable to resolve target 'android-2' - (Android 1.1) change the "default.properties"&lt;br /&gt;Unable to resolve target 'android-3' - install SDK Platform Android 1.5&lt;br /&gt;Unable to resolve target 'android-4' - install SDK Platform Android 1.6&lt;br /&gt;Unable to resolve target 'android-5' - install SDK Platform Android 2.0&lt;br /&gt;Unable to resolve target 'android-6' - install SDK Platform Android 2.0.1&lt;br /&gt;Unable to resolve target 'android-7' - install SDK Platform Android 2.1&lt;br /&gt;Unable to resolve target 'android-8' - install SDK Platform Android 2.2&lt;br /&gt;Unable to resolve target 'android-9' - install SDK Platform Android 2.3&lt;br /&gt;Unable to resolve target 'android-10' - install SDK Platform Android 2.3.3&lt;br /&gt;Unable to resolve target 'android-11' - install SDK Platform Android 3.0&lt;br /&gt;Unable to resolve target 'android-12' - install SDK Platform Android 3.1&lt;br /&gt;Unable to resolve target 'android-13' - install SDK Platform Android 3.2&lt;br /&gt;Unable to resolve target 'android-14' - install SDK Platform Android 4.0&lt;br /&gt;Unable to resolve target 'android-15' - install SDK Platform Android 4.0.3&lt;br /&gt;&lt;br /&gt;You can do this using the Android SDK Setup utility:&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Option 1:&lt;/span&gt; Eclipse -&lt;br /&gt;"Windows" \ "Android SDK and AVD Manager" \ "Available packages"&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Option 2:&lt;/span&gt; Command line - start the "SDK Setup" here (x86):&lt;br /&gt;C:\Program Files\Google\Android SDK\SDK Setup.exe&lt;br /&gt;or here (x64)&lt;br /&gt;C:\Program Files (x86)\Google\Android SDK\SDK Setup.exe&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-3074204007594077188?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/3074204007594077188/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=3074204007594077188' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/3074204007594077188'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/3074204007594077188'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2010/05/android-sdk-error-unable-to-resolve.html' title='Android SDK Error: Unable to resolve target &apos;android-X&apos;'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-3520540661135911116</id><published>2010-04-11T03:31:00.000-07:00</published><updated>2010-04-11T03:41:15.821-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='GoDaddy'/><category scheme='http://www.blogger.com/atom/ns#' term='WordPress'/><title type='text'>GoDaddy windows hosting with WordPress Permalinks</title><content type='html'>After moving multiple domains hosted in GoDaddy to a single Delux windows account I found out that the WordPress permalinks (e.g. SEO nice URL) aren't working anymore.&lt;br /&gt;&lt;br /&gt;There are multiple discussions online regarding this problem, mostly regarding redirecting the 404 error page. However the solution is SUPER simple - RTFM (the following answer appears in the WordPress permalink setting page): add a file "web.config" containing the following lines&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;?xml version="1.0"?&amp;gt;&lt;br /&gt;&amp;lt;configuration&amp;gt;&lt;br /&gt;  &amp;lt;system.webServer&amp;gt;&lt;br /&gt;    &amp;lt;rewrite&amp;gt;&lt;br /&gt;      &amp;lt;rules&amp;gt;&lt;br /&gt;        &amp;lt;rule name="Main Rule" stopProcessing="true"&amp;gt;&lt;br /&gt;          &amp;lt;match url=".*" /&amp;gt;&lt;br /&gt;          &amp;lt;conditions logicalGrouping="MatchAll"&amp;gt;&lt;br /&gt;            &amp;lt;add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /&amp;gt;&lt;br /&gt;            &amp;lt;add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /&amp;gt;&lt;br /&gt;          &amp;lt;/conditions&amp;gt;&lt;br /&gt;          &amp;lt;action type="Rewrite" url="index.php" /&amp;gt;&lt;br /&gt;        &amp;lt;/rule&amp;gt;&lt;br /&gt;      &amp;lt;/rules&amp;gt;&lt;br /&gt;    &amp;lt;/rewrite&amp;gt;&lt;br /&gt;  &amp;lt;/system.webServer&amp;gt;&lt;br /&gt;&amp;lt;/configuration&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-3520540661135911116?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/3520540661135911116/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=3520540661135911116' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/3520540661135911116'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/3520540661135911116'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2010/04/godaddy-windows-hosting-with-wordpress.html' title='GoDaddy windows hosting with WordPress Permalinks'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-5546674891786496544</id><published>2010-04-10T23:45:00.000-07:00</published><updated>2010-04-11T00:45:47.110-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Twitter'/><title type='text'>Twitter statistics: Avg. number of follower by time zone</title><content type='html'>About a week ago I saw &lt;a href="http://techcrunch.com/2010/04/06/twitter-profile-picture/"&gt;this post&lt;/a&gt; on TechCrunch and I wondered what other irrelevant statistics I can find on Twitter (given the fact I've already put some time in &lt;a href="http://sagistech.blogspot.com/2010/03/parsing-twitter-json-comparing-c.html"&gt;collecting and parsing&lt;/a&gt; Twitter data).&lt;br /&gt;&lt;br /&gt;Here is the number of followers by time zone settings (removed time zones with less than 10,000 users, sorry Sydney).&lt;br /&gt;&lt;br /&gt;Minimal analysis:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Greenland &lt;/span&gt;- More people set their time zone to Greenland than the population there...&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Alska &lt;/span&gt;- Over 6% (!) of the population are tweeting [see also - 'Greenland'].&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Tokyo &lt;/span&gt;- Don't set your time zone to Tokyo if you want people to listen to you,  lot's of people are tweeting from Tokyo but no one listens. &lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;No Time Zone&lt;/span&gt; - There's a very low followers count for people with no time zone setting - I guess the reason is that those people are new to Twitter or just don't care enough (those people are about 20% of this entire sample).&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;img src="http://1.bp.blogspot.com/_77SCNIL_wPM/S8F4WPGFwFI/AAAAAAAACHg/Y1Lp2wplvBg/s1600/AvgNumberOfFollowers.gif" /&gt;&lt;br /&gt;&lt;br /&gt;Data collected from the Twitter Sampling API, March 21st-25th, 2010.&lt;br /&gt;Total number of users visible during that time frame: 2.5M (which is a very nice sample).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-5546674891786496544?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/5546674891786496544/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=5546674891786496544' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/5546674891786496544'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/5546674891786496544'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2010/04/twitter-statistics-avg-number-of.html' title='Twitter statistics: Avg. number of follower by time zone'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_77SCNIL_wPM/S8F4WPGFwFI/AAAAAAAACHg/Y1Lp2wplvBg/s72-c/AvgNumberOfFollowers.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-550360533229928698</id><published>2010-03-27T01:29:00.000-07:00</published><updated>2010-03-30T07:25:02.659-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JSON'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='Twitter'/><title type='text'>Parsing Twitter JSON: Comparing C# libraries performance</title><content type='html'>Twitter stream API return the data in JSON format. There are multiple JSON libraries in C#, however since I wanted to parse large volumes of data I did a short performance test to see which library gives the best performance in parsing Twitter JSON data.&lt;br /&gt;&lt;br /&gt;The libraries tested:&lt;br /&gt;* &lt;a href="http://json.codeplex.com/"&gt;Json.NET&lt;/a&gt; - A popular C# JSON library.&lt;br /&gt;* &lt;a href="http://codeplex.com/GAPIdotNET"&gt;Gapi.NET&lt;/a&gt; - Gapi.NET is not a JSON parsing library, but it contains JSON parsing routines.&lt;br /&gt;* &lt;a href="http://techblog.procurios.nl/k/618/news/view/14605/14863/How-do-I-write-my-own-parser-for-JSON.html"&gt;Procurios &lt;/a&gt;- Yet another C# JSON library. See also &lt;a href="http://www.jamiedigi.com/2009/06/parsing-twitter-json-in-c-sharp/"&gt;this blog post&lt;/a&gt; how to use it to parse Twiter data.&lt;br /&gt;* JavaScriptSerializer - .NET 3.5 built-in JSON parser.&lt;br /&gt;* DataContractJsonSerializer - .NET 3.5 built-in JSON parser.&lt;br /&gt;* &lt;a href="http://ajaxpro.codeplex.com/%22"&gt;AjaxPro&lt;/a&gt; - A C# AJAX library.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Results:&lt;/span&gt;&lt;br /&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 245px;" src="http://1.bp.blogspot.com/_77SCNIL_wPM/S7IJcPicKQI/AAAAAAAACHY/0pzsESD1emU/s400/TwitterJson.gif" alt="Parsing Twitter JSON: Comparing C# libraries performance" id="BLOGGER_PHOTO_ID_5454432479511062786" border="0" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;The test: &lt;/span&gt;&lt;br /&gt;* &lt;span style="font-style: italic; font-weight: bold;"&gt;Data&lt;/span&gt;: Twitter Stream API sampling interface data for one hour (2PM GMT) during Match 24th 2010. File size is 285Mb, contains 208,530 lines, one JSON object per line.&lt;br /&gt;* &lt;span style="font-weight: bold; font-style: italic;"&gt;Computer&lt;/span&gt;: HP Pavillion DV6000, Intel T9300 2.5GHz, 4GB Memory running Windows 7 x64&lt;br /&gt;* &lt;span style="font-style: italic; font-weight: bold;"&gt;Software&lt;/span&gt;: with each library I've performed a very simple test - parse all the messages &amp;amp; get the 'text' field data of every message, if it exists (see code below).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Results:&lt;/span&gt;&lt;br /&gt;* Json.NET - 12 seconds, no errors.&lt;br /&gt;* Gapi.NET - 10 seconds, no errors.&lt;br /&gt;* Procurios - 35 seconds, 207 errors.&lt;br /&gt;* JavaScriptSerializer - 77 seconds, no errors.&lt;br /&gt;* DataContractJsonSerializer - 24 seconds, 7452 errors (all the JSON objects that did not contain 'text' element).&lt;br /&gt;* AjaxPro - 16 seconds, no errors.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Code:&lt;/span&gt;&lt;br /&gt;Here's the code used for parsing a single line in each of the libraries. Variable &lt;span style="font-style: italic;"&gt;line &lt;/span&gt;contains a JSON object, the extracted tweet is stored in the variable &lt;span style="font-style: italic;"&gt;text&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;Json.NET parsing code&lt;br /&gt;&lt;pre name="code" class="Csharp"&gt;&lt;br /&gt;Dictionary&lt;string, object=""&gt; jsonObjects = new Dictionary&lt;string, object=""&gt;();&lt;br /&gt;StringReader lineReader = new StringReader(line);&lt;br /&gt;using (Newtonsoft.Json.JsonTextReader jsonReader =&lt;br /&gt;new Newtonsoft.Json.JsonTextReader(lineReader))&lt;br /&gt;{&lt;br /&gt;while (jsonReader.Read())&lt;br /&gt;{&lt;br /&gt;if ((jsonReader.ValueType != null) &amp;amp;&amp;amp; (jsonReader.Depth == 1))&lt;br /&gt;{&lt;br /&gt; string key = jsonReader.Value.ToString();&lt;br /&gt; jsonReader.Read();&lt;br /&gt; jsonObjects.Add(key, jsonReader.Value);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;object textObject;&lt;br /&gt;if (jsonObjects.TryGetValue("text", out textObject) == true)&lt;br /&gt;text = textObject.ToString();&lt;br /&gt;&lt;/string,&gt;&lt;/string,&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Gapi.NET parsing code&lt;br /&gt;&lt;pre name="code" class="Csharp"&gt;&lt;br /&gt;Gapi.Json.JsonObject jsonLine = Gapi.Json.JsonObject.Parse(line);&lt;br /&gt;Gapi.Json.JsonValue textValue;&lt;br /&gt;if (jsonLine.TryGetValue("text", out textValue) == true)&lt;br /&gt;text = textValue.ToString();&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Procurios parsing code&lt;br /&gt;&lt;pre name="code" class="Csharp"&gt;&lt;br /&gt;Hashtable jsonHash = (Hashtable)Procurios.Public.JSON.JsonDecode(line);&lt;br /&gt;text = jsonHash["text"] as string;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;JavaScriptSerializer&lt;br /&gt;&lt;pre name="code" class="Csharp"&gt;&lt;br /&gt;public class TwitterJsonObject&lt;br /&gt;{&lt;br /&gt;public string text;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;pre name="code" class="Csharp"&gt;&lt;br /&gt;JavaScriptSerializer jSerialize = new JavaScriptSerializer();&lt;br /&gt;TwitterJsonObject twitterJsonObject = jSerialize.Deserialize&amp;lt;twitterjsonobject&amp;gt;(line);&lt;br /&gt;text = twitterJsonObject.text;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;DataContractJsonSerializer&lt;br /&gt;&lt;pre name="code" class="Csharp"&gt;&lt;br /&gt;// This line is executed once&lt;br /&gt;DataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(TwitterJsonObject));&lt;br /&gt;&lt;br /&gt;// This code is executed for every JSON object&lt;br /&gt;MemoryStream ms = new MemoryStream(Encoding.Unicode.GetBytes(line));&lt;br /&gt;TwitterJsonObject twitterJsonObject = ser.ReadObject(ms) as TwitterJsonObject;&lt;br /&gt;text = twitterJsonObject.text;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;AjaxPro&lt;br /&gt;&lt;pre name="code" class="Csharp"&gt;&lt;br /&gt;TwitterJsonObject twitterJsonObject = AjaxPro.JavaScriptDeserializer.DeserializeFromJson(line, typeof(TwitterJsonObject)) as TwitterJsonObject;&lt;br /&gt;text = twitterJsonObject.text;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-550360533229928698?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/550360533229928698/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=550360533229928698' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/550360533229928698'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/550360533229928698'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2010/03/parsing-twitter-json-comparing-c.html' title='Parsing Twitter JSON: Comparing C# libraries performance'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_77SCNIL_wPM/S7IJcPicKQI/AAAAAAAACHY/0pzsESD1emU/s72-c/TwitterJson.gif' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-103101797280866515</id><published>2010-03-25T03:48:00.000-07:00</published><updated>2010-03-25T04:21:52.546-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>DoDragDrop prevents DoubleClick event from firing</title><content type='html'>I've tried implementing Drag &amp;amp; Drop in a ListView object, however, calling DoDragDrop from either MouseMove or MouseDown prevented DoubleClick event from firing.&lt;br /&gt;&lt;br /&gt;There are few posts online about it, mostly saying using MouseDown event and checking:&lt;br /&gt;&lt;span style="font-style: italic;"&gt;e.Clicks == 1&lt;/span&gt;&lt;br /&gt;(see for example: &lt;a href="http://cf-bill.blogspot.com/2007/04/c-dragdrop-and-doubleclick.html"&gt;here&lt;/a&gt;)&lt;br /&gt;&lt;br /&gt;However this didn't work for me (DoubleClick fired some times, but most of the time it didn't). After doing further research I came with the following full solution:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="Csharp"&gt;&lt;br /&gt;bool _beginDragDrop = false;&lt;br /&gt;&lt;br /&gt;void ListViewBase_MouseMove(object sender, MouseEventArgs e)&lt;br /&gt;{&lt;br /&gt; if ((e.Button == MouseButtons.Left)&amp;&amp;(_beginDragDrop == true))&lt;br /&gt; {&lt;br /&gt;  // Replace this with the object you want to Drag &amp; Drop&lt;br /&gt;  object draggedObject = this;&lt;br /&gt;  this.DoDragDrop(draggedObject, DragDropEffects.Copy);&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void ListViewBase_MouseDown(object sender, MouseEventArgs e)&lt;br /&gt;{&lt;br /&gt; if ((e.Button == MouseButtons.Left) &amp;&amp; (e.Clicks == 1))&lt;br /&gt;  _beginDragDrop = true;&lt;br /&gt; else&lt;br /&gt;  _beginDragDrop = false;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-103101797280866515?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/103101797280866515/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=103101797280866515' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/103101797280866515'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/103101797280866515'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2010/03/dodragdrop-prevent-doubleclick-event.html' title='DoDragDrop prevents DoubleClick event from firing'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-6820825021565675458</id><published>2010-02-22T08:53:00.000-08:00</published><updated>2010-02-22T09:00:15.747-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='AJAX'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='AjaxToolkit'/><title type='text'>AjaxToolkit: TabContainer not visible after setting TabPanel.Visible = false</title><content type='html'>After upgrading AjaxToolkit I had the following weird problem: a TabContainer disappeared.&lt;br /&gt;&lt;br /&gt;A short investigation showed that it was cause because I was setting a TabPanel property&lt;br /&gt;tabPanel.Visible = false&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Bottom line&lt;/span&gt;: If you set the ActiveTab of the TabContainer to Visible=false =&gt; the TabContainer will not be drawn. I'm not sure if it's a bug or a feature.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Resolution:&lt;/span&gt; Change the ActiveTab when you set TabPanel.Visible = false&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-6820825021565675458?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/6820825021565675458/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=6820825021565675458' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/6820825021565675458'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/6820825021565675458'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2010/02/ajaxtoolkit-tabcontainer-not-visible.html' title='AjaxToolkit: TabContainer not visible after setting TabPanel.Visible = false'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-9049068291462600096</id><published>2010-02-10T09:13:00.000-08:00</published><updated>2010-02-10T09:51:59.875-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows Vista'/><category scheme='http://www.blogger.com/atom/ns#' term='MSI'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows 7'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><title type='text'>Error 2869 during installation</title><content type='html'>&lt;span style="font-weight: bold;"&gt;The problem: &lt;/span&gt;&lt;br /&gt;Error message during installation on Windows Vista / 7:&lt;br /&gt;&lt;span style="font-style: italic;"&gt;The installer encountered an unexpected error installing this package. This may indicate a problem with the package. The error code is 2869.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Reason:&lt;/span&gt;&lt;br /&gt;The MSI contains a custom action that require more privileges than the current user have.&lt;br /&gt;Due to UAC (user access control) even if you're administrator, you're not REALLY administrator unless specifically run as such.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Resolution:&lt;/span&gt;&lt;br /&gt;- Simple option - Install as administrator.&lt;br /&gt;- If you wrote the package in Visual Studio 2005/2008 add the following to require administrator privileges to begin installation:&lt;br /&gt;1. Right click on the setup project -&gt; View -&gt; Launch Conditions&lt;br /&gt;2. In the Launch conditions window, right-click the node "Launch Conditions" and select "Add launch condition".&lt;br /&gt;3. Rename the new launch condition to something like "Require Administrator".&lt;br /&gt;4. In the new launch condition property window set "Condition" to "AdminUser"&lt;br /&gt;5. Set the error message to something meaningful ("Only administrator can install this software").&lt;br /&gt;6. Check the &lt;a href="http://social.msdn.microsoft.com/forums/en-US/winformssetup/thread/cae9b6dd-df69-4dee-9ec1-918a7d05c8dc"&gt;following post&lt;/a&gt; &amp;amp; add "NoImpersonate.js"&lt;br /&gt;7. Rebuild the package.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-9049068291462600096?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/9049068291462600096/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=9049068291462600096' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/9049068291462600096'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/9049068291462600096'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2010/02/error-2869-during-installation.html' title='Error 2869 during installation'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-8521638302617702777</id><published>2010-01-28T02:07:00.000-08:00</published><updated>2010-01-28T02:10:16.218-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MAPI'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>MAPIInitialize fails with code 0x80010106 in C#</title><content type='html'>I've tried to use MAPI in C# but MAPIInitialize keeped on failing with error code: 0x80010106.&lt;br /&gt;&lt;br /&gt;The clue I found only is that this error code is related to multi-threading.&lt;br /&gt;The answer was simple - set the application attribute:&lt;br /&gt;[STAThread]&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-8521638302617702777?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/8521638302617702777/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=8521638302617702777' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/8521638302617702777'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/8521638302617702777'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2010/01/mapiinitialize-fails-with-code.html' title='MAPIInitialize fails with code 0x80010106 in C#'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-504422039619789142</id><published>2010-01-21T00:55:00.000-08:00</published><updated>2010-01-21T00:59:59.793-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WinSNMP'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>WinSNMP C# wrapper fails in 64 bit systems</title><content type='html'>Some time ago I wrote a C# wrapper for WinSNMP. Recently I moved to Win7 64 bit and that application failed to run. I thought it's because of Win32 API change, but it seems like the issue was with 32 bit vs. 64 bit.&lt;br /&gt;&lt;br /&gt;Solution: (work-around) compile the application to x32:&lt;br /&gt;Right click the project -&gt; Build -&gt; Platform Target -&gt; x86&lt;br /&gt;&lt;br /&gt;It could be that I did something wrong in the wrapper, but I really don't have the time to check it out.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-504422039619789142?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/504422039619789142/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=504422039619789142' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/504422039619789142'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/504422039619789142'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2010/01/winsnmp-c-wrapper-fails-in-64-bit.html' title='WinSNMP C# wrapper fails in 64 bit systems'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-1587496938651433180</id><published>2010-01-10T23:44:00.000-08:00</published><updated>2010-01-10T23:48:43.413-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Access'/><category scheme='http://www.blogger.com/atom/ns#' term='MDB'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Convert SQL Server Database to Access MDB</title><content type='html'>I tried looking around the web how to accomplish the following task:&lt;br /&gt;Convert SQL Server Database to Access MDB&lt;br /&gt;&lt;br /&gt;I couldn't find any answer online, but on the way to work it hit me: use SQL Server Management Studio "Export". I just checked it and it works like a charm. In 2 minutes I was able to export the SQL Server database to Access MDB.&lt;br /&gt;&lt;br /&gt;Just do:&lt;br /&gt;1. Open SQL Server Management Studio &amp;amp; connect to the SQL Server database.&lt;br /&gt;2. Right click the database and select - "Tasks" =&gt; "Export"&lt;br /&gt;3. Select the source database &amp;amp; select Access MDB as destination.&lt;br /&gt;Continue with the instructions.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-1587496938651433180?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/1587496938651433180/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=1587496938651433180' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/1587496938651433180'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/1587496938651433180'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2010/01/convert-sql-server-database-to-access.html' title='Convert SQL Server Database to Access MDB'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-5609023625059817908</id><published>2009-12-15T01:05:00.001-08:00</published><updated>2009-12-15T01:10:44.698-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='TFS'/><title type='text'>TFS Error: HTTP code 403: TF53011: DOMAIN\USER is not a licensed user.</title><content type='html'>While adding a new user to the TFS I got the following error:&lt;br /&gt;&lt;span style="font-style: italic;"&gt;HTTP code 403: TF53011: DOMAIN\USER is not a licensed user.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;There are many talks in the web, but the solution might be VERY simple (it was in my case):&lt;br /&gt;Add the new user to the TFS group "Team Foundation Licensed Users Group":&lt;br /&gt;- In the 'Team Explorer', right click on the TFS Server -&gt; Team Project Settings -&gt; Group Membership&lt;br /&gt;- Add the new user to the following group:&lt;br /&gt;[SERVER]\Team Foundation Licensed Users Group&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-5609023625059817908?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/5609023625059817908/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=5609023625059817908' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/5609023625059817908'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/5609023625059817908'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2009/12/tfs-error-http-code-403-tf53011.html' title='TFS Error: HTTP code 403: TF53011: DOMAIN\USER is not a licensed user.'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-4240616617398153221</id><published>2009-11-22T06:59:00.000-08:00</published><updated>2009-11-22T07:11:27.700-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Scheduled Task'/><title type='text'>Scheduled Task fails: Could not start</title><content type='html'>I just got a new machine for a customer and started to set it up. I've defined multiple scheduled tasks, and I got: "Could not start" error for one of the tasks... &lt;span style="font-weight: bold;"&gt;That specific task was a batch job&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;I've found few resources on the web and solved the problem. I would recommend the following protocol for such an error:&lt;br /&gt;*. Check the log file of the scheduled tasks: open the scheduled tasks in explorer window and select "Advanced"-&gt;"View Log".&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Option 1:&lt;/span&gt;&lt;br /&gt;*. Check the following policy: Control Panel|Admin Tools|Local Security Policy\Local Policies\User Rights Assignments "Log on as a batch job" (also - someone wrote that his problem was that there was a group policy overriding the local computer policy).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Option 2:&lt;/span&gt;&lt;br /&gt;If the error is:&lt;br /&gt;&lt;span style="font-style: italic;"&gt;0x80070005: Access is denied.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;  Try using the Task page Browse button to locate the application.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Try resolving it using the protocol defined &lt;a href="http://www.aspdeveloper.net/tiki-index.php?page=WindowsAdminScheduleTasksFailing"&gt;here&lt;/a&gt;:&lt;br /&gt;*. Check the user you are trying to run as can run the script:&lt;br /&gt;---- Start - Run - RunAs /user:username@domain (Your Command)&lt;br /&gt;*. If it doesn't run, try giving the user privileges:&lt;br /&gt;Cacls c:\windows\system32\cmd.exe /e /g username@domain:r&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-4240616617398153221?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/4240616617398153221/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=4240616617398153221' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/4240616617398153221'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/4240616617398153221'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2009/11/scheduled-task-fails-could-not-start.html' title='Scheduled Task fails: Could not start'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-2471363442127251295</id><published>2009-10-27T00:35:00.000-07:00</published><updated>2009-10-27T00:41:56.586-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Open a new browser tab from ASP.NET control</title><content type='html'>To open a new browser tab from ASP.NET control client side scripting must be used (not ASP.NET OnClick). There are few answers on the web how to do that. Some don't work &amp;amp; some are incomplete. The following works with any browser version I've checked:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;button.Attributes.Add("onclick", "javascript: window.open('your_url','',''); return false;");&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This add a client side event handler "onclick", which overrides the ASP.NET OnClick event. If you put both ASP.NET OnClick event handler &amp;amp; this "onlick" client side handler, only the client side will be executed. You may choose if to add the client side handler at run-time.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-2471363442127251295?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/2471363442127251295/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=2471363442127251295' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/2471363442127251295'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/2471363442127251295'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2009/10/open-new-browser-tab-from-aspnet.html' title='Open a new browser tab from ASP.NET control'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-8775424179504077114</id><published>2009-09-05T11:58:00.001-07:00</published><updated>2009-09-05T12:03:41.061-07:00</updated><title type='text'>Configuring Option GlobeSurfer II</title><content type='html'>For some reason it's hard to find some configurations in this router, here goes for what I needed:&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Port Forwarding&lt;/span&gt;: Connection Settings -&gt; Security -&gt; Port Forwarding&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Static Addresses:&lt;/span&gt; Advanced -&gt; IP Address Distribution -&gt; Connection List&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-8775424179504077114?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/8775424179504077114/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=8775424179504077114' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/8775424179504077114'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/8775424179504077114'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2009/09/configuring-option-globesurfer-ii.html' title='Configuring Option GlobeSurfer II'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-6209090700165044094</id><published>2009-08-26T08:22:00.000-07:00</published><updated>2009-08-26T08:24:32.427-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint'/><category scheme='http://www.blogger.com/atom/ns#' term='IIS'/><title type='text'>SharePoint writes 'Unknown Error'</title><content type='html'>The following post was very helpful:&lt;br /&gt;&lt;a href="http://koenvosters.wordpress.com/2009/08/06/showing-the-real-error-message-in-sharepoint/"&gt; http://koenvosters.wordpress.com/2009/08/06/showing-the-real-error-message-in-sharepoint/&lt;/a&gt; - It Shows how to set the IIS to display the full stack trace.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-6209090700165044094?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/6209090700165044094/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=6209090700165044094' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/6209090700165044094'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/6209090700165044094'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2009/08/sharepoint-writes-unknown-error.html' title='SharePoint writes &apos;Unknown Error&apos;'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-461627365297350428</id><published>2009-08-24T00:29:00.000-07:00</published><updated>2009-08-24T01:28:13.323-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>ASP.NET Error: The resource cannot be found</title><content type='html'>Check the following:&lt;br /&gt;&lt;br /&gt;1. Check that the target resource exists.&lt;br /&gt;&lt;br /&gt;2. Check that ASP.NET is enabled on the IIS:&lt;br /&gt; A. Open: Administrative Tools =&gt; Internet Information Service (IIS) Manager&lt;br /&gt; B. Expand the server, click on 'Web Service Extension'&lt;br /&gt; C. Verify that ASP.NET is set as 'Allowed'. If not, change it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-461627365297350428?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/461627365297350428/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=461627365297350428' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/461627365297350428'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/461627365297350428'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2009/08/aspnet-error-resource-cannot-be-found.html' title='ASP.NET Error: The resource cannot be found'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-8847640930566640749</id><published>2009-08-16T23:30:00.000-07:00</published><updated>2009-08-16T23:39:01.575-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JavaScript'/><category scheme='http://www.blogger.com/atom/ns#' term='MooTools'/><category scheme='http://www.blogger.com/atom/ns#' term='Prototype'/><category scheme='http://www.blogger.com/atom/ns#' term='jQuery'/><title type='text'>Using multiple JavaScript libraries (Prototype, MooTools, jQuery)</title><content type='html'>I'm a fan of &lt;a href="http://mootools.net/"&gt;MooTools&lt;/a&gt; (a JavaScript library), and most of the tools I use are based on  this library. That said, one of the best JS around is &lt;a href="http://www.huddletogether.com/projects/lightbox2/"&gt;LightBox&lt;/a&gt;, which is based on &lt;a href="http://www.prototypejs.org/"&gt;Prototype&lt;/a&gt;. However, when I tried using both MooTools &amp;amp; Prototype libraries in the same webpage it failed. I was sure there's a solution so I kept digging in, but I couldn't find any. &lt;br /&gt;&lt;br /&gt;Another JS library - &lt;a href="http://jquery.com/"&gt;jQuery&lt;/a&gt; has a special computability function called &lt;a href="http://docs.jquery.com/Using_jQuery_with_Other_Libraries"&gt;noConflict &lt;/a&gt;which solves those problems, but both MooTools &amp;amp; Prototype lack that functionality.&lt;br /&gt;&lt;br /&gt;The only solution I could find: Choose one library - MooTools or Prototype, and use only that library. There are similar implementation of most tools in both libraries.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-8847640930566640749?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/8847640930566640749/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=8847640930566640749' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/8847640930566640749'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/8847640930566640749'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2009/08/using-multiple-javascript-libraries.html' title='Using multiple JavaScript libraries (Prototype, MooTools, jQuery)'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-1382431462066105263</id><published>2009-07-19T00:09:00.000-07:00</published><updated>2009-07-19T00:14:47.947-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Cannot resolve the collation conflict between XXXXXXX and YYYYYYYYY in the equal to operation</title><content type='html'>This error indicated that the strings in the join operation are from fields created in different collation. In general, it's better to recreate the fields with the same collation definition, but if you're just too lazy, and want to get things done, just cast to problematic field (in this example it's to 'SQL_Latin1_General_CP1_CI_AS'):&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 153); font-weight: bold;"&gt;SELECT &lt;/span&gt;&lt;span style="font-weight: bold;"&gt;*&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 153); font-weight: bold;"&gt;FROM &lt;/span&gt;&lt;span style="font-weight: bold;"&gt;A, B&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 153); font-weight: bold;"&gt;WHERE&lt;/span&gt;&lt;span style="font-weight: bold;"&gt; A.F1 = B.F1 &lt;/span&gt;&lt;span style="color: rgb(51, 51, 153); font-weight: bold;"&gt;COLLATE &lt;/span&gt;&lt;span style="font-weight: bold;"&gt;SQL_Latin1_General_CP1_CI_AS&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-1382431462066105263?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/1382431462066105263/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=1382431462066105263' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/1382431462066105263'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/1382431462066105263'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2009/07/cannot-resolve-collation-conflict.html' title='Cannot resolve the collation conflict between XXXXXXX and YYYYYYYYY in the equal to operation'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-3886391843268817983</id><published>2009-07-13T12:50:00.000-07:00</published><updated>2009-07-13T12:56:40.367-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='GoDaddy'/><category scheme='http://www.blogger.com/atom/ns#' term='WordPress'/><title type='text'>WordPress &amp; GoDaddy Windows shared hosting</title><content type='html'>Wordpress works just fine in GoDaddy shared Windows hosting (IIS7), however when trying to install a plugin I get:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Downloading install package from http://downloads.wordpress.org/plugin/XXXXXX.zip.&lt;br /&gt;&lt;br /&gt;Warning: touch() [function.touch]: Unable to create file D:\Hosting\XXXXX\html\XXXXXX.com\blog/wp-content/XXXXXX.zip because Permission denied in D:\Hosting\2804923\html\spassets.com\blog\wp-admin\includes\file.php on line 175&lt;br /&gt;&lt;br /&gt;Download failed. Could not create Temporary file&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Solution: since no solution can be found on the web, I used the good old method - manual install:&lt;br /&gt;* Download the package from wordpress&lt;br /&gt;* Uncompress and upload to /wp-content/plugins (I just copied from another wordpress I have).&lt;br /&gt;&lt;br /&gt;And it works!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-3886391843268817983?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/3886391843268817983/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=3886391843268817983' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/3886391843268817983'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/3886391843268817983'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2009/07/wordpress-godaddy-windows-shared.html' title='WordPress &amp; GoDaddy Windows shared hosting'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-7073341652391379446</id><published>2009-07-12T05:45:00.001-07:00</published><updated>2009-07-12T05:50:43.915-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Web.config &amp; GoDaddy.com</title><content type='html'>I wrote a small ASP.NET application, which needed to read the web.config file. To open the Web.config file I used 'OpenWebConfiguration':&lt;br /&gt;WebConfigurationManager.OpenWebConfiguration(...)&lt;br /&gt;&lt;br /&gt;Since GoDaddy uses medium trust, I kept on getting:&lt;br /&gt;'The application attempted to perform an operation not allowed by the security policy'&lt;br /&gt;&lt;br /&gt;And in the detailed:&lt;br /&gt;'System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.&lt;br /&gt;&lt;br /&gt;The resolution - use ConfigurationManager.ConnectionStrings instead.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-7073341652391379446?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/7073341652391379446/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=7073341652391379446' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/7073341652391379446'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/7073341652391379446'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2009/07/webconfig-godaddycom.html' title='Web.config &amp; GoDaddy.com'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-3791127104136442629</id><published>2009-06-29T07:36:00.000-07:00</published><updated>2009-06-29T07:45:22.997-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>Pre-selecting items from CheckBoxList</title><content type='html'>I'm not much of an ASP.NET guy, but from time to time I've got to write some simple ASP.NET pages. &lt;br /&gt;&lt;br /&gt;I've tried to use data-bound CheckBoxList (data binding done with the built-in wizard), and update the data with some pre-selected values. For some reason CheckBoxList Items are not populated when Page_Load function is called, so the list can't be updated.&lt;br /&gt;&lt;br /&gt;Solution A: Found it on Google, but should have thought about it myself - just remove the data-binding done with the VS wizard, and do all the data handling in code.&lt;br /&gt;&lt;br /&gt;Solution B (better): Call 'DataBind()' before pre-selecting the CheckBoxList items.&lt;br /&gt;&lt;br /&gt;Weird. I must be missing something here. Anyway - it's working.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-3791127104136442629?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/3791127104136442629/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=3791127104136442629' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/3791127104136442629'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/3791127104136442629'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2009/06/pre-selecting-items-from-checkboxlist.html' title='Pre-selecting items from CheckBoxList'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-4950234434834478376</id><published>2009-06-23T01:00:00.000-07:00</published><updated>2009-06-23T01:03:48.560-07:00</updated><title type='text'>Generics Dictionary&lt;&gt; clone</title><content type='html'>Here's a simple routine that will clone generic Dictionary:&lt;br /&gt;&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;&lt;br /&gt;&lt;pre class="csharpcode"&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; Dictionary&amp;lt;S, V&amp;gt; Clone&amp;lt;S,V&amp;gt;(Dictionary&amp;lt;S, V&amp;gt; dictionary)&lt;br /&gt;{&lt;br /&gt; Dictionary&amp;lt;S, V&amp;gt; cloneDictionary = &lt;span class="kwrd"&gt;new&lt;/span&gt; Dictionary&amp;lt;S, V&amp;gt;();&lt;br /&gt; &lt;span class="kwrd"&gt;foreach&lt;/span&gt; (KeyValuePair&amp;lt;S, V&amp;gt; kvp &lt;span class="kwrd"&gt;in&lt;/span&gt; dictionary)&lt;br /&gt;   cloneDictionary.Add(kvp.Key, kvp.Value);&lt;br /&gt;&lt;br /&gt; &lt;span class="kwrd"&gt;return&lt;/span&gt; cloneDictionary;&lt;br /&gt;}&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-4950234434834478376?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/4950234434834478376/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=4950234434834478376' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/4950234434834478376'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/4950234434834478376'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2009/06/generics-dictionary-clone.html' title='Generics Dictionary&lt;&gt; clone'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-1823677000991252951</id><published>2009-05-20T21:56:00.000-07:00</published><updated>2009-05-21T22:04:53.915-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint'/><title type='text'>SharePoint Web-part dev problem -  List does not exist</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Problem:&lt;/span&gt;&lt;br /&gt;I was working on a web-part with a custom ASPX file. It was working just fine for the root site of a site collection, but when testing it on a subsite it failed to load the ASPX file with the following exception:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;List does not exist&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;The page you selected contains a list that does not exist.  It may have been deleted by another user. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Solution:&lt;/span&gt;&lt;br /&gt;There are few suggestions that didn't help me on the web. With the good old method - remove everything and check what's making the problem I found the perpetrator: in the ASPX page, I used SharePoint:FormattedStringWithListType, which caused the exception.&lt;br /&gt;&lt;br /&gt;Using reflector I found that FormattedStringWithListType has a property 'List' which opens SPList with the current SPWeb context (list GUID is taken from the request parameter named 'List'). At this point I noticed that when the ASPX file is opened, it is done from the site collection level &amp;amp; not the sub site level.&lt;br /&gt;&lt;br /&gt;From here there are few possible solutions:&lt;br /&gt;*. Open the ASPX file from the subsite level (probably the best solution).&lt;br /&gt;*. Don't use the class FormattedStringWithListType&lt;br /&gt;*. Copy with reflector &amp;amp; fix the problem using SPSite.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-1823677000991252951?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/1823677000991252951/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=1823677000991252951' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/1823677000991252951'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/1823677000991252951'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2009/05/sharepoint-web-part-dev-problem-list.html' title='SharePoint Web-part dev problem -  List does not exist'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-7852872181382247658</id><published>2009-03-28T03:31:00.000-07:00</published><updated>2009-03-28T03:35:01.565-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>Response.Header.Add doesn't work</title><content type='html'>I've tried to use:&lt;br /&gt;Response.Header.Add("HeaderKeyName", "KeyValue")&lt;br /&gt;&lt;br /&gt;But I got the following exception:&lt;br /&gt;System.PlatformNotSupportedException: This operation requires IIS integrated pipeline mode.&lt;br /&gt;at System.Web.HttpResponse.get_Headers()&lt;br /&gt;&lt;br /&gt;The work around:&lt;br /&gt;Response.AddHeader("HeaderKeyName", "KeyValue")&lt;br /&gt;&lt;br /&gt;For the least Microsoft could find a better exception description.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-7852872181382247658?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/7852872181382247658/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=7852872181382247658' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/7852872181382247658'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/7852872181382247658'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2009/03/responseheaderadd-doesnt-work.html' title='Response.Header.Add doesn&apos;t work'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-6880008733041701414</id><published>2009-03-24T07:54:00.000-07:00</published><updated>2009-03-24T08:06:46.150-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='HyperLinkField'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='GridView'/><title type='text'>HyperLinkField not showing as link (ASP.NET)</title><content type='html'>After binding data to a HyperLinkField in a GridView it didn't show as link but as a normal text. Apparently when using navigation by data fields, the data in the fields set in DataNavigateUrlFields must be validated.&lt;br /&gt;&lt;br /&gt;See some more information here:&lt;br /&gt;&lt;a href="http://stackoverflow.com/questions/640120/hyperlinkfield-not-showing-as-link"&gt;http://stackoverflow.com/questions/640120/hyperlinkfield-not-showing-as-link&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I had a problem when the field was a DateTime field returned by a database query. I've change the field format in the following way to make this work (navigation):&lt;br /&gt;[Date] = convert(VARCHAR, [Date],104)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-6880008733041701414?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/6880008733041701414/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=6880008733041701414' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/6880008733041701414'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/6880008733041701414'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2009/03/hyperlinkfield-not-showing-as-link.html' title='HyperLinkField not showing as link (ASP.NET)'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-3772329271260943313</id><published>2009-03-10T05:01:00.000-07:00</published><updated>2009-03-10T09:18:00.105-07:00</updated><title type='text'>You are not authorized to view this page</title><content type='html'>&lt;div&gt;&lt;strong&gt;Symptoms:&lt;/strong&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;One clear morning, on an operational system (Windows 2003 x64, IIS, ASP.NET, SQL Server 2005) running an ASP.NET application, the users started to get request to fill their credentials, and after few times they got:&lt;/div&gt;&lt;div&gt;&lt;em&gt;You are not authorized to view this page&lt;/em&gt;&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;br /&gt;&lt;div&gt;With more specific notification:&lt;/div&gt;&lt;div&gt;&lt;em&gt;HTTP Error 401.1 - Unauthorized: Access is denied due to invalid credentials.Internet Information Services (IIS)&lt;/em&gt;&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;br /&gt;&lt;div&gt;In the event log of the server I found the following errors:&lt;/div&gt;&lt;div&gt;- System Events - I found warning event 1011 titled "W3SVC":&lt;br /&gt;&lt;em&gt;A process serving application pool 'DefaultAppPool' suffered a fatal communication error with the World Wide Web Publishing Service. The process id was '6756'. The data field contains the error number. &lt;/em&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;- Application Events - I found error event 1000 titled ".NET Runtime 2.0 Error Reporting":&lt;br /&gt;&lt;em&gt;Faulting application w3wp.exe, version 6.0.3790.3959, stamp 45d691cc, faulting module kernel32.dll, version 5.2.3790.4062, stamp 462643a7, debug? 0, fault address 0x0000000000027d8d.&lt;/em&gt;&lt;/div&gt;&lt;div&gt;&lt;em&gt;&lt;/em&gt; &lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;strong&gt;Resolution:&lt;/strong&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;I followed few wrong leads on the web, such as:&lt;br /&gt;&lt;/div&gt;&lt;div&gt;- Permissions issue: &lt;a href="http://support.microsoft.com/kb/918041/en-us"&gt;http://support.microsoft.com/kb/918041/en-us&lt;/a&gt;&lt;/div&gt;&lt;div&gt;- SQL Server serface issue: &lt;a href="http://www.sqlnewsgroups.net/group/microsoft.public.sqlserver.server/topic20191.aspx"&gt;http://www.sqlnewsgroups.net/group/microsoft.public.sqlserver.server/topic20191.aspx&lt;/a&gt;&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;br /&gt;&lt;div&gt;After wasting nearly a day a found the root cause:&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;The ASP.NET application had a stack-overflow bug.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;From here fixing is easy.&lt;br /&gt;&lt;br /&gt;The reason that I didn't suspected the ASP.NET application was that the stack-overflow bug was caused by a run time change of the data in the application, and not something new installed/configured.&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-3772329271260943313?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/3772329271260943313/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=3772329271260943313' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/3772329271260943313'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/3772329271260943313'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2009/03/you-are-not-authorized-to-view-this.html' title='You are not authorized to view this page'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-7860857476098832424</id><published>2009-01-26T04:44:00.000-08:00</published><updated>2009-01-26T04:47:49.864-08:00</updated><title type='text'>How to check if the Laptop IR (Infrared) is working</title><content type='html'>This is really cool - open your Cellular phone camera and point it to the laptop IR sensor. The sensor will blink every 3-4 seconds on the cellular camera screen.&lt;br /&gt;&lt;br /&gt;I've been told it also works with remote controls (so you can check the batteries), and I can only guess it's working with any digital camera.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-7860857476098832424?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/7860857476098832424/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=7860857476098832424' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/7860857476098832424'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/7860857476098832424'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2009/01/how-to-check-if-laptop-ir-infrared-is.html' title='How to check if the Laptop IR (Infrared) is working'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-7319288197480784900</id><published>2009-01-25T06:32:00.000-08:00</published><updated>2009-01-25T06:40:39.228-08:00</updated><title type='text'>Windows XP drivers for laptops</title><content type='html'>As I wrote before I've got HP dv6700 which I've installed win2003 on. Few days ago I've finished the project for which I needed that OS, and I've started to install WinXP on this machine. As I found out HP doesn't really says which drivers I should use for Windows XP. I've tried installing drivers similar to the ones they say for Vista (only WinXP version of them) and they didn't realy want to install...&lt;br /&gt;&lt;br /&gt;Anyway, I started to get somewhere only after installing &lt;a href="http://www.sisoftware.co.uk/"&gt;SiSoftware Sandra&lt;/a&gt;. An amazing piece of software that just finds out exactly what kind of hardware you got. With this software I found out in minutes which drivers I should use.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-7319288197480784900?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/7319288197480784900/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=7319288197480784900' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/7319288197480784900'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/7319288197480784900'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2009/01/windows-xp-drivers-for-laptops.html' title='Windows XP drivers for laptops'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-4446518881997090243</id><published>2009-01-08T02:16:00.000-08:00</published><updated>2009-01-08T02:27:54.781-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint'/><category scheme='http://www.blogger.com/atom/ns#' term='WSS'/><category scheme='http://www.blogger.com/atom/ns#' term='WSP'/><category scheme='http://www.blogger.com/atom/ns#' term='MOSS'/><title type='text'>WebPart wsp does not include dependent DLLs</title><content type='html'>I was trying to develop a webpart for SharePoint 2007 &amp;amp; WSS3 using Windows SharePoint Services 3.0 Tools: Visual Studio 2005 Extensions, Version 1.1.&lt;br /&gt;&lt;br /&gt;Everything worked just fine, until I found out that the WSP file created by the add-on does not include dependent DLLs (from other projects in the solution). I could not find any good solution, so finally I had the following options:&lt;br /&gt;&lt;br /&gt;1. In post-build event, use &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=22914587-b4ad-4eae-87cf-b14ae6a939b0&amp;amp;displaylang=en#Overview"&gt;ILMerge &lt;/a&gt;to merge all the DLLs into a single DLL with the name &amp;amp; key file of the webpart, and replace existing DLL with this new merged DLL.&lt;br /&gt;&lt;br /&gt;2. Add the dependent DLL to the project files of the webpart. This way the WSP file includes the dependent DLL. An improvement: add the DLL file in the following directory: bin/Release/ (change the project file with notepad) - this way any new compilation will include the new DLL.&lt;br /&gt;&lt;br /&gt;3. Probably the best option - use a 3rd party tool to create the WSP file - &lt;a href="http://www.codeplex.com/wspbuilder"&gt;WSPBuilder &lt;/a&gt;for example.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-4446518881997090243?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/4446518881997090243/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=4446518881997090243' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/4446518881997090243'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/4446518881997090243'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2009/01/webpart-wsp-does-not-include-dependent.html' title='WebPart wsp does not include dependent DLLs'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-6004096969537657484</id><published>2008-12-18T23:17:00.000-08:00</published><updated>2008-12-18T23:31:48.174-08:00</updated><title type='text'>No audio &amp; 'Unknown PCI Device'</title><content type='html'>I've installed a clean Windows XP on a new computer, using the following steps:&lt;br /&gt;1. Windows XP + SP2 + SP3&lt;br /&gt;2. New computer's drivers&lt;br /&gt;&lt;br /&gt;However after finishing the audio didn't work, I had 'Unknown PCI Device' listed in my device manager and no audio device in the audio devices list. In the system devices there was no Microsoft AAU device.&lt;br /&gt;&lt;br /&gt;I tried many things: check bios settings, update the bios, reinstall RealTek drivers... nothing helped.&lt;br /&gt;&lt;br /&gt;The solution I found on one forum stated that there is a problem with Windows XP SP3 HD Audio driver. F**k. Why Microsoft? WHY?&lt;br /&gt;&lt;br /&gt;Anyhow, the solution that worked for me:&lt;br /&gt;1. Impersonate to WinXP SP2: Change registry key&lt;br /&gt;"HKLM\SYSTEM\CurrentControlSet\Control\Windows\CSDVersion" value to 200&lt;br /&gt;2. Restart&lt;br /&gt;3. Install &lt;a href="http://couponmeister.com/blog/HD_Audio/kb888111xpsp2.exe"&gt;HD_Audio/kb888111xpsp2.exe&lt;/a&gt;&lt;br /&gt;4. Install RealTek HD Audio driver&lt;br /&gt;5. Restart (and check that the audio is now working)&lt;br /&gt;6. Change the CSDVersion key back to XP SP3 again:&lt;br /&gt;"HKLM\SYSTEM\CurrentControlSet\Control\Windows\CSDVersion" value to 300&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-6004096969537657484?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/6004096969537657484/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=6004096969537657484' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/6004096969537657484'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/6004096969537657484'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2008/12/no-audio-unknown-pci-device.html' title='No audio &amp; &apos;Unknown PCI Device&apos;'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-5770005688397511299</id><published>2008-12-17T02:11:00.000-08:00</published><updated>2008-12-19T02:13:52.113-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Qoutes'/><title type='text'>Emerging Markets - Definition</title><content type='html'>"Emerging markets, definition: Markets you can't emerge from in a crisis", &lt;span style="font-style: italic;"&gt;Ron Lubash&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-5770005688397511299?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/5770005688397511299/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=5770005688397511299' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/5770005688397511299'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/5770005688397511299'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2008/12/emerging-markets-definition.html' title='Emerging Markets - Definition'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-8386720846809224263</id><published>2008-11-26T04:40:00.000-08:00</published><updated>2008-12-18T23:16:03.115-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='HP dv6000'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows 2003'/><title type='text'>Can't install Win 2003/XP: not able to detect hard disk</title><content type='html'>I've tried to install Windows 2003 on my HP dv6000, and I got the following error: "not able to detect hard disk". &lt;br /&gt;&lt;br /&gt;I found few people with the same problem, but no answer. Only after searching for Windows XP installation issues I found the solution: disable the native SATA support in the BIOS.&lt;br /&gt;&lt;br /&gt;Problem: on some computers (including HP dv6000) there's no way to disable native SATA support... grrr...&lt;br /&gt;&lt;br /&gt;Bypass: how to add SATA driver to the Windows installation disk &lt;a href="http://news.softpedia.com/news/Install-Windows-XP-On-SATA-Without-a-Floppy-F6-47807.shtml"&gt;see here&lt;/a&gt;. (Specifically, HP SATA drivers from my computer found &lt;a href="http://h20000.www2.hp.com/bizsupport/TechSupport/SoftwareDescription.jsp?lang=en&amp;cc=us&amp;prodTypeId=321957&amp;prodSeriesId=3368538&amp;swItem=ob-54270-1&amp;mode=4&amp;idx=1"&gt;here&lt;/a&gt;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-8386720846809224263?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/8386720846809224263/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=8386720846809224263' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/8386720846809224263'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/8386720846809224263'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2008/11/cant-install-win2003-not-able-to-detect.html' title='Can&apos;t install Win 2003/XP: not able to detect hard disk'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-7741682956493645074</id><published>2008-11-26T02:13:00.000-08:00</published><updated>2008-12-19T02:21:24.276-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Quotes'/><title type='text'>Business Plan</title><content type='html'>"Business plans are a branch of science fiction. In classic science fiction the focus is on words, in the business plans the focus is on numbers", &lt;span style="font-style: italic;"&gt;Yossi Vardi&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;"Business plan is like a sausage, you'll eat it only if you don't know how it was prepared", &lt;span style="font-style: italic;"&gt;Yossi Vardi&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-7741682956493645074?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/7741682956493645074/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=7741682956493645074' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/7741682956493645074'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/7741682956493645074'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2008/11/business-plan.html' title='Business Plan'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-6963048374539627234</id><published>2008-11-18T23:28:00.000-08:00</published><updated>2009-11-18T23:30:34.204-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='parser'/><category scheme='http://www.blogger.com/atom/ns#' term='GPEH'/><category scheme='http://www.blogger.com/atom/ns#' term='XML'/><title type='text'>GPEH to XML, GPEH Parser</title><content type='html'>I was looking around for a GPEH parser, or even GPEH to XML converter but I couldn't find one any where. Anyone?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-6963048374539627234?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/6963048374539627234'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/6963048374539627234'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2008/11/gpeh-to-xml-gpeh-parser.html' title='GPEH to XML, GPEH Parser'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-6305380748216419682</id><published>2008-10-26T02:11:00.000-07:00</published><updated>2009-01-04T22:40:00.682-08:00</updated><title type='text'>How to get ERD Commander to boot from USB</title><content type='html'>Here's the best resource I've found:&lt;br /&gt;&lt;a href="http://forum.xatrix.org/viewtopic.php?f=26&amp;amp;p=9323"&gt;http://forum.xatrix.org/viewtopic.php?f=26&amp;amp;p=9323&lt;/a&gt;, however it didn't work for me.&lt;br /&gt;&lt;br /&gt;After some tests I found the problem - since I'm using a 4GB USB drive, I had to check the 'LBA' checkbox in the PE2USB application.&lt;br /&gt;&lt;br /&gt;Summary:&lt;br /&gt;1. Download PE2UDB&lt;br /&gt;2. Download ERD Commander 2005 &amp;amp; extract the files from the ISO (I use 7zip).&lt;br /&gt;3. Create the USB bootable system using PE2USB:&lt;br /&gt;*** Select destination drive&lt;br /&gt;*** Check 'Enable Disk Format'&lt;br /&gt;*** Set 'Disk Label' to 'CD'&lt;br /&gt;*** Check 'Enable LBA' for USB drives larger than ? (I think 1G).&lt;br /&gt;*** Check 'Enable File Copy' and select the source folder (of the ERD Commander files). &lt;br /&gt;*** Click start&lt;br /&gt;&lt;br /&gt;Have fun!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-6305380748216419682?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/6305380748216419682'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/6305380748216419682'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2008/10/how-to-create-erd-commander-to-boot.html' title='How to get ERD Commander to boot from USB'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-3702844522537044023</id><published>2008-09-05T22:50:00.000-07:00</published><updated>2008-09-05T23:01:25.982-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Chrome'/><title type='text'>Creating add-ons/toolbars for Google Chrome</title><content type='html'>I was looking for information how to write an add-on for Google Chrome, and while looking I couldn't find any information on this subject (the was &lt;a href="http://chromeaddons.wordpress.com/2008/09/03/how-to-create-google-chrome-addons/"&gt;this calculator&lt;/a&gt; JavaScript, but that's not an add-on).&lt;br /&gt;&lt;br /&gt;After a while I've decided to try and dig in Chrome's code, however, even before doing that I found the answer in the Google Code repository of Chrome:&lt;br /&gt;&lt;br /&gt;Q. How can I develop extensions for Chromium like in Firefox?&lt;br /&gt;A. Chromium doesn't have an extension system yet. This is something we're interested in adding in a future version. Note that Chromium does support NPAPI-style "plugins", such as Adobe Flash and Apple QuickTime.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://dev.chromium.org/developers/faq"&gt;See the original FAQ here&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-3702844522537044023?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/3702844522537044023/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=3702844522537044023' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/3702844522537044023'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/3702844522537044023'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2008/09/creating-add-ons-for-google-chrome.html' title='Creating add-ons/toolbars for Google Chrome'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-8557404307540096575</id><published>2008-09-03T01:11:00.000-07:00</published><updated>2008-09-03T01:20:14.713-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Fixed aspect ratio in C# window</title><content type='html'>I needed to create a window with a fixed aspect ratio (for video), and I wanted that the resize frame will change with the user cursor drag.&lt;br /&gt;&lt;br /&gt;I came around with this &lt;a href="http://bytes.com/forum/thread231885.html"&gt;post&lt;/a&gt;. Which is almost perfect, but when you drag the left or upper bounds you get the window moving... Here is the fixed code:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;#region Keep video window aspect ratio&lt;br /&gt;[StructLayout(LayoutKind.Sequential)]&lt;br /&gt;public struct RECT&lt;br /&gt;{&lt;br /&gt;    public int Left;&lt;br /&gt;    public int Top;&lt;br /&gt;    public int Right;&lt;br /&gt;    public int Bottom;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public class MyRect&lt;br /&gt;{&lt;br /&gt;    public int Left;&lt;br /&gt;    public int Top;&lt;br /&gt;    public int Right;&lt;br /&gt;    public int Bottom;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public const int WM_SIZING = 0x0214;&lt;br /&gt;int _lastWidth = 0;&lt;br /&gt;MyRect _lastRect = null;&lt;br /&gt;double _aspectRatio = 0.5;&lt;br /&gt;&lt;br /&gt;protected override void WndProc(ref Message m)&lt;br /&gt;{&lt;br /&gt;    if (m.Msg == WM_SIZING)&lt;br /&gt;    {&lt;br /&gt;        RECT rc;&lt;br /&gt;        rc = (RECT)Marshal.PtrToStructure(m.LParam, typeof(RECT));&lt;br /&gt;&lt;br /&gt;        if (_lastRect == null)&lt;br /&gt;        {&lt;br /&gt;            _lastRect = new MyRect();&lt;br /&gt;            _lastRect.Top = rc.Top;&lt;br /&gt;            _lastRect.Bottom = rc.Bottom;&lt;br /&gt;            _lastRect.Left = rc.Left ;&lt;br /&gt;            _lastRect.Right = rc.Right;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        if (rc.Right - rc.Left != _lastWidth)&lt;br /&gt;        {&lt;br /&gt;            double newHeight = ((double)(rc.Right - rc.Left)) &lt;br /&gt;                                   / _aspectRatio;&lt;br /&gt;            rc.Bottom = (int)newHeight + _lastRect.Top;&lt;br /&gt;            Marshal.StructureToPtr(rc, m.LParam, true);&lt;br /&gt;        }&lt;br /&gt;        else&lt;br /&gt;        {&lt;br /&gt;            double newWidth = ((double)(rc.Bottom - rc.Top)) &lt;br /&gt;                                  * _aspectRatio;&lt;br /&gt;&lt;br /&gt;            rc.Right = (int)newWidth + _lastRect.Left;&lt;br /&gt;            Marshal.StructureToPtr(rc, m.LParam, true);&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        _lastWidth = rc.Right - rc.Left;&lt;br /&gt;        _lastRect.Top = rc.Top;&lt;br /&gt;        _lastRect.Bottom = rc.Bottom;&lt;br /&gt;        _lastRect.Left = rc.Left;&lt;br /&gt;        _lastRect.Right = rc.Right;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    base.WndProc(ref m);&lt;br /&gt;}&lt;br /&gt;#endregion&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-8557404307540096575?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/8557404307540096575/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=8557404307540096575' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/8557404307540096575'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/8557404307540096575'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2008/09/fixed-aspect-ratio-in-c-window.html' title='Fixed aspect ratio in C# window'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-4730680013077840837</id><published>2008-07-06T01:35:00.000-07:00</published><updated>2008-07-06T01:48:30.638-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='administration'/><title type='text'>Deleting locked VSP files</title><content type='html'>Few days ago I found huge VSP files on one of my servers. I found out that those files are temporary files of a symantec backup software. For some reason, from time to time the backup application does not delete it's temporary files.&lt;br /&gt;&lt;br /&gt;When I tried to delete the files I couldn't do it - "File is used by another process" or something like that.&lt;br /&gt;&lt;br /&gt;DISCLAIMER: Do the following procedure on your own risk. The writer of this blog takes zero (0) responsibility.&lt;br /&gt;&lt;br /&gt;To bypass it I used the procedure to delete locked files (without restart):&lt;br /&gt;1. Start &lt;a href="http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx"&gt;Process Explorer&lt;/a&gt; by Microsoft/SysInternals(no need for installation, just copy the EXE file to the target machine).&lt;br /&gt;2. Make sure the lower panel is visible: View -&gt; Lower Pane View -&gt; Handles&lt;br /&gt;3. In the process tree select "System"&lt;br /&gt;4. Sort the lower pane by Name, and find the VSP file lock (since the pane is sorted by name, it should be easy to find it by 'e:\WhatEverFileName.vsp')&lt;br /&gt;5. Right-click the record in the lower pane and select "Close Handle".&lt;br /&gt;6. Delete the file.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-4730680013077840837?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/4730680013077840837/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=4730680013077840837' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/4730680013077840837'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/4730680013077840837'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2008/07/deleting-locked-vsp-files.html' title='Deleting locked VSP files'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-6916533006876443074</id><published>2008-04-17T03:13:00.000-07:00</published><updated>2008-04-17T03:22:35.952-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='trouble shooting'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>int.Parse throws FormatException without a reason</title><content type='html'>For few days I've tried to debug a client's problem - int.Parse kept on throwing FormatException when everything was OK.&lt;br /&gt;&lt;br /&gt;Finally I found &lt;a href="http://bartdesmet.net/blogs/bart/archive/2005/12/06/3792.aspx"&gt;this &lt;/a&gt; post, which says - check the regional settings:&lt;br /&gt;Registry: HKEY_CURRENT_USER\Control Panel\International &lt;br /&gt;Key: sPositiveSign (and the negative one).&lt;br /&gt;&lt;br /&gt;My client checked both and they were just fine, but I've decided to write my own int.Parse which does this following:&lt;br /&gt;&lt;br /&gt;if (str == "0")&lt;br /&gt;  return 0;&lt;br /&gt;else&lt;br /&gt;  return int.Parse(str);&lt;br /&gt;&lt;br /&gt;This fixed everything (I did the same for double.Parse too).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-6916533006876443074?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/6916533006876443074/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=6916533006876443074' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/6916533006876443074'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/6916533006876443074'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2008/04/intparse-throws-formatexception-without.html' title='int.Parse throws FormatException without a reason'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5503003700585906386.post-1160678797790587331</id><published>2008-04-04T23:35:00.000-07:00</published><updated>2008-11-13T09:14:09.216-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='AJAX'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>Hiding/disabling UpdatePanel during update</title><content type='html'>One of the most common tasks in AJAX is disabling UpdatePanel during AJAX call, i.e:&lt;br /&gt;&lt;br /&gt;&lt;img id="BLOGGER_PHOTO_ID_5185648919214040898" alt="" src="http://1.bp.blogspot.com/_77SCNIL_wPM/R_cgN5-kJ0I/AAAAAAAAACA/8hPId_9ID7E/s320/hide.gif" border="0" /&gt;&lt;br /&gt;&lt;br /&gt;I expected UpdateProgress to do just that. It doesn't. I searched to web but I only found patches that forced using JavaScript with-in my pages.&lt;br /&gt;&lt;br /&gt;Finally I found this (from which I took the image above):&lt;br /&gt;&lt;a href="http://www.codeplex.com/FlanAjaxControls"&gt;http://www.codeplex.com/FlanAjaxControls&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Open source, Ajax.Net only extender, that lets you disable the UpdatePanel and display the UpdateProgress over the disabled control during the update. No JavaScript, just add the control and CSS style.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5503003700585906386-1160678797790587331?l=sagistech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagistech.blogspot.com/feeds/1160678797790587331/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5503003700585906386&amp;postID=1160678797790587331' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/1160678797790587331'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5503003700585906386/posts/default/1160678797790587331'/><link rel='alternate' type='text/html' href='http://sagistech.blogspot.com/2008/04/hidingdisabling-updatepanel-during.html' title='Hiding/disabling UpdatePanel during update'/><author><name>Sagi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_77SCNIL_wPM/R_cgN5-kJ0I/AAAAAAAAACA/8hPId_9ID7E/s72-c/hide.gif' height='72' width='72'/><thr:total>0</thr:total></entry></feed>
