<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Droidin&#039; out</title>
	<atom:link href="http://qtcstation.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://qtcstation.com</link>
	<description>tips and tricks from an android developer</description>
	<lastBuildDate>Sun, 29 Apr 2012 00:37:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>How to properly use the viewHolder pattern on a listView adapter with multiple viewTypes.</title>
		<link>http://qtcstation.com/2012/04/a-limitation-with-the-viewholder-pattern-on-listview-adapters/</link>
		<comments>http://qtcstation.com/2012/04/a-limitation-with-the-viewholder-pattern-on-listview-adapters/#comments</comments>
		<pubDate>Fri, 27 Apr 2012 05:29:27 +0000</pubDate>
		<dc:creator>noslen</dc:creator>
				<category><![CDATA[android]]></category>
		<category><![CDATA[general]]></category>

		<guid isPermaLink="false">http://qtcstation.com/?p=422</guid>
		<description><![CDATA[The viewHolder pattern is great for making your listViews feel more responsive. Examples abound. It seems to work great up until you start doing more complex things with it. Things can get a bit tricky once you have more than viewType that your adapter needs to provide. Consider this code: package com.oner.test; import android.app.Activity; import [...]]]></description>
			<content:encoded><![CDATA[<p>The viewHolder pattern is great for making your listViews feel more responsive. Examples abound.<br />
It seems to work great up until you start doing more complex things with it. Things can get a bit tricky once you have more than viewType that your adapter needs to provide.<br />
Consider this code:</p>
<pre class="brush:java">

package com.oner.test;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ListView;
import android.widget.TextView;

public class Adapter_testActivity extends Activity {
	private ListView mListView;

	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);

		mListView = (ListView) findViewById(android.R.id.list);
		mListView.setAdapter(new AdapterTest((Context) this));
	}

	private class AdapterTest extends BaseAdapter {
		String[] items = { "a", "b", "c", "d", "e", "a", "b", "c", "d", "e",
				"a", "b", "c", "d", "e", "a", "b", "c", "d", "e", "a", "b",
				"c", "d", "e", "a", "b", "c", "d", "e", "a", "b", "c", "d", "e" };
		private Context mContext;
		private LayoutInflater inflater;

		public AdapterTest(final Context context) {
			mContext = context;
			inflater = LayoutInflater.from(mContext);
		}

		@Override
		public int getCount() {
			return items.length;
		}

		@Override
		public Object getItem(int position) {
			return items[position];
		}

		@Override
		public long getItemId(int position) {
			return position;
		}

		@Override
		public View getView(int position, View convertView, ViewGroup parent) {
			View v = convertView;
			ViewHolder holder;

			int type = getItemViewType(position);
			Log.d("Adapter test","setting type:"+type);
			if (v == null) {

				holder = new ViewHolder();
				if (type == 0) {
					v = inflater.inflate(R.layout.item_type_one, null);
					holder.txtOne = (TextView) v.findViewById(R.id.txt_one);
				}else if(type ==1){
					v = inflater.inflate(R.layout.item_type_two, null);
					holder.txtTwo = (TextView) v.findViewById(R.id.txt_two);
				}
				else {
					v = inflater.inflate(R.layout.item_type_three, null);
					holder.txtThree = (TextView) v.findViewById(R.id.txt_three);
				}
				holder.type = type;
				v.setTag(holder);
			} else {
				holder = (ViewHolder) v.getTag();
				Log.d("Adapter test", " holder ::" + holder);
			}
                        String item = (String) getItem(position);
			if (item != null) {
				if (type == 0) {
					holder.txtOne.setText(item);

				} else if(type ==1 ) {
					holder.txtTwo.setText(item);
				}else{
					holder.txtThree.setText(item);
				}

			}
			return v;

		}

		@Override
		public int getItemViewType(int position) {
                        String item = (String) getItem(position);
                        if(item.equals("a"))return =0;
			else if(item.equals("b"))return=1;
			else   (item.equals("c"))return=2;
		}

		@Override
		public int getViewTypeCount() {
			return 3;
		}

	}

	static class ViewHolder {
		public int type;
		TextView txtOne;
		TextView txtTwo;
		TextView txtThree;
		@Override
		public String toString() {
			return "ViewHolder [type=" + type + ", txtOne=" + txtOne
					+ ", txtTwo=" + txtTwo + ", txtThree=" + txtThree + "]";
		}

	}
}
</pre>
<p>For the purposes of this example the list items being inflated all contain the same TextView with just a different id. I'm sure you get the idea.<br />
Here's what the layout for the items looks like in case you're feeling lazy.</p>
<pre class="brush:xml">

<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/txt_one"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    />
</pre>
<p>The listView will keep a cache of every view type you give it. The trick to avoid problems is to make sure that you properly implement getViewItemType().</p>
<pre class="brush:java">
                @Override
		public int getItemViewType(int position) {
                        String item = (String) getItem(position);
                        if(item.equals("a"))return =0;
			else if(item.equals("b"))return=1;
			else   (item.equals("c"))return=2;
		}
</pre>
<p>A common mistake (my first mistake) was to implement that logic inside of getView instead of getItemViewType. Prior to getting one of the view types out of it's cache the listView will call getItemViewType for its cache lookup, so you need to make sure it knows how to do so. Also make sure that your getItemId return something other than just 0. This will also make sure things work smoothly. </p>
<p>In my example I determine the item type by looking at the data.<br />
After that it's a simply matter of looking at the type to re-populate the viewHolder. </p>
<p>I hope this helps. Thanks to Simon and Noah for helping me work through the problems. </p>
]]></content:encoded>
			<wfw:commentRss>http://qtcstation.com/2012/04/a-limitation-with-the-viewholder-pattern-on-listview-adapters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>eclipse &#8211; autocomplete has stopped working with android sdk</title>
		<link>http://qtcstation.com/2012/04/eclipse-autocomplete-has-stopped-working-with-android-sdk/</link>
		<comments>http://qtcstation.com/2012/04/eclipse-autocomplete-has-stopped-working-with-android-sdk/#comments</comments>
		<pubDate>Wed, 11 Apr 2012 03:05:59 +0000</pubDate>
		<dc:creator>noslen</dc:creator>
				<category><![CDATA[general]]></category>

		<guid isPermaLink="false">http://qtcstation.com/?p=419</guid>
		<description><![CDATA[After my recent update to the latest ADT the autocomplete features of eclipse suddenly stopped working. Luckily a quick search lead to the indispensable stackoverflow. The way to fix it is to go to: Window -> Preferences -> Java -> Editor -> Content Assist -> Advanced And check the boxes labeled "Java Proposals" and hit [...]]]></description>
			<content:encoded><![CDATA[<p>After my recent update to the latest ADT the autocomplete features of eclipse suddenly stopped working.<br />
Luckily a quick search lead to the indispensable stackoverflow.</p>
<p>The way to fix it is to go to:<br />
Window -> Preferences -> Java -> Editor -> Content Assist -> Advanced</p>
<p>And check the boxes labeled "Java Proposals" and hit Apply.</p>
<p>Thanks to <a href="http://stackoverflow.com/users/935798/dchimento">dchimento</a> for the answer.</p>
<p>Link to the question / answer here:</p>
<p><a href='http://stackoverflow.com/questions/5916026/autocomplete-has-stopped-working-with-android-sdk'>eclipse - autocomplete has stopped working with android sdk - Stack Overflow</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://qtcstation.com/2012/04/eclipse-autocomplete-has-stopped-working-with-android-sdk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Gmail Public Labels API &#124; Android Developers Blog</title>
		<link>http://qtcstation.com/2012/04/the-gmail-public-labels-api-android-developers-blog/</link>
		<comments>http://qtcstation.com/2012/04/the-gmail-public-labels-api-android-developers-blog/#comments</comments>
		<pubDate>Wed, 04 Apr 2012 22:25:25 +0000</pubDate>
		<dc:creator>noslen</dc:creator>
				<category><![CDATA[general]]></category>

		<guid isPermaLink="false">http://qtcstation.com/?p=416</guid>
		<description><![CDATA[This is pretty cool. I'm gonna have to play with it. The Gmail Public Labels API &#124; Android Developers Blog.]]></description>
			<content:encoded><![CDATA[<p>This is pretty cool. I'm gonna have to play with it. </p>
<p><a href='http://android-developers.blogspot.com/2012/04/gmail-public-labels-api.html'>The Gmail Public Labels API | Android Developers Blog</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://qtcstation.com/2012/04/the-gmail-public-labels-api-android-developers-blog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to find unused resources in your Android project</title>
		<link>http://qtcstation.com/2012/02/how-to-find-unused-resources-in-your-android-project/</link>
		<comments>http://qtcstation.com/2012/02/how-to-find-unused-resources-in-your-android-project/#comments</comments>
		<pubDate>Tue, 07 Feb 2012 18:57:06 +0000</pubDate>
		<dc:creator>noslen</dc:creator>
				<category><![CDATA[android]]></category>

		<guid isPermaLink="false">http://qtcstation.com/?p=413</guid>
		<description><![CDATA[Design changes! They happen all the time. At least they do on our project, and let's face it, designers don't always stick to naming conventions meant to prevent asset duplication. In any case, i'm not casting blame. Orphaned resources happen pretty easily. Luckily there's a great tool to help you keep track of the stuff [...]]]></description>
			<content:encoded><![CDATA[<p>Design changes!<br />
They happen all the time. At least they do on our project, and let's face it, designers don't always stick to naming conventions meant to prevent asset duplication.<br />
In any case, i'm not casting blame. Orphaned resources happen pretty easily. Luckily there's a great tool to help you keep track of the stuff in your project that's not being used.<br />
With it you can find unused strings in your android project.<br />
Find unused raw assets in your android project.<br />
Find unused drawables in your android project.<br />
Find unused layouts in your android project. </p>
<p>Check it out!<br />
android-unused-resources - Android Unused Resource Detector - Google Project Hosting</p>
<p><a href='http://code.google.com/p/android-unused-resources/'>android-unused-resources - Android Unused Resource Detector - Google Project Hosting</a>.</p>
<p>It does have some imperfections. You'll sometimes get false positives. For example:<br />
If you're getting a dynamic reference to a resource, this tool won't catch that (not that I would expect it to). But that's just a minor thing.<br />
Anyway thanks @google!</p>
]]></content:encoded>
			<wfw:commentRss>http://qtcstation.com/2012/02/how-to-find-unused-resources-in-your-android-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>++dave;: Cucumber for Android!</title>
		<link>http://qtcstation.com/2012/01/dave-cucumber-for-android/</link>
		<comments>http://qtcstation.com/2012/01/dave-cucumber-for-android/#comments</comments>
		<pubDate>Tue, 03 Jan 2012 23:47:57 +0000</pubDate>
		<dc:creator>noslen</dc:creator>
				<category><![CDATA[general]]></category>

		<guid isPermaLink="false">http://qtcstation.com/?p=404</guid>
		<description><![CDATA[Very useful post that's helping us probe the mysteries of android + cucumber. ++dave;: Cucumber for Android!.]]></description>
			<content:encoded><![CDATA[<p>Very useful post that's helping us probe the mysteries of android + cucumber.</p>
<p><a href='http://www.davidshah.com/2011/11/cucumber-for-android.html#comment-form'>++dave;: Cucumber for Android!</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://qtcstation.com/2012/01/dave-cucumber-for-android/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Install Ice Cream Sandwich ROM on Motorola Droid X</title>
		<link>http://qtcstation.com/2012/01/how-to-install-ice-cream-sandwich-rom-on-motorola-droid-x/</link>
		<comments>http://qtcstation.com/2012/01/how-to-install-ice-cream-sandwich-rom-on-motorola-droid-x/#comments</comments>
		<pubDate>Tue, 03 Jan 2012 18:47:22 +0000</pubDate>
		<dc:creator>noslen</dc:creator>
				<category><![CDATA[android]]></category>

		<guid isPermaLink="false">http://qtcstation.com/?p=402</guid>
		<description><![CDATA[I fully intend to do this in the near future, so I wanted to post it here to remind me. How to Install Ice Cream Sandwich ROM on Motorola Droid X.]]></description>
			<content:encoded><![CDATA[<p>I fully intend to do this in the near future, so I wanted to post it here to remind me. </p>
<p><a href='http://www.androidauthority.com/how-to-install-ice-cream-sandwich-rom-on-motorola-droid-x-40674/'>How to Install Ice Cream Sandwich ROM on Motorola Droid X</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://qtcstation.com/2012/01/how-to-install-ice-cream-sandwich-rom-on-motorola-droid-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to control orientation changes for fragments in a FragmentActivity with multiple fragments</title>
		<link>http://qtcstation.com/2011/12/fragment-activities-with-multiple-fragments/</link>
		<comments>http://qtcstation.com/2011/12/fragment-activities-with-multiple-fragments/#comments</comments>
		<pubDate>Tue, 13 Dec 2011 22:51:53 +0000</pubDate>
		<dc:creator>noslen</dc:creator>
				<category><![CDATA[general]]></category>

		<guid isPermaLink="false">http://qtcstation.com/?p=393</guid>
		<description><![CDATA[I wasted several hours trying to fix this problem so once again i'm paying it forward in the hope it's helpful to someone else. The problem is that it's difficult to control configuration changes in a fragment activity with multiple fragments when you need fragments to behave differently. Here is my scenario: I have a [...]]]></description>
			<content:encoded><![CDATA[<p>I wasted several hours trying to fix this problem so once again i'm paying it forward in the hope it's helpful to someone else.</p>
<p>The problem is that it's difficult to control configuration changes in a fragment activity with multiple fragments when you need fragments to behave differently. </p>
<p>Here is my scenario:<br />
I have a fragment activity that displays different fragments one at a time. The first fragment displayed is not allowed to change orientation, it must be locked in portrait.<br />
However the next fragment I show in the same activity needs to be able to change on both portrait and landscape orientations.</p>
<p>Sure I could have just rewritten my code to have the other fragment start in a different activity but that's besides the point.</p>
<p>Anyway, what you have to do is make sure you can get configuration changes</p>
<h2>Manifest code:</h2>
<pre class="brush:xml">
<!--

-->
<activity android:name=".MyFragmentActivity" android:label="@string/app_name"
			android:configChanges="orientation"/>
</pre>
<h2>Activity code:</h2>
<pre class="brush:java">
//
//
	@Override
	public void onConfigurationChanged(Configuration newConfig) {

		if(fragment!=null &#038;& fragment.isResumed()){
			//do nothing here if we're showing the fragment
		}else{
			setRequestedOrientation(Configuration.ORIENTATION_PORTRAIT); // otherwise lock in portrait
		}
		super.onConfigurationChanged(newConfig);
	}
</pre>
<p>The code above doesn't work by itself. You would think so but there's a problem where you never receive more onConfigurationChanged callbacks after you call setRequestedOrientation.</p>
<p>Luckily we can take advantage of the lifecycle of our fragment to help our activity get out of it's funk.<br />
When our fragment resumes we can do the following:</p>
<h2>Fragment code:</h2>
<pre class="brush:java">
//
//
@Override
	public void onResume() {
		getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR);
..}
</pre>
<p>I also make sure that my activity goes back to portrait mode if I exit this fragment.</p>
<pre class="brush:java">
//
//
	@Override
	public void onPause() {
		getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); // set the activity back to //whatever it needs to be when going back.
		super.onPause();
	}
</pre>
<p>This ensures that the activity can go back to being stubborn about orientation changes while letting an individual fragment take over configuration changes while it's active.<br />
I hope this is helpful! cheers!</p>
]]></content:encoded>
			<wfw:commentRss>http://qtcstation.com/2011/12/fragment-activities-with-multiple-fragments/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hot Text is released!</title>
		<link>http://qtcstation.com/2011/11/hot-text-is-released/</link>
		<comments>http://qtcstation.com/2011/11/hot-text-is-released/#comments</comments>
		<pubDate>Sun, 27 Nov 2011 22:50:03 +0000</pubDate>
		<dc:creator>noslen</dc:creator>
				<category><![CDATA[android]]></category>

		<guid isPermaLink="false">http://qtcstation.com/?p=388</guid>
		<description><![CDATA[Hi, I'm pleased to announce the release of Hot Text on the Android Market! This is my first personal app. It was especially fun because I worked on it with my beautiful wife and the help of her awesome sister! I'm real proud of this one and I hope you all enjoy it :) https://market.android.com/details?id=com.qtcstation&#038;feature=search_result#?t=W251bGwsMSwyLDEsImNvbS5xdGNzdGF0aW9uIl0. [...]]]></description>
			<content:encoded><![CDATA[<p>Hi,<br />
I'm pleased to announce the release of Hot Text on the Android Market!<br />
This is my first personal app. It was especially fun because I worked on it with my beautiful wife and the help of her awesome sister!</p>
<p>I'm real proud of this one and I hope you all enjoy it :) </p>
<p><a href="https://market.android.com/details?id=com.qtcstation&#038;feature=search_result#?t=W251bGwsMSwyLDEsImNvbS5xdGNzdGF0aW9uIl0. ">https://market.android.com/details?id=com.qtcstation&#038;feature=search_result#?t=W251bGwsMSwyLDEsImNvbS5xdGNzdGF0aW9uIl0.</a></p>
<p><img src="http://qrcode.kaywa.com/img.php?s=6&#038;d=https%3A%2F%2Fmarket.android.com%2Fdetails%3Fid%3Dcom.qtcstation%26feature%3Dsearch_result%23%3Ft%3DW251bGwsMSwyLDEsImNvbS5xdGNzdGF0aW9uIl0.%20" alt="qrcode"  /></p>
<p>cheers!</p>
]]></content:encoded>
			<wfw:commentRss>http://qtcstation.com/2011/11/hot-text-is-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Properly Set SVN svn:externals Property In SVN Command Line</title>
		<link>http://qtcstation.com/2011/11/how-to-properly-set-svn-svnexternals-property-in-svn-command-line/</link>
		<comments>http://qtcstation.com/2011/11/how-to-properly-set-svn-svnexternals-property-in-svn-command-line/#comments</comments>
		<pubDate>Thu, 17 Nov 2011 15:51:44 +0000</pubDate>
		<dc:creator>noslen</dc:creator>
				<category><![CDATA[android]]></category>

		<guid isPermaLink="false">http://qtcstation.com/?p=384</guid>
		<description><![CDATA[&#160; &#160; How To Properly Set SVN svn:externals Property In SVN Command Line. Wanted to shout out to this post now that it's the third or fourth time I end up using it as reference while messing around w/ svn externals. Thanks Artem Russakovskii!]]></description>
			<content:encoded><![CDATA[<p>&nbsp;</p>
<p>&nbsp;</p>
<p><a href="http://beerpla.net/2009/06/20/how-to-properly-set-svn-svnexternals-property-in-svn-command-line/">How To Properly Set SVN svn:externals Property In SVN Command Line</a>.</p>
<p>Wanted to shout out to this post now that it's the third or fourth time I end up using it as reference while messing around w/ svn externals.</p>
<p>Thanks Artem Russakovskii!</p>
]]></content:encoded>
			<wfw:commentRss>http://qtcstation.com/2011/11/how-to-properly-set-svn-svnexternals-property-in-svn-command-line/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configuring Charles Web Debugger to work with Android devices and emulator</title>
		<link>http://qtcstation.com/2011/09/configuring-charles-web-debugger-to-work-with-android-devices-and-emulator/</link>
		<comments>http://qtcstation.com/2011/09/configuring-charles-web-debugger-to-work-with-android-devices-and-emulator/#comments</comments>
		<pubDate>Thu, 29 Sep 2011 06:54:47 +0000</pubDate>
		<dc:creator>noslen</dc:creator>
				<category><![CDATA[android]]></category>

		<guid isPermaLink="false">http://qtcstation.com/?p=374</guid>
		<description><![CDATA[Quite a mouthful eh? During my web days I became very attached to Charles as part of my development toolset. It was a sad day when I discovered it was difficult to get it to work with either the emulator, much less a phone. My first attempt circa Android Froyo (2.2) yielded no success. It's [...]]]></description>
			<content:encoded><![CDATA[<p>Quite a mouthful eh?</p>
<p>During my web days I became very attached to <a href="http://www.charlesproxy.com/">Charles</a> as part of my development toolset. It was a sad day when I discovered it was difficult to get it to work with either the emulator, much less a phone.</p>
<p>My first attempt circa Android Froyo (2.2) yielded no success. It's still doable but you have to root your phone and download an app from the market. It was a bit frustrating given that the Charles documentation didn't provide a lot of insight. </p>
<p>A second attempt led me to try again on two Motorola phones running 2.3. It turns out that it is now possible to set a proxy when connecting to a wifi access point!!!<br />
Oh happy day!</p>
<p>This means that we can have our phone point to the IP address of the computer running Charles. And just like magic Charles works!</p>
<p>First let's look at how to configure a phone, since it's easiest. Then we'll look at getting the emulator to work.</p>
<p>&nbsp;</p>
<h2>Configuring your android device to work with Charles.</h2>
<h3><strong>Step 1:</strong><br />
Connect to your Wifi.</h3>
<p>(note that your device and your machine running Charles need to be on the same network)<br />
<div id="attachment_375" class="wp-caption aligncenter" style="width: 391px"><a href="http://qtcstation.com/wp-content/uploads/2011/09/proxy.png"><img class="size-full wp-image-375 " title="proxy" src="http://qtcstation.com/wp-content/uploads/2011/09/proxy.png" alt="" width="381" height="672" /></a><p class="wp-caption-text">Proxy settings on a Motorola Droid 3!!</p></div></p>
<p>Set the port to the IP of your machine running Charles. Set the port to 8888.</p>
<p>To access the menu above on existing wifi networks simply long click the name. New networks will present the option when connecting.</p>
<p>That's it! Charles should work.</p>
<p>&nbsp;</p>
<p>Now onto the second part.</p>
<h2>Configuring the Android emulator to work with Charles.</h2>
<p>&nbsp;</p>
<p>When starting an emulator you can do one of two things:</p>
<p>Using the command line you can do something like:</p>
<p><strong>emulator -http-proxy localhost.:8888 -port 5554 -debug-proxy @Nexus</strong></p>
<p>Optionally you can set the same emulator  in the run configurations in Eclipse.</p>
<p>Watch out!!! this technique only works with revision 13 and above of the Android SDK. r12 was broken and had a bug logged against it but has since been fixed in 13. Make sure you're up to date!</p>
<div id="attachment_376" class="wp-caption aligncenter" style="width: 310px"><a href="http://qtcstation.com/wp-content/uploads/2011/09/Screen-shot-2011-09-29-at-2.37.28-AM.png"><img class="size-medium wp-image-376" title="Screen shot 2011-09-29 at 2.37.28 AM" src="http://qtcstation.com/wp-content/uploads/2011/09/Screen-shot-2011-09-29-at-2.37.28-AM-300x214.png" alt="" width="300" height="214" /></a><p class="wp-caption-text">Eclipse run configuration settings.</p></div>
<p>Remember that you have to make sure the emulator starts using these additional arguments. If you already have one running these extra arguments will have no effect as the proxy will not be created.</p>
<p>&nbsp;</p>
<h2>Charles gotchas:</h2>
<p>If your apps use https you may run into some problems with the server rejecting your certificates (or lack thereof).</p>
<p>I think there is a way to get Charles to provide a certificate on behalf of your device but I haven't figured that part out yet.</p>
<p>In the mean time I've had luck using the FakeX509TrustManager when creating an https connection from within my app.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<pre class="brush:java">private static SSLContext createEasySSLContext() throws IOException {
		try {
			SSLContext context = SSLContext.getInstance("TLS");
			context.init(null, new TrustManager[] { new FakeX509TrustManager() }, null);
			return context;
		} catch (Exception e) {
			throw new IOException(e.getMessage());
		}
	}</pre>
<p>I hope this is helpful!</p>
]]></content:encoded>
			<wfw:commentRss>http://qtcstation.com/2011/09/configuring-charles-web-debugger-to-work-with-android-devices-and-emulator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

