<?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>All About Web &#38; Mobile Application Development &#187; Featured Articles</title>
	<atom:link href="http://www.londatiga.net/category/featured-articles/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.londatiga.net</link>
	<description>All About Web &#38; Mobile Application Development</description>
	<lastBuildDate>Sat, 14 Jan 2012 16:56:37 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>How to Send Image to Twitpic from Android</title>
		<link>http://www.londatiga.net/it/how-to-send-image-to-twitpic-from-android/</link>
		<comments>http://www.londatiga.net/it/how-to-send-image-to-twitpic-from-android/#comments</comments>
		<pubDate>Fri, 09 Sep 2011 07:14:39 +0000</pubDate>
		<dc:creator>lorenz</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Featured Articles]]></category>
		<category><![CDATA[Information Technology]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[android twitpic]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[post image twitpic]]></category>
		<category><![CDATA[sdk]]></category>
		<category><![CDATA[send image]]></category>
		<category><![CDATA[twitpic]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://www.londatiga.net/?p=855</guid>
		<description><![CDATA[Twitpic is one of the most common used image hosting that allows users to easily post images to Twitter and other social media. Twitpic can be used independently of Twitter, in a way similar to Google Picasa or Flickr. TwitPic usernames and passwords are the same as the ones in Twitter so it doesn&#8217;t have [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Twitpic </strong>is one of the most common used image hosting that allows users to easily post images to Twitter and other social media. <a href="http://twitpic.com" target="_blank">Twitpic</a> can be used independently of Twitter, in a way similar to Google Picasa or Flickr. TwitPic usernames and passwords are the same as the ones in Twitter so it doesn&#8217;t have to create new account on Twitpic.</p>
<p>As many other social media, Twitpic also provides <a title="Twitpic API" href="http://dev.twitpic.com/docs/" target="_blank">RESTful API</a> to enable developers to post image to Twitpic. The current version at the time of this writing is version 2 (V2). Using this API, we can build an Android application that features an image upload to Twitpic so we don&#8217;t have to create a new infrastructure for image hosting server.</p>
<p>In this tutorial i&#8217;ll explain how to send image to Twitpic from an Android application using <a title="Twitter4j" href="http://twitter4j.org/en/index.html" target="_blank">Twitter4j</a> library. The source code for this tutorial can be downloaded from my github page (see the download link at the bottom of this post).</p>
<p><strong>I. Register Application</strong></p>
<p>To enable an Android application to send image to Twitpic, first you have to register your application to get an API Key. To get an API Key:</p>
<ul>
<li>Go to <a title="Twitpic Register App" href="http://dev.twitpic.com/" target="_blank">Twitpic developer page</a> and click the <em>Register</em> link. If you&#8217;re not logged in before, you have to sign in to Twitpic using your Twitter account.<br />
<a href="http://www.londatiga.net/wp-content/uploads/2011/09/android_twitpic_register.jpg"><img class="alignnone size-full wp-image-856" title="android twitpic register app" src="http://www.londatiga.net/wp-content/uploads/2011/09/android_twitpic_register.jpg" alt="android twitpic register app" width="484" height="112" /></a></li>
<li>Register your application.<br />
<a href="http://www.londatiga.net/wp-content/uploads/2011/09/android_twitpic_register2.jpg"><img class="alignnone size-full wp-image-857" title="android twitpic register app" src="http://www.londatiga.net/wp-content/uploads/2011/09/android_twitpic_register2.jpg" alt="android twitpic register app" width="486" height="333" /></a></li>
<li>Save the API Key.<br />
<a href="http://www.londatiga.net/wp-content/uploads/2011/09/android_twitpic_apikey.jpg"><img class="alignnone size-full wp-image-858" title="android twitpic apikey" src="http://www.londatiga.net/wp-content/uploads/2011/09/android_twitpic_apikey.jpg" alt="android twitpic apikey" width="484" height="103" /></a></li>
</ul>
<p><strong>II. Android Integration</strong></p>
<p>In my sample project i use <em>Twitter4j</em> library to send image to Twitpic. You can download the latest version from Twitter4j download page or use the library package  i&#8217;ve provided in this tutorial. To enable Android to send image to Twitpic, first you have to connect to Twitter first using a Twitter account. How to connect to Twitter will not be explained here, you can read my previous tutorial on <a title="Twitter status android" href="http://www.londatiga.net/how-to-post-twitter-status-from-android/" target="_blank">how to post Twitter status from Android</a>. So basically to be enable to send image to Twitpic, first you have to sign in to Twitter, get the access token and use the access token along with Twitter consumer key, secret key and Twitpic API key.</p>
<p><a href="http://www.londatiga.net/wp-content/uploads/2011/09/android_twitpic_eclipse.jpg"><img class="alignnone size-full wp-image-859" title="android twitpic eclipse" src="http://www.londatiga.net/wp-content/uploads/2011/09/android_twitpic_eclipse.jpg" alt="android twitpic eclipse" width="230" height="330" /></a></p>
<p>In my sample project, i create two packages. The first is for Twitter library, which can be found also on my previous Twitter tutorial sample project and the second is the main application page.</p>
<p><span style="text-decoration: underline;">Connect to Twitter (ConnectActivity.java)</span></p>
<p>This activity displays the Twitter login page and  authenticates user to get the access token. More comprehensive explanation can be found on my previous tutorial.</p>
<p><img class="alignnone size-full wp-image-860" title="android twitter signin" src="http://www.londatiga.net/wp-content/uploads/2011/09/android_twitter_signin.jpg" alt="android twitter signin" width="200" height="333" /> <img class="alignnone size-full wp-image-861" title="android twitter signin" src="http://www.londatiga.net/wp-content/uploads/2011/09/android_twitter_signin2.jpg" alt="android twitter signin" width="200" height="333" /></p>
<p><span style="text-decoration: underline;">Send Image to Twitpic (SendImageActivity.java)</span></p>
<p>In this activity, using an image picker, the image to be sent can be from existing images on sdcard or directly taking a picture from camera. You can read my previous tutorial on <a title="Android Image Picker" href="http://www.londatiga.net/how-to-create-android-image-picker/" target="_blank">how to create image picker on Android </a>to get more deep understanding on how it works. The classes from Twitter4j that are used to send image to Twitpic are:</p>
<pre class="brush: java; title: ;">
import twitter4j.conf.Configuration;
import twitter4j.conf.ConfigurationBuilder;
import twitter4j.http.AccessToken;
import twitter4j.http.OAuthAuthorization;
import twitter4j.util.ImageUpload;
</pre>
<pre class="brush: java; title: ;">
 private class ImageSender extends AsyncTask&lt;URL, Integer, Long&gt; {
    	private String url;

    	protected void onPreExecute() {
			mProgressDialog = ProgressDialog.show(SendImageActivity.this, &quot;&quot;, &quot;Sending image...&quot;, true);

			mProgressDialog.setCancelable(false);
			mProgressDialog.show();
		}

        protected Long doInBackground(URL... urls) {
            long result = 0;

            TwitterSession twitterSession	= new TwitterSession(SendImageActivity.this);
            AccessToken accessToken 		= twitterSession.getAccessToken();

			Configuration conf = new ConfigurationBuilder()
            .setOAuthConsumerKey(twitter_consumer_key)
            .setOAuthConsumerSecret(twitter_secret_key)
            .setOAuthAccessToken(accessToken.getToken())
            .setOAuthAccessTokenSecret(accessToken.getTokenSecret())
            .build();

			OAuthAuthorization auth = new OAuthAuthorization (conf, conf.getOAuthConsumerKey (), conf.getOAuthConsumerSecret (),
	                new AccessToken (conf.getOAuthAccessToken (), conf.getOAuthAccessTokenSecret ()));

	        ImageUpload upload = ImageUpload.getTwitpicUploader (twitpic_api_key, auth);

	        Log.d(TAG, &quot;Start sending image...&quot;);

	        try {
	        	url = upload.upload(new File(mPath));
	        	result = 1;

	        	Log.d(TAG, &quot;Image uploaded, Twitpic url is &quot; + url);
	        } catch (Exception e) {
	        	Log.e(TAG, &quot;Failed to send image&quot;);

	        	e.printStackTrace();
	        }

            return result;
        }

        protected void onProgressUpdate(Integer... progress) {
        }

        protected void onPostExecute(Long result) {
        	mProgressDialog.cancel();

        	String text = (result == 1) ? &quot;Image sent successfully.\n Twitpic url is: &quot; + url : &quot;Failed to send image&quot;;

        	Toast.makeText(getApplicationContext(), text, Toast.LENGTH_LONG).show();
        }
    }
</pre>
<p>In this example, i use asynchronous task to send image to Twitpic, you can use more convenience way to send the image such as using background service with queue to manage uploading multiple images. The main code for sending image to Twitpic defined in <em>doInBackground()</em> method.</p>
<p>line 14: create an object of<em> TwitterSession</em> class to get the accsess token that was previously saved when user was successfully authenticated.</p>
<p>line 15: get the access token object.</p>
<p>line 16: create the configuration object with <em>Twitter consumer key, secret key, access token </em>and <em>access token secret</em> as parameters.</p>
<p>line 24: create the authorization object.</p>
<p>line 27: create the Twitpic image uploader object.</p>
<p>line 32: upload the image file to Twitpic, the method uses file path to the image that was selected from image picker.</p>
<p>lin3 35: if success, the upload method will return the Twitpic url to the uploaded image, ex: http://twitpic.com/6hqd44</p>
<p><img class="alignnone size-full wp-image-863" title="android twitpic" src="http://www.londatiga.net/wp-content/uploads/2011/09/android_twitpic.jpg" alt="android twitpic" width="200" height="333" /></p>
<p></p>
<p><strong>Download</strong></p>
<ul>
<li>Download source code from <a title="Android Twitpic" href="https://github.com/lorensiuswlt/AndroidTwitpic" target="_blank">my github page</a></li>
<li>Download Twitter external jars <a href="http://londatiga.net/downloads/Twitter_ExtJars.zip" target="_blank">(Twitter4j and signpost)</a></li>
</ul>
<p><strong> </strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.londatiga.net/it/how-to-send-image-to-twitpic-from-android/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How to Select and Crop Image on Android</title>
		<link>http://www.londatiga.net/featured-articles/how-to-select-and-crop-image-on-android/</link>
		<comments>http://www.londatiga.net/featured-articles/how-to-select-and-crop-image-on-android/#comments</comments>
		<pubDate>Fri, 22 Jul 2011 04:45:46 +0000</pubDate>
		<dc:creator>lorenz</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Featured Articles]]></category>
		<category><![CDATA[camera api]]></category>
		<category><![CDATA[crop]]></category>
		<category><![CDATA[gallery]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[intent]]></category>
		<category><![CDATA[mediastore]]></category>
		<category><![CDATA[photo]]></category>

		<guid isPermaLink="false">http://www.londatiga.net/?p=756</guid>
		<description><![CDATA[Sometimes when creating an Android app that includes user profile picture or avatar, we need to include a feature that enables users to select and crop image to update their profile picture. On Android we can accomplish that by using intent to open image cropper app. To select an image from files, we can pass an [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes when creating an <a title="Android" href="http://www.londatiga.net/category/it/programming/android/" target="_blank">Android</a> app that includes user profile picture or avatar, we need to include a feature that enables users to select and <strong>crop image</strong> to update their profile picture. On <strong>Android </strong>we can accomplish that by using intent to open image cropper app. To select an image from files, we can pass an intent to image gallery or file manager app then pass the selected image path to camera app to crop the image. It is also the same if we want to take a picture from camera, by passing an intent to camera app to open the camera, take a picture than save it to specified Uri then crop it.</p>
<p>I&#8217;ve created a sample project to show how to select and crop image from files or from camera. The source files can be downloaded from my github repository (see the bottom if this post).</p>
<p>MainActivity.java</p>
<pre class="brush: java; title: ;">
 final String [] items	      = new String [] {&quot;Take from camera&quot;, &quot;Select from Gallery&quot;};
 ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt; (this, android.R.layout.select_dialog_item,items);
 AlertDialog.Builder builder  = new AlertDialog.Builder(this);

 builder.setTitle(&quot;Select Image&quot;);
 builder.setAdapter( adapter, new DialogInterface.OnClickListener() {
    public void onClick( DialogInterface dialog, int item ) { //pick from camer
	if (item == 0) {
	    Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);

	    mImageCaptureUri = Uri.fromFile(new File(Environment.getExternalStorageDirectory(),
				 &quot;tmp_avatar_&quot; + String.valueOf(System.currentTimeMillis()) + &quot;.jpg&quot;));

	    intent.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, mImageCaptureUri);

	    try {
		intent.putExtra(&quot;return-data&quot;, true);

		startActivityForResult(intent, PICK_FROM_CAMERA);
	    } catch (ActivityNotFoundException e) {
		e.printStackTrace();
	    }
       } else { //pick from file
	   Intent intent = new Intent();

	   intent.setType(&quot;image/*&quot;);
	   intent.setAction(Intent.ACTION_GET_CONTENT);

	   startActivityForResult(Intent.createChooser(intent, &quot;Complete action using&quot;), PICK_FROM_FILE);
       }
    }
 } );

final AlertDialog dialog = builder.create();

Button button 	= (Button) findViewById(R.id.btn_crop);
mImageView	= (ImageView) findViewById(R.id.iv_photo);

button.setOnClickListener(new View.OnClickListener() {
   @Override
   public void onClick(View v) {
	dialog.show();
   }
});
</pre>
<p>Line 1: In this example, i use a selector dialog to display two image source options, from camera &#8216;Take from camera&#8217; and from existing files &#8216;Select from gallery&#8217;</p>
<p><img class="alignnone" title="Android Crop Image" src="http://londatiga.net/images/androidcropimage/crop_image_selector.jpg" alt="" width="165" height="200" /> <img class="alignnone" title="Android Crop Image" src="http://londatiga.net/images/androidcropimage/photo_app_selector.jpg" alt="" width="156" height="200" /></p>
<p>Line 9: To take a photo from camera, pass  intent action &#8216;<em>MediaStore.ACTION_IMAGE_CAPTURE</em>&#8216; to open the camera app.<br />
Line 11: Also specify the <a title="Android Uri" href="http://developer.android.com/reference/android/net/Uri.html" target="_blank">Uri</a> to save the image on specified path and file name. Note that this Uri variable also used by gallery app to hold the selected image path.<br />
Line 24-29: To select an image from existing files, use<em> Intent.createChooser </em>to open image chooser. Android will automatically display a list of supported applications, such as image gallery or file manager.</p>
<p><img class="alignnone" title="Android Image Crop" src="http://londatiga.net/images/androidcropimage/gallery_app_chooser.jpg" alt="" width="164" height="200" /></p>
<pre class="brush: java; title: ;">
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
   if (resultCode != RESULT_OK) return;
       switch (requestCode) {
          case PICK_FROM_CAMERA:
	     doCrop();
             break;

          case PICK_FROM_FILE:
	     mImageCaptureUri = data.getData();

             doCrop();

             break;
</pre>
<p>Line 10: After taking a picture, do the crop<br />
Line 6: After selecting image from files, save the selected path</p>
<pre class="brush: java; title: ;">
private void doCrop() {
		final ArrayList&lt;CropOption&gt; cropOptions = new ArrayList&lt;CropOption&gt;();

    	Intent intent = new Intent(&quot;com.android.camera.action.CROP&quot;);
        intent.setType(&quot;image/*&quot;);

        List&lt;ResolveInfo&gt; list = getPackageManager().queryIntentActivities( intent, 0 );

        int size = list.size();

        if (size == 0) {
        	Toast.makeText(this, &quot;Can not find image crop app&quot;, Toast.LENGTH_SHORT).show();

            return;
        } else {
        	intent.setData(mImageCaptureUri);

            intent.putExtra(&quot;outputX&quot;, 200);
            intent.putExtra(&quot;outputY&quot;, 200);
            intent.putExtra(&quot;aspectX&quot;, 1);
            intent.putExtra(&quot;aspectY&quot;, 1);
            intent.putExtra(&quot;scale&quot;, true);
            intent.putExtra(&quot;return-data&quot;, true);

        	if (size == 1) {
        		Intent i 		= new Intent(intent);
	        	ResolveInfo res	= list.get(0);

	        	i.setComponent( new ComponentName(res.activityInfo.packageName, res.activityInfo.name));

	        	startActivityForResult(i, CROP_FROM_CAMERA);
        	} else {
		        for (ResolveInfo res : list) {
		        	final CropOption co = new CropOption();

		        	co.title 	= getPackageManager().getApplicationLabel(res.activityInfo.applicationInfo);
		        	co.icon		= getPackageManager().getApplicationIcon(res.activityInfo.applicationInfo);
		        	co.appIntent= new Intent(intent);

		        	co.appIntent.setComponent( new ComponentName(res.activityInfo.packageName, res.activityInfo.name));

		            cropOptions.add(co);
		        }

		        CropOptionAdapter adapter = new CropOptionAdapter(getApplicationContext(), cropOptions);

		        AlertDialog.Builder builder = new AlertDialog.Builder(this);
		        builder.setTitle(&quot;Choose Crop App&quot;);
		        builder.setAdapter( adapter, new DialogInterface.OnClickListener() {
		            public void onClick( DialogInterface dialog, int item ) {
		                startActivityForResult( cropOptions.get(item).appIntent, CROP_FROM_CAMERA);
		            }
		        });

		        builder.setOnCancelListener( new DialogInterface.OnCancelListener() {
		            @Override
		            public void onCancel( DialogInterface dialog ) {

		                if (mImageCaptureUri != null ) {
		                    getContentResolver().delete(mImageCaptureUri, null, null );
		                    mImageCaptureUri = null;
		                }
		            }
		        } );

		        AlertDialog alert = builder.create();

		        alert.show();
        	}
        }
	}
</pre>
<p></p>
<p>Line 4: Open image crop app by starting an intent &#8216;<em>com.android.camera.action.CROP</em>&#8216;.<br />
Line 7: Check if there is image cropper app installed.<br />
Line 11: If there is no image cropper app, display warning message<br />
Line 16-23: Specify the image path, crop dimension and scale<br />
Line 25: There is posibility when more than one image cropper app exist, so we have to check for it first. If there is only one app, open then app.<br />
Line 33-68. If there are several app exist, create a custom chooser to let user selects the app.</p>
<p><img class="alignnone" title="Android Crop Image" src="http://londatiga.net/images/androidcropimage/crop_image.jpg" alt="" width="170" height="220" /></p>
<pre class="brush: java; title: ;">
@Override
	protected void onActivityResult(int requestCode, int resultCode, Intent data) {
	    if (resultCode != RESULT_OK) return;

	    switch (requestCode) {

		    case CROP_FROM_CAMERA:
		        Bundle extras = data.getExtras();

		        if (extras != null) {
		            Bitmap photo = extras.getParcelable(&quot;data&quot;);

		            mImageView.setImageBitmap(photo);
		        }

		        File f = new File(mImageCaptureUri.getPath());

		        if (f.exists()) f.delete();

		        break;
</pre>
<p>Line 11: After cropping the image, get the bitmap of the cropped image and display it on imageview.<br />
Line 16: Delete the temporary image</p>
<p><img class="alignnone" title="Android Image Crop" src="http://londatiga.net/images/androidcropimage/image_crop_activity.jpg" alt="" width="257" height="300" /></p>
<p><a title="Github " href="https://github.com/lorensiuswlt/AndroidImageCrop" target="_blank">Download source code (github)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.londatiga.net/featured-articles/how-to-select-and-crop-image-on-android/feed/</wfw:commentRss>
		<slash:comments>29</slash:comments>
		</item>
		<item>
		<title>How to Use Foursquare API on Android Application</title>
		<link>http://www.londatiga.net/featured-articles/how-to-use-foursquare-api-on-android-application/</link>
		<comments>http://www.londatiga.net/featured-articles/how-to-use-foursquare-api-on-android-application/#comments</comments>
		<pubDate>Sun, 17 Jul 2011 08:49:53 +0000</pubDate>
		<dc:creator>lorenz</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Featured Articles]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[application]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[authoriation]]></category>
		<category><![CDATA[foursquare]]></category>
		<category><![CDATA[foursquare api]]></category>
		<category><![CDATA[oauth]]></category>

		<guid isPermaLink="false">http://www.londatiga.net/?p=745</guid>
		<description><![CDATA[This is my second post about using Oauth enabled API on Android. This time i&#8217;ll try to explain how to use Foursquare API V2 within Android application. I built my own Android implementation for Foursquare API based on my previous  implementation for Twitter API that can be used to post Twitter status from Android. To use [...]]]></description>
			<content:encoded><![CDATA[<p>This is my second post about using Oauth enabled API on <strong>Android</strong>. This time i&#8217;ll try to explain how to use <a title="Foursquare API" href="https://developer.foursquare.com/docs/" target="_blank">Foursquare API V2</a> within <a title="Android" href="http://www.londatiga.net/category/it/programming/android/" target="_blank">Android</a> application. I built my own Android implementation for <strong>Foursquare API</strong> based on my previous  implementation for Twitter API that can be used to <a title="Post Twitter status from Android" href="http://www.londatiga.net/it/how-to-post-twitter-status-from-android/" target="_blank">post Twitter status from Android</a>. To use Foursquare API within an Android application, first you have to register your application on Foursquare to get the <em>client id</em> and <em>client secret</em> key.</p>
<p><strong>I. Register application</strong></p>
<p>To register your application:</p>
<ul>
<li>Go to <a title="Foursquare Android API" href="https://foursquare.com/oauth/" target="_blank">Foursquare Oauth</a> page and login with your username and password</li>
<li>After logged in, click the &#8216;REGISTER A NEW CONSUMER&#8217; button</li>
<p><img class="alignnone" title="Foursqure API Android" src="http://londatiga.net/images/foursquare/register_app.jpg" alt="" width="315" height="100" /></p>
<li>Fill the registration form with your application name, application website url and the callback url. For callback url, you can use any url or string if your app is for mobile application only, for example myapp://connect</li>
<p><img class="alignnone" title="Foursqure API Android" src="http://londatiga.net/images/foursquare/register_app_form.jpg" alt="" width="315" height="260" />&lt;</p>
<li>After finishing the registration , you&#8217;ll get <em>client id</em> and <em>client secret </em>key<em> </em>that will be used later to connect to Foursquare from Android app.</li>
<p><img class="alignnone" title="Foursquare API Android" src="http://londatiga.net/images/foursquare/test_app.jpg" alt="" width="360" height="170" /></ul>
<div><strong>II. Android Client Code</strong></div>
<div><strong><br />
</strong></div>
<div>I&#8217;ve created my own implementation to handle oauth authentification with Foursquare. It is based on my previous <a title="Android Twitter Status" href="http://www.londatiga.net/it/how-to-post-twitter-status-from-android/" target="_blank">Twitter implementation</a>, but with slightly modification which more simple and uses no external libraries. To access all Foursquare API endpoints, first we have to get the access token. Here is my implementation flow:</div>
<div>
<ol>
<li>Get access token by letting user grant access to the app using a webview based authentication dialog</li>
<li>Save access token on shared preferences</li>
<li>Use the access token to access Foursquare API endpoints</li>
</ol>
</div>
<p>I&#8217;ve included a sample project in this tutorial that can be downloaded on my github repo <a title="Foursquare API Android" href="https://github.com/lorensiuswlt/AndroidFoursquare" target="_blank">here</a>. I&#8217;ll explain how to use my implementation based on the sample project. In my sample project, i create three classes used to handle authentication and connection to Foursquare: <em>FoursquareApp.java</em> (handle oauth authentification), <em>FoursquareSession.java</em> (save access token on shared preferences) and <em>FoursquareDialog.java </em>(webview authentication dialog).</p>
<p><em>Main.java</em></p>
<pre class="brush: java; title: ;">
public class Main extends Activity {
	private FoursquareApp mFsqApp;
	private ListView mListView;
	private NearbyAdapter mAdapter;
	private ArrayList&lt;FsqVenue&gt; mNearbyList;
	private ProgressDialog mProgress;

	public static final String CLIENT_ID = &quot;your client id&quot;;
	public static final String CLIENT_SECRET = &quot;your client secret&quot;;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.main);

        final TextView nameTv 		= (TextView) findViewById(R.id.tv_name);
        Button connectBtn 			= (Button) findViewById(R.id.b_connect);
        final EditText latitudeEt	= (EditText) findViewById(R.id.et_latitude);
        final EditText longitudeEt	= (EditText) findViewById(R.id.et_longitude);
        Button goBtn				= (Button) findViewById(R.id.b_go);
        mListView					= (ListView) findViewById(R.id.lv_places);

        mFsqApp 		= new FoursquareApp(this, CLIENT_ID, CLIENT_SECRET);

        mAdapter 		= new NearbyAdapter(this);
        mNearbyList		= new ArrayList&lt;FsqVenue&gt;();
        mProgress		= new ProgressDialog(this);

        mProgress.setMessage(&quot;Loading data ...&quot;);

        if (mFsqApp.hasAccessToken()) nameTv.setText(&quot;Connected as &quot; + mFsqApp.getUserName());

        FsqAuthListener listener = new FsqAuthListener() {
        	@Override
        	public void onSuccess() {
        		Toast.makeText(Main.this, &quot;Connected as &quot; + mFsqApp.getUserName(), Toast.LENGTH_SHORT).show();
        		nameTv.setText(&quot;Connected as &quot; + mFsqApp.getUserName());
        	}

        	@Override
        	public void onFail(String error) {
        		Toast.makeText(Main.this, error, Toast.LENGTH_SHORT).show();
        	}
        };

        mFsqApp.setListener(listener);

        //get access token and user name from foursquare
        connectBtn.setOnClickListener(new OnClickListener() {
        	@Override
        	public void onClick(View v) {
        		mFsqApp.authorize();
        	}
        });

        //use access token to get nearby places
        goBtn.setOnClickListener(new OnClickListener() {
        	@Override
        	public void onClick(View v) {
        		String latitude  = latitudeEt.getText().toString();
        		String longitude = longitudeEt.getText().toString();

        		if (latitude.equals(&quot;&quot;) || longitude.equals(&quot;&quot;)) {
        			Toast.makeText(Main.this, &quot;Latitude or longitude is empty&quot;, Toast.LENGTH_SHORT).show();
        			return;
        		}

    			double lat	= Double.valueOf(latitude);
    			double lon	= Double.valueOf(longitude);

        		loadNearbyPlaces(lat, lon);
        	}
        });
    }

    private void loadNearbyPlaces(final double latitude, final double longitude) {
    	mProgress.show();

    	new Thread() {
    		@Override
    		public void run() {
    			int what = 0;

    			try {

    				mNearbyList = mFsqApp.getNearby(latitude, longitude);
    			} catch (Exception e) {
    				what = 1;
    				e.printStackTrace();
    			}

    			mHandler.sendMessage(mHandler.obtainMessage(what));
    		}
    	}.start();
    }

    private Handler mHandler = new Handler() {
    	@Override
    	public void handleMessage(Message msg) {
    		mProgress.dismiss();

    		if (msg.what == 0) {
    			if (mNearbyList.size() == 0) {
    				Toast.makeText(Main.this, &quot;No nearby places available&quot;, Toast.LENGTH_SHORT).show();
    				return;
    			}

    			mAdapter.setData(mNearbyList);
    			mListView.setAdapter(mAdapter);
    		} else {
    			Toast.makeText(Main.this, &quot;Failed to load nearby places&quot;, Toast.LENGTH_SHORT).show();
    		}
    	}
    };
}
</pre>
<p>The example above shows how to authenticate user to get access token, display the webview authentication dialog then use the access token to access Foursquare API endpoint which in this example is to get the nearby venues.</p>
<p></p>
<p>Line 8-9: First, replace the CLIENT_ID and CLIENT_SECREET with your app <em>client id</em> and <em>client secret</em><br />
Line 24: Create an instance of <em>FoursquareApp</em> class and pass the CLIENT_ID and CLIENT_SECRET as parameters<br />
Line 32: Check if user has access token (already authorized the app before) using <em>hasAccessToken</em><br />
method.<br />
Line 34: Setup listener to handle authorization result event (success or fail)<br />
Line 53: Display the authentication dialog<br />
Line 87: Get nearby venues, an example how to access Foursquare API endpoint. The <em>getNearbyVenue</em> method was defined in FourquareApp.java</p>
<p><img class="alignnone" title="Foursquare API Android" src="http://londatiga.net/images/foursquare/foursquare_api_android1.jpg" alt="" width="200" height="300" /> <img class="alignnone" title="Foursquare API Android" src="http://londatiga.net/images/foursquare/foursquare_api_android2.jpg" alt="" width="200" height="300" /></p>
<p><em>FoursquareApp.java</em></p>
<pre class="brush: java; title: ;">
public static final String CALLBACK_URL = &quot;myapp://connect&quot;;
private static final String AUTH_URL = &quot;https://foursquare.com/oauth2/authenticate?response_type=code&quot;;
private static final String TOKEN_URL = &quot;https://foursquare.com/oauth2/access_token?grant_type=authorization_code&quot;;
private static final String API_URL = &quot;https://api.foursquare.com/v2&quot;;
</pre>
<p>Line 1: Replace the CALLBACK_URL  with your callback url set before on web settings.<br />
Line 4: API_URL is the root url for Foursquare API endpoint. Do not change this url unless Foursqure make changes on their API url.</p>
<pre class="brush: java; title: ;">
public ArrayList&lt;FsqVenue&gt; getNearby(double latitude, double longitude) throws Exception {
		ArrayList&lt;FsqVenue&gt; venueList = new ArrayList&lt;FsqVenue&gt;();

		try {
			String ll 	= String.valueOf(latitude) + &quot;,&quot; + String.valueOf(longitude);
			URL url 	= new URL(API_URL + &quot;/venues/search?ll=&quot; + ll + &quot;&amp;oauth_token=&quot; + mAccessToken);

			Log.d(TAG, &quot;Opening URL &quot; + url.toString());

			HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();

			urlConnection.setRequestMethod(&quot;GET&quot;);
			urlConnection.setDoInput(true);
			urlConnection.setDoOutput(true);

			urlConnection.connect();

			String response		= streamToString(urlConnection.getInputStream());
			JSONObject jsonObj 	= (JSONObject) new JSONTokener(response).nextValue();

			JSONArray groups	= (JSONArray) jsonObj.getJSONObject(&quot;response&quot;).getJSONArray(&quot;groups&quot;);

			int length			= groups.length();

			if (length &gt; 0) {
				for (int i = 0; i &lt; length; i++) {
					JSONObject group 	= (JSONObject) groups.get(i);
					JSONArray items 	= (JSONArray) group.getJSONArray(&quot;items&quot;);

					int ilength 		= items.length();

					for (int j = 0; j &lt; ilength; j++) {
						JSONObject item = (JSONObject) items.get(j);

						FsqVenue venue 	= new FsqVenue();

						venue.id 		= item.getString(&quot;id&quot;);
						venue.name		= item.getString(&quot;name&quot;);

						JSONObject location = (JSONObject) item.getJSONObject(&quot;location&quot;);

						Location loc 	= new Location(LocationManager.GPS_PROVIDER);

						loc.setLatitude(Double.valueOf(location.getString(&quot;lat&quot;)));
						loc.setLongitude(Double.valueOf(location.getString(&quot;lng&quot;)));

						venue.location	= loc;
						venue.address	= location.getString(&quot;address&quot;);
						venue.distance	= location.getInt(&quot;distance&quot;);
						venue.herenow	= item.getJSONObject(&quot;hereNow&quot;).getInt(&quot;count&quot;);
						venue.type		= group.getString(&quot;type&quot;);

						venueList.add(venue);
					}
				}
			}
		} catch (Exception ex) {
			throw ex;
		}

		return venueList;
	}
</pre>
<p>To access Foursquare API endpoint, use standard <a href="http://developer.android.com/reference/java/net/HttpURLConnection.html" target="_blank">HTTPURLConnection</a> class, where the url depends on what endpoint you want to access. Complete list of Foursquare API endpoints can be found <a href="https://developer.foursquare.com/docs/index_docs.html">here</a>.</p>
<p><img class="alignnone" title="Foursquare API Android" src="http://londatiga.net/images/foursquare/foursquare_api_android3.jpg" alt="" width="200" height="300" /></p>
<div style="padding:10px;background:#2dd354;"><a title="Download source code" href="https://github.com/lorensiuswlt/AndroidFoursquare" target="_self">Download source code (Github)</a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.londatiga.net/featured-articles/how-to-use-foursquare-api-on-android-application/feed/</wfw:commentRss>
		<slash:comments>38</slash:comments>
		</item>
		<item>
		<title>How to Post Twitter Status from Android</title>
		<link>http://www.londatiga.net/it/how-to-post-twitter-status-from-android/</link>
		<comments>http://www.londatiga.net/it/how-to-post-twitter-status-from-android/#comments</comments>
		<pubDate>Sat, 26 Feb 2011 13:54:08 +0000</pubDate>
		<dc:creator>lorenz</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Featured Articles]]></category>
		<category><![CDATA[Information Technology]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[post status]]></category>
		<category><![CDATA[status]]></category>
		<category><![CDATA[timeline]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[twitter4j]]></category>

		<guid isPermaLink="false">http://www.londatiga.net/?p=680</guid>
		<description><![CDATA[While developing one of my Android application, i found it was hard to find a good and simple tutorial on how to integrate Twitter into Android app.  There are some external java libraries over the net that can be used to integrate Twitter into Android app, but they lack of good documentation and tutorial on [...]]]></description>
			<content:encoded><![CDATA[<p>While developing one of my <a title="Android" href="http://www.android.com" target="_blank">Android</a> application, i found it was hard to find a good and simple tutorial on how to integrate<strong> Twitte</strong>r into <strong>Androi</strong><strong>d</strong> app.  There are some external java libraries over the net that can be used to integrate Twitter into Android app, but they lack of good documentation and tutorial on how to use it on Android. So i  made my own implementation using  <a title="Twitter4j Twitter Android Library" href="http://twitter4j.org" target="_blank">Twitter4j</a> and <a title="Oauth Signpost Twitter Android" href="http://code.google.com/p/oauth-signpost/" target="_blank">oauth-signpos</a>t library. In this tutorial, i create one sample Android project to show how to connect to Twitter, save it&#8217;s token and username on shared preferences so it can be used later to post status to Twitter.</p>
<p><strong>I. Register Twitter Application</strong></p>
<p>To enable user to post status to Twitter, first you have to create one Twitter application. Simply go to <a title="Create twitter App" href="http://twitter.com/apps" target="_blank">Twitter Apps</a> page and register your application. Fill the &#8216;<em>Application Name</em>&#8216; with your desired name, it has to be unique. If you use a name that already exist (taken by someone), you&#8217;ll get a warning message.  On &#8216;<em>Application Type&#8217; </em>option, choose &#8216;<em>Browser&#8217; , </em>and because its a browser type application but used in mobile application, you can set it&#8217;s callback url on &#8216;<em>Callback URL</em>&#8216; field  with any url you want. On &#8216;<em>Default Access type&#8217;, </em>choose &#8216;<em>Read and Write</em>&#8216; to enable access to post status. Click save and if all things going well, you&#8217;ll get a page showing your consumer key and secret key. Copy these two keys for later use in Android app.</p>
<p><a href="http://londatiga.net/images/androidtwitter/register_twitter_app.jpg"><img class="alignnone" title="Register new Twitter app" src="http://londatiga.net/images/androidtwitter/register_twitter_app.jpg" alt="" width="270" height="292" /></a><a href="http://londatiga.net/images/androidtwitter/twitter_consumer.jpg"><img class="alignnone" title="Twitter register app" src="http://londatiga.net/images/androidtwitter/twitter_consumer.jpg" alt="" width="240" height="184" /></a></p>
<p><strong>II. Android Integration</strong></p>
<p>To integrate Twitter into Android app, you need four external jar files from two different libraries, Twitter4j and oauth-signpost. You can download latest version from <a title="Twitter4j" href="http://twitter4j.org/en/index.html#download" target="_blank">Twitter4j download page </a>or use the one included in my sample project (<em>twitter4j-core-2.1.6.jar</em>) and oauth-signpost from<a title="Oauth-signpost download" href="http://code.google.com/p/oauth-signpost/downloads/list" target="_blank"> oauth-signpost download page</a> (<em>signpost-core-1.2.1.1.jar, signpost-commonshttp4-1.2.1.1.jar, signpost-jetty6-1.2.1.1.jar</em>). Add the four external jars into your Android project (on Eclipse, right click on your<em> project-&gt;propertie</em>s then on<em> Java Build Path</em> click <em>Add External JARs</em> button to select files)</p>
<p><a href="http://londatiga.net/images/androidtwitter/android_external_jars.jpg"><img class="alignnone" title="Add external jars eclipse" src="http://londatiga.net/images/androidtwitter/android_external_jars.jpg" alt="" width="450" height="130" /></a></p>
<p>In my sample project, i create three helper classes (<em>TwitterApp.java,  TwitterDialog.java</em>, and <em>TwitterSession.java</em>) to handle authentication using <a title="Android Webview" href="http://developer.android.com/reference/android/webkit/WebView.html" target="_blank">Webview</a> <a title="Android Dialog" href="http://developer.android.com/guide/topics/ui/dialogs.html" target="_blank">Dialog</a> and session handler to save token and username on <a title="Android Shared Preferences" href="http://developer.android.com/reference/android/content/SharedPreferences.html" target="_blank">Shared Preferences</a>.</p>
<p><span style="text-decoration: underline;">Code implementation</span></p>
<p><span style="text-decoration: underline;">1. Twitter Connection (TestConnection.java)</span></p>
<p>This example shows how to connect to Twitter, display webview dialog to authorize user then save user&#8217;s token and username on shared preference for later use.</p>
<pre class="brush: java; title: ;">
public class TestConnect extends Activity {
	private TwitterApp mTwitter;
	private CheckBox mTwitterBtn;

	private static final String twitter_consumer_key = &quot;xxx&quot;;
	private static final String twitter_secret_key = &quot;xxx&quot;;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		setContentView(R.layout.main);

		mTwitterBtn	= (CheckBox) findViewById(R.id.twitterCheck);

		mTwitterBtn.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				onTwitterClick();
			}
		});

		mTwitter 	= new TwitterApp(this, twitter_consumer_key,twitter_secret_key);

		mTwitter.setListener(mTwLoginDialogListener);

		if (mTwitter.hasAccessToken()) {
			mTwitterBtn.setChecked(true);

			String username = mTwitter.getUsername();
			username		= (username.equals(&quot;&quot;)) ? &quot;Unknown&quot; : username;

			mTwitterBtn.setText(&quot;  Twitter (&quot; + username + &quot;)&quot;);
			mTwitterBtn.setTextColor(Color.WHITE);
		}

		Button goBtn = (Button) findViewById(R.id.button1);

		goBtn.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				startActivity(new Intent(TestConnect.this, TestPost.class));
			}
		});
	}

	private void onTwitterClick() {
		if (mTwitter.hasAccessToken()) {
			final AlertDialog.Builder builder = new AlertDialog.Builder(this);

			builder.setMessage(&quot;Delete current Twitter connection?&quot;)
			       .setCancelable(false)
			       .setPositiveButton(&quot;Yes&quot;, new DialogInterface.OnClickListener() {
			           public void onClick(DialogInterface dialog, int id) {
			        	   mTwitter.resetAccessToken();

			        	   mTwitterBtn.setChecked(false);
			        	   mTwitterBtn.setText(&quot;  Twitter (Not connected)&quot;);
			        	   mTwitterBtn.setTextColor(Color.GRAY);
			           }
			       })
			       .setNegativeButton(&quot;No&quot;, new DialogInterface.OnClickListener() {
			           public void onClick(DialogInterface dialog, int id) {
			                dialog.cancel();

			                mTwitterBtn.setChecked(true);
			           }
			       });
			final AlertDialog alert = builder.create();

			alert.show();
		} else {
			mTwitterBtn.setChecked(false);

			mTwitter.authorize();
		}
	}

	private final TwDialogListener mTwLoginDialogListener = new TwDialogListener() {
		@Override
		public void onComplete(String value) {
			String username = mTwitter.getUsername();
			username		= (username.equals(&quot;&quot;)) ? &quot;No Name&quot; : username;

			mTwitterBtn.setText(&quot;  Twitter  (&quot; + username + &quot;)&quot;);
			mTwitterBtn.setChecked(true);
			mTwitterBtn.setTextColor(Color.WHITE);

			Toast.makeText(TestConnect.this, &quot;Connected to Twitter as &quot; + username, Toast.LENGTH_LONG).show();
		}

		@Override
		public void onError(String value) {
			mTwitterBtn.setChecked(false);

			Toast.makeText(TestConnect.this, &quot;Twitter connection failed&quot;, Toast.LENGTH_LONG).show();
		}
	};
}
</pre>
<p>First, create an instance of  <em>TwiterApp</em> class with context, consumer key and secret key as constructor&#8217;s parameters. Use <em>hasAccessToken()</em> method to check if there is previously saved session. If there is no saved session, call <em>authorize()</em> to open authorization dialog. If user allows the connection, his access token and user name will be saved on shared preferences. You can setup listener to handle on success and on error event by creating an instance of <em>TwDialogListener </em>and pass it to<em> setListener()</em> method.</p>
<p><a href="http://londatiga.net/images/androidtwitter/android_twitter_1.jpg"><img class="alignnone" title="Android Twitter" src="http://londatiga.net/images/androidtwitter/android_twitter_1.jpg" alt="" width="160" height="240" /></a> <a href="http://londatiga.net/images/androidtwitter/android_twitter_2.jpg"><img class="alignnone" title="Android Twitter" src="http://londatiga.net/images/androidtwitter/android_twitter_2.jpg" alt="" width="160" height="240" /></a></p>
<p><span style="text-decoration: underline;">2. Post Status (TestPost.java)</span></p>
<p>This example shows how to post Twitter status. If there is no previously saved session, display authorization dialog to allow user authorize the connection then post status using different thread.</p>
<pre class="brush: java; title: ;">
public class TestPost extends Activity {
	private TwitterApp mTwitter;
	private CheckBox mTwitterBtn;
	private String username = &quot;&quot;;
	private boolean postToTwitter = false;

	private static final String twitter_consumer_key = &quot;xxxx&quot;;
	private static final String twitter_secret_key = &quot;xxxx&quot;;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		setContentView(R.layout.post);

		Button postBtn 				= (Button) findViewById(R.id.button1);
		final EditText reviewEdit   = (EditText) findViewById(R.id.revieew);

		postBtn.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				String review = reviewEdit.getText().toString();

				if (review.equals(&quot;&quot;)) return;

				postReview(review);

				if (postToTwitter) postToTwitter(review);
			}
		});

		mTwitter = new TwitterApp(this, twitter_consumer_key,twitter_secret_key);

		mTwitter.setListener(mTwLoginDialogListener);

		mTwitterBtn	= (CheckBox) findViewById(R.id.twitterCheck);

		mTwitterBtn.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				if (mTwitter.hasAccessToken()) {
					postToTwitter = mTwitterBtn.isChecked();
				} else {
					mTwitterBtn.setChecked(false);
					mTwitter.authorize();
				}
			}
		});

		if (mTwitter.hasAccessToken()) {
			username 	= mTwitter.getUsername();
			username	= (username.equals(&quot;&quot;)) ? &quot;No Name&quot; : username;

			mTwitterBtn.setText(&quot;  Twitter  (&quot; + username + &quot;)&quot;);
		}
	}

	private void postReview(String review) {
		//post to server

		Toast.makeText(this, &quot;Review posted&quot;, Toast.LENGTH_SHORT).show();
	}

	private void postToTwitter(final String review) {
		new Thread() {
			@Override
			public void run() {
				int what = 0;

				try {
					mTwitter.updateStatus(review);
				} catch (Exception e) {
					what = 1;
				}

				mHandler.sendMessage(mHandler.obtainMessage(what));
			}
		}.start();
	}

	private Handler mHandler = new Handler() {
		@Override
		public void handleMessage(Message msg) {
			String text = (msg.what == 0) ? &quot;Posted to Twitter&quot; : &quot;Post to Twitter failed&quot;;

			Toast.makeText(TestPost.this, text, Toast.LENGTH_SHORT).show();
		}
	};
	private final TwDialogListener mTwLoginDialogListener = new TwDialogListener() {
		@Override
		public void onComplete(String value) {
			username 	= mTwitter.getUsername();
			username	= (username.equals(&quot;&quot;)) ? &quot;No Name&quot; : username;

			mTwitterBtn.setText(&quot;  Twitter  (&quot; + username + &quot;)&quot;);
			mTwitterBtn.setChecked(true);

			postToTwitter = true;

			Toast.makeText(TestPost.this, &quot;Connected to Twitter as &quot; + username, Toast.LENGTH_LONG).show();
		}

		@Override
		public void onError(String value) {
			mTwitterBtn.setChecked(false);

			Toast.makeText(TestPost.this, &quot;Twitter connection failed&quot;, Toast.LENGTH_LONG).show();
		}
	};
}
</pre>
<p><a href="http://londatiga.net/images/androidtwitter/android_twitter_3.jpg"><img class="alignnone" title="Android Twitter" src="http://londatiga.net/images/androidtwitter/android_twitter_3.jpg" alt="" width="160" height="240" /></a></p>
<p><strong>Update 2011-10-01</strong></p>
<p>- Fix authorization failed bug when attempt to authorize after logging out. This was caused by an exception (<em>java.lang.IllegalStateException: consumer key/secret pair already set</em>) was thrown by <em>setOauthConsumer(consumerKey,secretKey)</em> method of Twitter class. This method should be called once.</p>
<p></p>
<p>You can download  the source code<a title="Android Twitter " href="http://londatiga.net/downloads/AndroidTwitter.zip" target="_blank"> here</a> (with external jars) or via github<a href="https://github.com/lorensiuswlt/AndroidTwitter" target="_blank"> here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.londatiga.net/it/how-to-post-twitter-status-from-android/feed/</wfw:commentRss>
		<slash:comments>173</slash:comments>
		</item>
		<item>
		<title>How to Create QuickAction Dialog in Android</title>
		<link>http://www.londatiga.net/it/how-to-create-quickaction-dialog-in-android/</link>
		<comments>http://www.londatiga.net/it/how-to-create-quickaction-dialog-in-android/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 04:00:24 +0000</pubDate>
		<dc:creator>lorenz</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Featured Articles]]></category>
		<category><![CDATA[Information Technology]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[alert dialog]]></category>
		<category><![CDATA[dialog]]></category>
		<category><![CDATA[evolving ui]]></category>
		<category><![CDATA[popup]]></category>
		<category><![CDATA[popup window]]></category>
		<category><![CDATA[quick action]]></category>
		<category><![CDATA[quick contact]]></category>
		<category><![CDATA[quickactions]]></category>
		<category><![CDATA[quickcontact]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[twitter app]]></category>
		<category><![CDATA[ui design]]></category>
		<category><![CDATA[ui pattern]]></category>

		<guid isPermaLink="false">http://www.londatiga.net/?p=636</guid>
		<description><![CDATA[[Update 15/07/2011]
I have updated the quickaction implementation code so it can be used more efficient and the dialog will be automatically dismissed after pressing the action item. All the source codes now available via github so you can track the changes.
Official Twitter application for Android  has introduced new Android UI features and behavior patterns such [...]]]></description>
			<content:encoded><![CDATA[<p><strong>[Update 15/07/2011]</strong></p>
<p><span style="color: #000000;"><em>I have updated the quickaction implementation code so it can be used more efficient and the dialog will be automatically dismissed after pressing the action item. All the source codes now available via <a title="Quickaction on github" href="https://github.com/lorensiuswlt" target="_blank">github</a> so you can track the changes.</em></span></p>
<p>Official <a title="Official Twitter for Android" href="http://twitter.com" target="_blank">Twitter</a> application for Android  has introduced new<a title="Andorid UI Patterns" href="http://android-developers.blogspot.com/2010/05/twitter-for-android-closer-look-at.html" target="_blank"> Android UI features and behavior patterns</a> such as Dashboard, Search Bar, QuickAction and Action Bar. One of the interesting pattern is <strong>QuickActions</strong> that displays contextual actions in a <a title="Android List View" href="http://developer.android.com/reference/android/widget/ListView.html" target="_blank">list view</a>. This pattern actually already exists in <em>QuickContact </em>dialog/bar in default <em>Contact</em> application (since Android 2.0).</p>
<p><img title="QuickContact" src="http://londatiga.net/images/quickactions/quickcontact.jpg" alt="QuickContact" width="200" height="300" /> <img title="QuickContact" src="http://londatiga.net/images/quickactions/twitter.jpg" alt="QuickContact" width="200" height="300" /></p>
<p>The <strong>QuickActions</strong> dialog is not included in standard <a title="Android SDK" href="http://developer.android.com/sdk/" target="_blank">Android SDK</a>, so we have to create it manually. At first, i had no idea on how to create it so i decided to download and read the Contact app source code from  <a title="Android Source Code" href="http://android.git.kernel.org/" target="_blank">Android git</a>. I found that the<em> <span style="font-style: normal;">QuickContact </span></em>dialog  uses private API call (<em>com.android.internal.policy.PolicyManager</em>) that does not exists in standard SDK. After posting question about it on google groups and <a title="QuickActions QuickContact" href="http://stackoverflow.com/questions/3170350/android-custom-dialog-like-quick-contact" target="_blank">stack overflow</a>, i got<a href="http://code.google.com/p/simple-quickactions/" target="_blank"> the solution for it</a> from <a title="QuickActions" href="http://code.google.com/p/simple-quickactions/" target="_blank">Qberticus</a> (thanx Qberticus!).</p>
<p>Qberticus&#8217;s QuickActions uses simple/plain layout so i have to create a custom layout so it will look like QuickContact in Contact app or QuickActions<em> </em>in Twitter app. Based on QuickContact source code, i made a slight modification on Qberticus&#8217;s BetterPopupWindow class and extended it to implement custom layout. I also made it customizeable, so the icon and text in action list can be customized.</p>
<p>Here are the screenshoots of QuickActions demo:</p>
<p><strong>QuickContact / Twitter-like QuickActions</strong></p>
<p><strong><img class="alignnone" title="QuickActions" src="http://londatiga.net/images/quickactions/qc1.jpg" alt="" width="200" height="300" /> <img class="alignnone" title="QuickActions" src="http://londatiga.net/images/quickactions/qc2.jpg" alt="" width="200" height="300" /></strong></p>
<p><strong>Code snippet</strong><br />
<span style="text-decoration: underline;"> Create action items</span></p>
<pre class="brush: java; title: ;">
//Add action item
ActionItem addAction = new ActionItem();

addAction.setTitle(&quot;Add&quot;);
addAction.setIcon(getResources().getDrawable(R.drawable.ic_add));

//Accept action item
ActionItem accAction = new ActionItem();

accAction.setTitle(&quot;Accept&quot;);
accAction.setIcon(getResources().getDrawable(R.drawable.ic_accept));

//Upload action item
ActionItem upAction = new ActionItem();

upAction.setTitle(&quot;Upload&quot;);
upAction.setIcon(getResources().getDrawable(R.drawable.ic_up));
</pre>
<p>Line 02: Create new action item<br />
Line 04: Set action title<br />
Line 05: Set action icon</p>
<p><span style="text-decoration: underline;">Create quickaction instance and setup listener</span></p>
<pre class="brush: java; title: ;">
final QuickAction mQuickAction 	= new QuickAction(this);

mQuickAction.addActionItem(addAction);
mQuickAction.addActionItem(accAction);
mQuickAction.addActionItem(upAction);

//setup the action item click listener
mQuickAction.setOnActionItemClickListener(new QuickAction.OnActionItemClickListener() {
	@Override
        public void onItemClick(int pos) {
		if (pos == 0) { //Add item selected
		   Toast.makeText(Example1Activity.this, &quot;Add item selected&quot;, Toast.LENGTH_SHORT).show();
		} else if (pos == 1) { //Accept item selected
		   Toast.makeText(Example1Activity.this, &quot;Accept item selected&quot;, Toast.LENGTH_SHORT).show();
		} else if (pos == 2) { //Upload item selected
		   Toast.makeText(Example1Activity.this, &quot;Upload items selected&quot;, Toast.LENGTH_SHORT).show();
		}
	}
});
</pre>
<p>Line 1: Create quickaction instance<br />
Line 3-5: Add the action items into quikaction<br />
Line 8: Setup listener for action item clicked, the <em>pos</em> argument on <em>onItemClick </em>method shows which action item is clicked.</p>
<p><span style="text-decoration: underline;">Show quickAction dialog</span></p>
<pre class="brush: java; title: ;">
btn1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
	mQuickAction.show(v);
}
});
</pre>
<p></p>
<p>Line 04: Show quickaction dialog, the <em>v</em> argument used as the anchor where the quickaction displayed.</p>
<div style="padding:10px;background:#2dd354;"><a title="Download source code" href="https://github.com/lorensiuswlt/NewQuickAction" target="_self">Download source code (Github)</a></div>
<p><strong>Gallery3D-like QuickActions</strong></p>
<p><strong><img class="alignnone" title="QuickActions" src="http://londatiga.net/images/quickactions/gl3d1.jpg" alt="" width="200" height="300" /> <img class="alignnone" title="QuickActions" src="http://londatiga.net/images/quickactions/gl3d2.jpg" alt="" width="200" height="300" /></strong></p>
<div style="padding:10px;background:#2dd354;"><a title="Download source code" href="https://github.com/lorensiuswlt/NewQuickAction3D" target="_self">Download source code (Github)</a></div>
<p><strong>Implementation on My Application</strong></p>
<p><span style="text-decoration: underline;">BlitzDroid</span></p>
<p><span style="text-decoration: underline;"><img class="alignnone" src="http://londatiga.net/images/quickactions/nowplaying.jpg" alt="" width="160" height="240" /> <img class="alignnone" src="http://londatiga.net/images/quickactions/theaters.jpg" alt="" width="160" height="240" /></span></p>
<p><span style="text-decoration: underline;">Minapolitan (Prototype)</span></p>
<p><span style="text-decoration: underline;"><img class="alignnone" src="http://londatiga.net/images/quickactions/mina1.jpg" alt="" width="160" height="240" /> <img class="alignnone" src="http://londatiga.net/images/quickactions/mina2.jpg" alt="" width="160" height="240" /></span></p>
<p><strong>Buy me a coffee</strong></p>
<p>If you found this stuff useful to your work, please consider a donation.<br />
By doing this you will be helping me to keep improving this stuff and to continue to help anyone who needs, and maybe keep on helping you in the future.</p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input name="cmd" type="hidden" value="_s-xclick" />
<input name="hosted_button_id" type="hidden" value="EVAX99KY9DURA" />
<input alt="PayPal - The safer, easier way to pay online!" name="submit" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" type="image" />
<img src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" border="0" alt="" width="1" height="1" /><br />
</form>
<p>Thanks for your support, will do my best to keep the info fresh and useful.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.londatiga.net/it/how-to-create-quickaction-dialog-in-android/feed/</wfw:commentRss>
		<slash:comments>216</slash:comments>
		</item>
		<item>
		<title>How to Create Android Update Zip Package</title>
		<link>http://www.londatiga.net/it/how-to-create-android-update-zip-package/</link>
		<comments>http://www.londatiga.net/it/how-to-create-android-update-zip-package/#comments</comments>
		<pubDate>Wed, 02 Jun 2010 09:18:19 +0000</pubDate>
		<dc:creator>lorenz</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Featured Articles]]></category>
		<category><![CDATA[Information Technology]]></category>
		<category><![CDATA[meta inf]]></category>
		<category><![CDATA[Samsung Spica]]></category>
		<category><![CDATA[spica]]></category>
		<category><![CDATA[update script]]></category>
		<category><![CDATA[update zip]]></category>

		<guid isPermaLink="false">http://www.londatiga.net/?p=606</guid>
		<description><![CDATA[There are several ways to install applications or  library files to an Android Phone. You can use Market application to find and install or adb command line tool to install or push the files to Android file system. These are all easy to implement for  single  file but if you have several applications or library [...]]]></description>
			<content:encoded><![CDATA[<p>There are several ways to install applications or  library files to an <a title="Android" href="http://www.android.com" target="_blank">Android</a> <a href="http://www.londatiga.net/it/samsung-i5700-galaxy-spica-android-2-1-flashing-guide/" target="_blank">Phone</a>. You can use <em>Market</em> application to find and install or <a title="Android ADB Tool" href="developer.android.com/guide/developing/tools/adb.html" target="_blank">adb</a> command line tool to install or push the files to Android file system. These are all easy to implement for  single  file but if you have several applications or library files to install at once, it might be better to use <strong>update zip</strong> file. The update zip file is Android advanced system to install applications or lib files to Android file system using recovery tool. This method is commonly used by rom or theme developers to distribute their package.</p>
<p>Creating an update zip file is quite easy, all you have to do is put the files in corresponding directory in Android file system and an <span style="color: #008000;">update-script</span> file to copy the files. For example, to install <span style="color: #008000;">Calculator.apk </span>into<span style="color: #008000;"> system/app</span> and copy <span style="color: #008000;">libsec-ril.so</span> file into<span style="color: #008000;"> system/lib</span> :</p>
<ul>
<li>Create an empty folder (eg. C:\myupdate)</li>
<li>Create <span style="color: #008000;">C:\myupdate\system\app</span> folder for <span style="color: #008000;">Calculator.apk</span> and <span style="color: #008000;"> C:\myupdate\system\lib</span> folder for <span style="color: #008000;">libsec-ril.so</span></li>
<li>Create <span style="color: #008000;">C:\myupdate\META-INF\com\google\android</span> folder for <span style="color: #008000;">update-script</span> file.</li>
<li>Create the<span style="color: #008000;"> update-script</span> file with the following syntax:</li>
<pre class="brush: plain; title: ;">
show_progress 0.1 0

copy_dir PACKAGE:system SYSTEM:

show_progress 0.1 10
</pre>
<p>Line 1&amp;5 : show progress bar<br />
Line 3: copy <span style="color: #008000;">s<span style="color: #008000;">ystem</span></span> folder from update package to Android&#8217;s<span style="color: #008000;"> /system</span></p>
<p>Note: you should add one extra  line at the end of the file (Line 6)</p>
<li>Compress the entire contents of <span style="color: #008000;">C:\myupdate</span> folder to zip (not the <span style="color: #008000;">myupdate </span>folder itself)</li>
<li>Sign the <span style="color: #008000;">myupdate.zip</span> file</li>
<p><span style="color: #008000;">java -jar signapk.jar certificate.pem key.pk8 myupdate.zip update.zip</span></p>
<p>Note: you can find tutorial on how to sign the update.zip file <a title="How to sign android update.zip file" href="http://www.londatiga.net/it/how-to-sign-apk-zip-files/" target="_blank">here</a></p>
<li>Copy the <span style="color: #008000;">update.zip</span> file to sdcard and apply it from recovery console</li>
</ul>
<p>update-script syntax reference (definitions from recovery.c android source code):</p>
<ul>
<li><strong>copy_dir</strong></li>
<p>Syntax:<span style="color: #008000;"> copy_dir &lt;src-dir&gt; &lt;dst-dir&gt; [&lt;timestamp&gt;]</span><br />
Copy the contents  of &lt;src-dir&gt; to  &lt;dst-dir&gt;. The original contents of &lt;dst-dir&gt; are preserved unless something in  &lt;src-dir&gt; overwrote them.<br />
Ex: <span style="color: #008000;">copy_dir PACKAGE:system SYSTEM:</span></p>
<li><strong>format</strong></li>
<p>Syntax: format &lt;root&gt;<br />
Format a partiti0n<br />
Ex:<strong> </strong><span style="color: #008000;">format SYSTEM:</span>, will format entire<span style="color: #008000;"> /system</span> . Note: formatting erases data irreversibly.</p>
<li><strong>delete</strong></li>
<p>Syntax: <span style="color: #008000;">delete  &lt;file1&gt; [... &lt;fileN&gt;]</span><br />
Delete  file.<br />
EX: <span style="color: #008000;">delete SYSTEM:app/Calculator.apk</span>, will delete <span style="color: #008000;">Calculator.apk</span> from <span style="color: #008000;">system/app</span> directory.</p>
<li><strong>delete_recursive</strong></li>
<p>Syntax: <span style="color: #008000;">delete_recursive  &lt;file-or-dir1&gt; [... &lt;file-or-dirN&gt;]</span><br />
Delete a file or directory with all of it&#8217;s contents recursively<br />
Ex: <span style="color: #008000;">delete_recursive DATA:dalvik-cache</span>, will delete<span style="color: #008000;"> /data/dalvik-cache</span> directory with all of it&#8217;s contents</p>
<li><strong>run_program</strong></li>
<p>Syntax:<span style="color: #008000;"> run_program &lt;program-file&gt; [&lt;args&gt; ...]</span><br />
Run an external program included in the update package.<br />
Ex: <span style="color: #008000;">run_program PACKAGE:install_busybox.sh</span>, will run<span style="color: #008000;"> install_busybox.sh</span> script (shell command) included in the update package.</p>
<li><strong>set_perm</strong></li>
<p>Syntax: <span style="color: #008000;">set_perm &lt;uid&gt; &lt;gid&gt; &lt;mode&gt; &lt;path&gt; [... &lt;pathN&gt;]</span><br />
Set ownership and permission of single file or entire directory trees, like &#8216;chmod&#8217;, &#8216;chown&#8217;, and &#8216;chgrp&#8217; all in one<br />
Ex:<span style="color: #008000;"> set_perm 0 2000 0550 SYSTEM:etc/init.goldfish.sh</span></p>
<li><strong>set_perm_recursive</strong></li>
<p>Syntax: <span style="color: #008000;">set_perm_recursive &lt;uid&gt; &lt;gid&gt; &lt;dir-mode&gt; &lt;file-moe&gt; &lt;path&gt; [... &lt;pathN&gt;]</span><br />
Set ownership and permission of a directory with all of it&#8217;s contents recursively</p>
<p>Ex: <span style="color: #008000;">set_perm_recursive 0 0 0755 0644 SYSTEM:app</span></p>
<li><strong>show_progress </strong></li>
<p>Syntax: <span style="color: #008000;">show_progress</span> <span style="color: #008000;">&lt;fraction&gt; &lt;duration&gt;</span><br />
Use  of the on-screen progress meter for the next operation, automatically advancing the meter over  &lt;duration&gt; seconds (or more rapidly if the actual rate of progress can be determined).<br />
Ex: <span style="color: #008000;">show_progress 0.1 0</span></p>
<li><strong>symlink</strong></li>
<p>Syntax: <span style="color: #008000;">symlink &lt;link-target&gt; &lt;link-path&gt;</span></p>
<p>Create a symlink (like &#8216;ln-s&#8217;). The &lt;link-path&gt; is in root:path format, but &lt;link-target&gt; is<br />
for the target filesystem (and may be relative)</ul>
<p>Definition of roots and partitions (from root.c android source code)</p>
<pre style="margin: 0px; padding: 6px; border: 1px inset; width: 540px; height: 386px; text-align: left; overflow: auto;" dir="ltr"> ROOT:     (Linux block device) /mountpoint/ fs, size
    Description.

  BOOT:     (/dev/mtdblock[?]) / (RAM)  Raw
    Kernel, ramdisk and  boot config.
  DATA:     (/dev/mtdblock5)   /data/   yaffs2, 91904kb
    User, system config,  app config, and apps (without  a2sd)
  CACHE:    (/dev/mtdblock4)   /cache/  yaffs2, 30720kb
    OTA cache,  Recovery/update config and temp
  MISC:     (/dev/mtdblock[?]) N/A     Raw
    [TODO: Get info on MISC:]
  PACKAGE:  (Relative to package file) N/A
    Pseudo-filesystem for update  package.
  RECOVERY: (/dev/mtdblock[?]) / (RAM) Raw,     [?]kb
    The recovery  and update environment's kernel and ramdisk.
    Similar to BOOT:.
  SDCARD:   (/dev/<strong>mmcblk</strong>0(p1)) /sdcard/ fat32,  32MB-32GB
    The microSD card. Update zip is usually here.
  SYSTEM:   (/dev/mtdblock3)   /system/ yaffs2, 92160kb
    The OS partition,    static and read-only.
  TMP:                         /tmp/    in RAM
    Standard Linux temporary directory.
    Cleared on poweroff/reboot.</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.londatiga.net/it/how-to-create-android-update-zip-package/feed/</wfw:commentRss>
		<slash:comments>27</slash:comments>
		</item>
		<item>
		<title>How to Sign Android APK or Zip Files</title>
		<link>http://www.londatiga.net/it/how-to-sign-apk-zip-files/</link>
		<comments>http://www.londatiga.net/it/how-to-sign-apk-zip-files/#comments</comments>
		<pubDate>Thu, 20 May 2010 23:45:11 +0000</pubDate>
		<dc:creator>lorenz</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Featured Articles]]></category>
		<category><![CDATA[Information Technology]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[apk]]></category>
		<category><![CDATA[rom]]></category>
		<category><![CDATA[sign apk]]></category>
		<category><![CDATA[signapk.jar]]></category>
		<category><![CDATA[theme]]></category>
		<category><![CDATA[zip]]></category>

		<guid isPermaLink="false">http://www.londatiga.net/?p=596</guid>
		<description><![CDATA[When publishing an application or a custom rom  you need to sign the .apk or .zip files with a certificate using a private key. The Android system uses the certificate to identify the author of an application and establish trust relationship between applications. The classic way of doing this was to use keytool then sign [...]]]></description>
			<content:encoded><![CDATA[<p>When publishing an application or a custom rom  you need to sign the .apk or .zip files with a <a title="Public Key Certificate" href="en.wikipedia.org/wiki/Public_key_certificate" target="_blank">certificate</a> using a private key. The <a title="Android OS" href="http://android.com" target="_blank">Android</a> system uses the certificate to identify the author of an application and establish trust relationship between applications. The classic way of doing this was to use <a title="Java Keytool" href="java.sun.com/j2se/1.3/docs/tooldocs/win32/keytool.html" target="_blank">keytool</a> then sign it with  <a title="Java Jarsigner" href="java.sun.com/j2se/1.3/docs/tooldocs/win32/jarsigner.html" target="_blank">jarsigner</a>. In this tutorial i&#8217;ll explain an alternative method which is relatively easy to use for most people  using a tool called <span style="color: #008000;">SignApk.jar</span>.</p>
<p>SignApk.jar is a tool included with the Android platform source bundle, you can download it from<a title="SignApk.jar" href="http://rapidshare.com/files/389657927/SignApk.rar" target="_blank"> here</a>. To use SignApk.jar you have to create a private key with it&#8217;s corresponding certificate/public key. To create private/public key pair, you can use <a title="Openssl" href="http://www.openssl.org" target="_blank">Openssl</a>. Openssl is relatively easy to use under unix/linux system. For Windows user, you can download Windows version of Openssl <a title="Openssl Windows" href="http://code.google.com/p/openssl-for-windows/" target="_blank">here</a>.</p>
<p><strong>How to create private/public key pair using openssl (windows version)</strong></p>
<ul>
<li>Download openssl package from link given above</li>
<li>Extract it anywhere on your drive (eg. C:\openssl)</li>
<li>Within openssl directory type (use cmd tool):</li>
<p><span style="color: #008000;">- openssl genrsa -out key.pem 1024<br />
- openssl req -new -key key.pem -out request.pem<br />
- openssl x509 -req -days 9999 -in request.pem -signkey key.pem -out certificate.pem<br />
- openssl pkcs8 -topk8 -outform DER -in key.pem -inform PEM -out key.pk8 -nocrypt</span></p>
<p><img class="alignnone" title="Openssl Windows" src="http://londatiga.net/images/signapk/openssl.jpg" alt="" width="450" height="220" /></ul>
<p><strong>How to sign apk or zip files using SignApk.jar</strong>:</p>
<p></p>
<ul>
<li>Download SignApk.rar from link given above</li>
<li>Extract it  anywhere on your drive (eg. c:\SignApk)</li>
<li>If you don&#8217;t have java installed, <a href="https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/ViewProductDetail-Start?ProductRef=jre-6u20-oth-JPR@CDS-CDS_Developer" target="_blank">download </a> and install it.</li>
<li>Copy certificate.pem and key.pk8 into your extracted SignApk directory</li>
<li>Within SignApk directory type:</li>
<p><span style="color: #008000;">java -jar signapk.jar certificate.pem key.pk8 your-app.apk  your-signed-app.apk<br />
</span><br />
OR</p>
<p><span style="color: #008000;">java -jar signapk.jar certificate.pem key.pk8 your-update.zip  your-signed-update.zip<br />
</span></ul>
<p>Note:</p>
<p>If you don&#8217;t want to create your own public/private key pair, you can use test key included in SignApk.rar.</p>
<p>Reference:</p>
<p><a href="http://android-dls.com/wiki/index.php?title=Generating_Keys" target="_blank">android-dls.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.londatiga.net/it/how-to-sign-apk-zip-files/feed/</wfw:commentRss>
		<slash:comments>33</slash:comments>
		</item>
		<item>
		<title>How to Share Internet Connection Between PC and Android Phone Using WiFi</title>
		<link>http://www.londatiga.net/it/how-to-share-internet-connection-between-pc-and-android-phone-using-wifi/</link>
		<comments>http://www.londatiga.net/it/how-to-share-internet-connection-between-pc-and-android-phone-using-wifi/#comments</comments>
		<pubDate>Wed, 05 May 2010 03:13:28 +0000</pubDate>
		<dc:creator>lorenz</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Featured Articles]]></category>
		<category><![CDATA[Information Technology]]></category>
		<category><![CDATA[access point]]></category>
		<category><![CDATA[ad hoc]]></category>
		<category><![CDATA[internet connection]]></category>
		<category><![CDATA[laptop]]></category>
		<category><![CDATA[pc]]></category>
		<category><![CDATA[Samsung Spica]]></category>
		<category><![CDATA[share internet]]></category>
		<category><![CDATA[spica]]></category>
		<category><![CDATA[wi-fi]]></category>
		<category><![CDATA[wifi]]></category>
		<category><![CDATA[windows 7]]></category>

		<guid isPermaLink="false">http://www.londatiga.net/?p=576</guid>
		<description><![CDATA[WiFi Ad-Hoc Networking is a popular method to share internet connection between  computers (pc or laptop) or between a computer and a smartphone that has built in WiFi. Unfortunately, this method of networking is not supported by Android since it was released until the time of this writting. One of the popular method to enable [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Ad Hoc Android" href="http://compnetworking.about.com/cs/wirelessfaqs/f/adhocwireless.htm" target="_blank">WiFi Ad-Hoc Networking</a> is a popular method to share internet connection between  computers (pc or laptop) or between a computer and a smartphone that has built in WiFi. Unfortunately, this method of networking is<a title="Android WiFi Issue" href="http://code.google.com/p/android/issues/detail?id=82" target="_blank"> not supported by Android</a> since it was released until the time of this writting. One of the popular method to enable ad hoc mode on Android devices is by  changing a WiFi configuration file located on /system/etc directory called <a title="wifi ad hoc g1 htc dream" href="http://modmygphone.com/forums/showthread.php?t=22681" target="_blank">tiwlan.ini</a>. But this method is specific to phone&#8217;s WiFi chipset and you need root access to change the file. The tiwlan.ini is a configuration file for Texas Instruments WiFi chipset (e.g HTC dream) so you will not find it on <a title="Samsung Galaxy Spica" href="http://www.google.com/url?sa=t&amp;source=web&amp;ct=res&amp;cd=1&amp;ved=0CAYQFjAA&amp;url=http%3A%2F%2Fwww.samsung.com%2Fie%2Fconsumer%2Fmobile-phones%2Fmobile-phones%2Ftouch-screen%2FGT-I5700UWAXEU%2Findex.idx%3Fpagetype%3Dprd_detail&amp;ei=Qt7gS_ebGtG2rAeV9bSTBw&amp;usg=AFQjCNFHD1VwX-yWX154AhHI_W0W88nTmQ" target="_blank">Samsung Spica</a> that use Broadcom WiFi chipset.</p>
<p>Another alternative method is by using a software based virtual access point that using <a href="http://msdn.microsoft.com/en-us/library/dd815243%28VS.85%29.aspx" target="_blank">Windows 7&#8217;s Wireless Hosted Network</a> technology. This method only runs on Windows 7 and hardware specific. Currently i found two best virtual access point softwares, <a href="http://virtualrouter.codeplex.com" target="_blank">Virtual Router</a> and <a href="http://www.connectify.me/" target="_blank">Connectify</a>. They both operate in the same maner and very easy to use. I have tested both of them to share internet connection from my PC that used  <a href="http://phonearea.net/new-att-usbconnect-881-delivers-enhanced-performance-and-automatic-att-software-installation/" target="_blank">Sierra Wireless USBConnect 881 </a>modem for internet access and an external <a href="http://www.tp-link.com/products/productDetails.asp?pmodel=TL-WN321G" target="_blank">TP-Link TL-WN31G</a> Wireless USB adapter with my Samsung Spica.</p>
<p>Here is the guide on how to use virtual router and connectify</p>
<p><strong>On Windows 7 Box:</strong></p>
<ul>
<li>Download and install <a href="http://virtualrouter.codeplex.com/releases/view/36035#DownloadId=93540" target="_blank">Virtual Router</a> or <a href="http://dw.com.com/redir?edId=3&amp;siteId=4&amp;oId=3000-18508_4-75024171&amp;ontId=18508_4&amp;spi=385fa01b361c87511ff78a4b472b15bc&amp;lop=link&amp;tag=tdw_dltext&amp;ltype=dl_dlnow&amp;pid=11356466&amp;mfgId=10061477&amp;merId=10061477&amp;pguid=Soqg-QoPjAUAAEjPtOkAAAAN&amp;destUrl=http%3A%2F%2Fdownload.cnet.com%2F3001-18508_4-75024171.html%3Fspi%3D385fa01b361c87511ff78a4b472b15bc%26part%3Ddl-10061477" target="_blank">Connectify</a>, you can try one of them. They are hardware specific so read the documentation on their websites about the supported WiFi devices.</li>
<li>Fill in the settings panel with your prefered WiFi name, password and internet connection to share</li>
<div class="wp-caption alignnone" style="width: 460px"><img title="Virtual Router" src="http://londatiga.net/images/wifi/virtual_router.jpg" alt="Virtual Router" width="450" height="349" /><p class="wp-caption-text">Virtual Router</p></div>
<div class="wp-caption alignnone" style="width: 260px"><img title="Connectify " src="http://londatiga.net/images/wifi/connectify.jpg" alt="Connectify " width="250" height="409" /><p class="wp-caption-text">Connectify </p></div>
<li>Click start button to start sharing</li>
<li>On your <span style="color: #008000;">Wireless Connection Status</span>, click <span style="color: #008000;">Details</span> to get the network connection information, note the <span style="color: #008000;">IPV4 Address</span><span style="color: #008000;"> </span></li>
<p><img class="alignnone" src="http://londatiga.net/images/wifi/network.jpg" alt="" width="250" height="294" /></ul>
<p><strong>On Android Device</strong></p>
<p></p>
<ul>
<li>Go to <span style="color: #008000;">Settings -&gt; Wireless &amp; networks -&gt; Wi-Fi Settings</span></li>
<li>Open <span style="color: #008000;">Advance</span> settings menu</li>
<li>Tick the<span style="color: #008000;"> Use static IP</span> option</li>
<li>Enter your desired IP address (ex: 192.168.2.2)  into<span style="color: #008000;"> Ip Address <span style="color: #000000;">field</span><br />
</span></li>
<li>Enter your<span style="color: #008000;"> IPV4 Address</span> (ex. 192.168.2.1) into <span style="color: #008000;">Gateway </span><span style="color: #008000;"><span style="color: #000000;">field</span></span></li>
<li>Enter 255.255.255.0 into <span style="color: #008000;">Netmask </span><span style="color: #008000;"><span style="color: #000000;">field</span></span></li>
<li>Enter your internet connection&#8217;s DNS server (use<em><span style="color: #008000;"> ipconfig /all</span></em> command to get DNS info) into <span style="color: #008000;">DNS 1</span> and <span style="color: #008000;">DNS 2</span>. As an alternative, you can use <a title="Google Public DNS" href="http://code.google.com/speed/public-dns/" target="_blank">Google Public DNS</a>: 8.8.8.8 and 8.8.4.4</li>
<div class="wp-caption alignnone" style="width: 210px"><img title="Wifi Static IP Setting" src="http://londatiga.net/images/wifi/android-wifi-staticip.jpg" alt="Wifi Static IP Setting" width="200" height="300" /><p class="wp-caption-text">Wifi Static IP Setting</p></div>
<li>Connect to Wi-Fi using your password</li>
<li>Disable and Enable Wi-Fi (in case if it won&#8217;t connect)</li>
<div class="wp-caption alignnone" style="width: 210px"><img title="Android Wi-Fi" src="http://londatiga.net/images/wifi/android-wifi.jpg" alt="Android Wi-Fi" width="200" height="300" /><p class="wp-caption-text">Android Wi-Fi</p></div>
<li>Check the connection using browser or other application.</li>
</ul>
<p><strong>Update:</strong></p>
<p>Latest version of Connectify uses dhcp so it is unnecessary to use static ip on Android.</p>
<p>If you have trouble while using Virtual Router or Connectify, please check if your wifi card is supported or read the documentation or disccussion on their support page.</p>
<p><span style="text-decoration: underline;">Supported devices:</span> <a href="http://virtualrouter.codeplex.com/wikipage?title=Supported%20Devices&amp;referringTitle=Documentation" target="_blank">Virtual Router</a> | <a href="http://support.connectify.me/entries/20316736-list-of-devices-that-are-known-to-be-compatible-with-connectify" target="_blank">Connectify</a></p>
<p><span style="text-decoration: underline;">Documentation and support:</span> <a href="http://virtualrouter.codeplex.com/discussions" target="_blank">Virtual Router</a> | <a href="http://support.connectify.me/categories/20011096-support" target="_blank">Connectify</a></p>
<p><strong>Troubleshooting:</strong></p>
<p>If you can&#8217;t connect to internet though the client already connected to the hotspot (connectify or virt.router), these are the possible solutions:</p>
<ul>
<li>Try to disable antivirus or firewall</li>
<li>Try to stop and start the hotspot</li>
<li>Try to kill the hotspot process using task manager and restart the hotspot</li>
<li>Try to disable and enable wifi on Android</li>
<li>Check if your wifi card supported by the hotspot (check the reference sites above)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.londatiga.net/it/how-to-share-internet-connection-between-pc-and-android-phone-using-wifi/feed/</wfw:commentRss>
		<slash:comments>291</slash:comments>
		</item>
		<item>
		<title>Samsung  I5700 Galaxy Spica Android 2.1 Flashing Guide</title>
		<link>http://www.londatiga.net/it/samsung-i5700-galaxy-spica-android-2-1-flashing-guide/</link>
		<comments>http://www.londatiga.net/it/samsung-i5700-galaxy-spica-android-2-1-flashing-guide/#comments</comments>
		<pubDate>Fri, 09 Apr 2010 06:55:50 +0000</pubDate>
		<dc:creator>lorenz</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Featured Articles]]></category>
		<category><![CDATA[Information Technology]]></category>
		<category><![CDATA[Android 2.1]]></category>
		<category><![CDATA[Eclair]]></category>
		<category><![CDATA[flashing Spica]]></category>
		<category><![CDATA[Galaxy Spica]]></category>
		<category><![CDATA[Samsung Galaxy Spica]]></category>
		<category><![CDATA[Samsung I5700]]></category>
		<category><![CDATA[Samsung Spica]]></category>

		<guid isPermaLink="false">http://www.londatiga.net/?p=561</guid>
		<description><![CDATA[This is a complete guide to flash (upgrade) your Samsung I5700 Galaxy Spica to Android 2.1 (firmware EXXJCE (March 2010)). I have tested it on my own Spica with firmware version DXIL1 and two of my friends with firmware version DXJA1 and it really worked. You can use this guide to upgrade your Spica at [...]]]></description>
			<content:encoded><![CDATA[<p>This is a complete guide to flash (upgrade) your <a title="Samsung I5700 Galaxy Spica" href="http://www.gsmarena.com/samsung_i5700_galaxy_spica-2965.php" target="_blank">Samsung I5700 Galaxy Spica</a> to Android 2.1 (firmware EXXJCE (March 2010)). I have tested it on my own Spica with firmware version DXIL1 and two of my friends with firmware version DXJA1 and it really worked. <span style="color: #ff0000;"><strong>You can use this guide to upgrade your Spica at your own risk and don&#8217;t blame me if you turn out your Spica into a bricked device <img src='http://www.londatiga.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> .</strong></span></p>
<p><span style="color: #008000;">(This guide has been updated on 07 May 2010, find it at the bottom of this post)</span></p>
<p><span style="color: #008000;"><span style="color: #0000ff;"><span style="color: #008000;"><strong>MULTITOUCH</strong> now is enabled on Spica, check the guide on how to enab</span><span style="color: #0000ff;"><span style="color: #008000;">l</span>e i</span></span><span style="color: #0000ff;">t</span><a title="Spica Multitouch Guide" href="http://www.londatiga.net/it/how-to-enable-multitouch-on-samsung-spica" target="_blank"> here</a></span></p>
<p><strong>What you need:</strong></p>
<ul>
<li>Firmware I570EXXJCE (<a title="Samsung Firmware I570EXXJCE" href="http://www.multiupload.com/FKOIOEPX02" target="_blank">I570EXXJCE.zip</a> )</li>
<li>Odin Multi Downloader + spica_jc3.ops (<a title="Odin Multi Downloader + Spica_jc3.ops" href="http://rapidshare.com/files/373494485/Odin_v4.03_spica_jc3_ops.rar" target="_blank">Odin_v4.03_spica_jc3_ops.rar</a>)</li>
<li>Boot loader file (<a title="Boot loader" href="http://rapidshare.com/files/373494246/jb4_bootloader.rar" target="_blank">jb4_bootloader.rar</a>)</li>
<li>CSC file (<a title="CSC File" href="http://rapidshare.com/files/373491271/I570EOLBJB3-CSC-CL167487-OLB.tar" target="_blank">I570EOLBJB3-CSC-CL167487-OLB.tar</a>)</li>
<li>For Windows XP users: Samsung USB driver for I5700 (available in your Samsung New PC Studio CD)</li>
<li>For Windows 7 users: drivers from PC Studio CD will not work. Download  &amp; install the latest <a href="http://img.samsungapps.com/support/kies_win.zip" target="_blank">Samsung Kies</a></li>
<li>Samsung USB cable</li>
</ul>
<p><strong>Alternative download links (Mydropbox, ads free, direct download) </strong>(Big thanx to Yousef)<strong>:</strong></p>
<ul>
<li><a title="Samsung Firmware I570EXXJCE" href="http://is.gd/defU7" target="_blank">I570EXXJCE.zip</a></li>
<li><a title="Odin Multi Downloader + Spica_jc3.ops" href="http://is.gd/defVI" target="_blank">Odin_v4.03_spica_jc3_ops.rar</a></li>
<li><a title="Boot loader" href="http://is.gd/defXr" target="_blank">jb4_bootloader.rar</a></li>
<li><a title="CSC File" href="http://is.gd/defYR" target="_blank">I570EOLBJB3-CSC-CL167487-OLB.tar</a></li>
</ul>
<p><strong>Note for I5700 driver:</strong></p>
<p>If windows doesn&#8217;t detect the phone in download mode, disconnect the phone &amp; try to uninstall pc studio or kies then reboot. Reinstall pc studio or kies then connect the phone (you may also remove &amp; insert the battery before connecting the phone).</p>
<p><strong>Before start checklist:</strong></p>
<ul>
<li>Check your firmware using *#1234#</li>
<li>Backup your data (contacts, sms, etc)</li>
<li>Ensure that your phone battery power is sufficient</li>
<li>Release the SIM lock (check SIM lock status using *#7465625#)</li>
<li>Extract all required files into a folder (those files will be: I570EXXJCE.zip &#8211;&gt; <span style="color: #008000;">I570EXXJCE.tar</span>; Odin_v4.03_spica_jc3_ops.rar &#8211;&gt; <span style="color: #008000;">Odin Multi Downloader v4.03.exe,</span> <span style="color: #008000;">spica_jc3.ops</span>; jb4_bootloader.rar &#8211;&gt; <span style="color: #008000;">I570EXXJA1_CLI32638_Bootloader.tar</span>, <span style="color: #008000;">I570XXJB4_Phone.tar</span>; <span style="color: #008000;">I570EOLBJB3-CSC-CL167487-OLB.tar</span>).</li>
<li>Shutdown or disable  Antivirus and Samsung PC Studio if any.</li>
</ul>
<p><strong>How to flash:</strong></p>
<p><strong>Preparation</strong></p>
<ol>
<li>Shutdown your phone and remove the SIM Card and SDCard.</li>
<li>Press<strong> <span style="color: #008000;">&#8220;</span><span style="color: #008000;">volume down</span></strong><span style="color: #008000;"> + </span><strong><span style="color: #008000;">power button</span></strong><span style="color: #008000;"> + </span><strong><span style="color: #008000;">camera</span><span style="color: #008000;">&#8220;</span></strong> to put the phone into download mode.</li>
<div class="wp-caption alignnone" style="width: 123px"><img class=" " title="Spica Download Mode" src="http://londatiga.net/images/flashingspica/spica_download_mode.jpg" alt="Spica Download Mode" width="113" height="201" /><p class="wp-caption-text">Spica Download Mode</p></div>
<li>Connect the phone to PC using USB cable. You can check the connection in Windows device manager, make sure that your phone is properly detected by Windows like picture below</li>
<div class="wp-caption alignnone" style="width: 460px"><img title="Windows Device Manager" src="http://londatiga.net/images/flashingspica/windows_samsung_driver.jpg" alt="Windows Device Manager" width="450" height="315" /><p class="wp-caption-text">Windows Device Manager</p></div>
<li>Run the <span style="color: #008000;">Odin Multi Download v4.03.exe</span>. If your phone is properly detected, the <span style="color: #008000;">Com Port Mapping</span> field should be in yellow background.</li>
</ol>
<p><strong>Flash I</strong></p>
<ol>
<li>Select <span style="color: #008000;">spica_jc3.ops</span> into <span style="color: #008000;"><span style="color: #0000ff;">Select OP</span><span style="color: #0000ff;">S</span></span> field</li>
<li>Select <span style="color: #008000;">I570EXXJCE.tar</span> into <span style="color: #0000ff;">Selet Integrate Package &#8211; Choose One Package Option</span> field</li>
<li>Tick the <span style="color: #008000;">One Package</span> option</li>
<li>Click <span style="color: #008000;">Start</span> to start flashing. The timer and progress bar above<span style="color: #0000ff;"> </span><span style="color: #0000ff;">COM Port Mapping</span> field should start . If the progress bar doesn&#8217;t start but the timer continue to run , close Odin and disconnect the phone from PC. Remove and insert the battery and start the phone in download mode again, then run Odin.</li>
<li>Wait until <span style="color: #008000;">PASS</span> message appear in<span style="color: #0000ff;"> M</span><span style="color: #0000ff;">essage</span> box and the progress bar box turns into blue.</li>
<li>At this step, you may get the flashing seems to be failed, and you&#8217;ll see exclamation mark appears like image shown below. Don&#8217;t worry, this is not the end of your spica, close the Odin and disconnect the phone from PC.</li>
<p><img style="border: 0px initial initial;" title="Spica Flashing Error" src="http://londatiga.net/images/flashingspica/spica_flash_error.jpg" alt="" width="128" height="180" /></p>
<li>Remove and insert the battery, start the phone in download mode then run  Odin again and follow the steps in Flash II.</li>
<div>
<dl style="text-align: center; background-color: #f3f3f3; padding-top: 4px; width: 460px; margin: 10px; border: 1px solid #dddddd;">
<dt><a href="http://londatiga.net/images/flashingspica/odin_flash_1s.jpg"><img style="padding: 0px; margin: 0px; border: 0px none initial;" title="Odin Flash I" src="http://londatiga.net/images/flashingspica/odin_flash_1s.jpg" alt="Click to enlarge" width="450" height="310" /></a></dt>
<dd style="font-size: 11px; line-height: 17px; padding-top: 0px; padding-right: 4px; padding-bottom: 5px; padding-left: 4px; margin: 0px;">Click to enlarge</dd>
</dl>
</div>
</ol>
<p><strong><span style="color: #ff0000;">Note: If you already get Eclair on this stage, skip the Flash II &amp; III.</span></strong><br />
<strong> </strong></p>
<p><strong>Flash II</strong></p>
<ol>
<li>Keep <span style="color: #008000;">spica_jc3.ops</span> in <span style="color: #0000ff;">Select OPS</span> field.</li>
<li>Click <span style="color: #008000;">Reset Files</span> to clear the fields.</li>
<li>In <span style="color: #0000ff;">Select Images to download <span style="color: #000000;">pane</span></span><span style="color: #000000;">l</span>, Select <span style="color: #008000;">I570EXXJA1_CLI32638_Bootloader.tar</span><span style="color: #008000;"> </span>into <span style="color: #0000ff;">BOOT <span style="color: #000000;">field</span></span>,<span style="color: #008000;">I570XXJB4_Phone.tar</span> into <span style="color: #008000;">PHONE</span> field,  <span style="color: #008000;">I570EOLBJB3-CSC-CL167487-OLB.ta</span><span style="color: #008000;">r</span> into <span style="color: #0000ff;">CSA <span style="color: #000000;">field</span></span>, and let the <span style="color: #0000ff;">PDA<span style="color: #000000;">field</span><span style="color: #000000;"> </span></span>empty.</li>
<li>In <span style="color: #0000ff;">Debug Option</span> panel, tick  <span style="color: #008000;">Debug Only</span> and <span style="color: #008000;">PDA Format</span> option. Don&#8217;t tick <span style="color: #008000;">One Package</span> option in <span style="color: #0000ff;">Option Panel</span>.</li>
<li>Click <span style="color: #008000;">Start</span> and watch the progress bar and timer, wait untill <span style="color: #008000;">PASS </span>message appear on <span style="color: #008000;">Message</span> box.</li>
<li>Disconect the phone from PC, remove and insert the battery, start the phone in download mode again then continue to Flash III.</li>
<div>
<dl style="text-align: center; background-color: #f3f3f3; padding-top: 4px; width: 460px; margin: 10px; border: 1px solid #dddddd;">
<dt><a href="http://londatiga.net/images/flashingspica/odin_flash_2.jpg"><img style="padding: 0px; margin: 0px; border: 0px none initial;" title="Odin Flash II" src="http://londatiga.net/images/flashingspica/odin_flash_2s.jpg" alt="Click to enlarge" width="450" height="310" /></a></dt>
<dd style="font-size: 11px; line-height: 17px; padding-top: 0px; padding-right: 4px; padding-bottom: 5px; padding-left: 4px; margin: 0px;">Click to enlarge</dd>
</dl>
</div>
</ol>
<p><strong>Flash III</strong></p>
<ol>
<li>Keep <span style="color: #008000;">spica_jc3.ops</span> in <span style="color: #0000ff;">Select OPS</span> field.</li>
<li>Click <span style="color: #008000;">Reset Files</span> to clean the fields.</li>
<li>In <span style="color: #0000ff;">Select Images to download pane</span><span style="color: #0000ff;">l</span>, Select <span style="color: #008000;">I570EXXJCE.tar<span style="color: #000000;"> into PDA field. </span></span></li>
<li><span style="color: #008000;"><span style="color: #000000;">If you get an error dialog, rename the <span style="color: #008000;">I570EXXJCE.tar</span> into <span style="color: #008000;">I570EXXJCE_PDA.tar</span> and insert into PDA field again.</span></span></li>
<li><span style="color: #008000;"><span style="color: #000000;">Don&#8217;t select <span style="color: #008000;">One Package</span> option and <span style="color: #008000;">Debug Option</span>. </span></span></li>
<li>Click <span style="color: #008000;">Start </span>and watch the progress bar and timer, wait untill <span style="color: #008000;">PASS</span> message appear on <span style="color: #008000;">Message</span> box.</li>
<li>The phone will restart and you will get the Eclair screen <img src='http://www.londatiga.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> .</li>
<p><div class="wp-caption alignnone" style="width: 460px"><a href="http://londatiga.net/images/flashingspica/odin_flash_3.jpg"><img title="Odin Flash III" src="http://londatiga.net/images/flashingspica/odin_flash_3s.jpg" alt="Click to enlarge" width="450" height="309" /></a><p class="wp-caption-text">Click to enlarge</p></div></ol>
<p>Now you have the new Eclair in your Spica, but wait, firmare EXXJCE is french firmware, so you&#8217;ll get your Spica language in French, to change the language, enter<span style="color: #ff6600;"> param<span id="result_box"><span style="background-color: #ffffff;" title="parameter">è</span></span>tres</span> menu at bottom corner then choose <span style="color: #ff6600;">Param<span id="result_box"><span style="background-color: #ffffff;" title="parameter">è</span></span>tres de langue</span> then<span style="color: #ff6600;"> Langue et r<span id="result_box"><span style="background-color: #ffffff;" title="parameter">è</span></span>gion</span> and select your language.</p>
<p><strong>Rooting Your New Eclair</strong></p>
<p>In some cases, you may need your Spica to be rooted in order to install some applications like shootme, my favourite screen capture application. This is just optional, you don&#8217;t have to follow this step. I use  <a title="LkMod 2.5.1" href="http://forum.samdroid.net/threads/336-Mod-LkMod-v.-2.4.1-based-on-JCB-EN-upd-20.03" target="_blank">LkMod v2.5.1</a> by <a href="http://forum.samdroid.net/members/2-LeshaK">Leshak</a> that based on EXXJCE firmware to get my Spica rooted and get some additional features like live wallpaper and custom logo while booting my Spica.</p>
<p><strong>LkMod 2.5.1 features:</strong></p>
<ul>
<li>New phone.apk (<a title="phone.apk" href="http://forum.xda-developers.com/showthread.php?t=539752" target="_blank">from xdadev</a>)</li>
<li>Helixlauncher as default home (can be switched with default Pantheon)</li>
<li>Live wallpaper</li>
<li>Root (su)</li>
<li>Busybox</li>
<li>Remount</li>
<li>fdump for backup</li>
<li>Custom logo</li>
</ul>
<p><strong>What you need:</strong></p>
<ul>
<li> <a title="LkMod v2.5.1" href="http://www.multiupload.com/6R27NNDAX0" target="_blank">LkMod v.2.5.1</a> (multiupload) | <a title="LkMod v2.5.1" href="http://is.gd/deg0L" target="_blank">LkMod v.2.5.1</a> (mydropbox)</li>
<li><a href="http://downloads.sourceforge.net/project/gnuwin32/tar/1.13-1/tar-1.13-1-bin.exe?use_mirror=nchc" target="_blank">GNU tar for windows</a> (optional if you wan&#8217;t to change the logo)</li>
</ul>
<p><strong>Create your custom logo (Optional)</strong></p>
<p>Default logo comes with LkMod can be replaced with your own logo, you can replace the logo with your own using Photoshop or other image manipulating software.</p>
<p><strong>How to change the logo:</strong></p>
<ol>
<li>Install the GNU tar for windows, default location is on C:\Program Files\GnuWin32</li>
<li>Extract LkMod-2_5_1-PDA.7z and you&#8217;ll get  LkMod-2_5_1-PDA.tar</li>
<li>Extract LkMod-2_5_1-PDA.tar and you&#8217;ll get four files: cache.rfs, datafs.rfs, logo.png and zImage.</li>
<li>Create your own logo with 320&#215;480 size and PNG file type. <span style="color: #ff0000;"><strong>Warning: The size of logo file must be between  30-40 kb or the phone will never be able to boot</strong></span><strong><span style="color: #ff0000;">!!</span>.</strong></li>
<li>Save as logo.png and replace the default logo.png</li>
<li>Package the four files using GNU tar command line program</li>
<p><span style="color: #0000ff;">&gt;C:\Program Files\GnuWin32\tar -cvf LkMod-2_5_1-PDA.tar cache.rfs datafs.rfs logo.png zImage</span></p>
<li>You&#8217;ll get your own LkMod with your own custom logo (LkMod-2_5_1-PDA.tar)</li>
</ol>
<p><strong>How to flash</strong></p>
<ol>
<li>Select <span style="color: #008000;">spica_jc3.ops</span> in <span style="color: #0000ff;">Select OPS</span> field.</li>
<li>Click <span style="color: #008000;">Reset Files</span> to clean the fields.</li>
<li>In <span style="color: #0000ff;">Select Images to download pane</span><span style="color: #0000ff;">l</span>, Select <span style="color: #008000;">LkMod-2_5_1-PDA.tar<span style="color: #000000;"> into PDA field.</span></span></li>
<li><span style="color: #008000;"><span style="color: #000000;">Don&#8217;t select <span style="color: #008000;">One Package</span> option and <span style="color: #008000;">Debug Option</span>.</span></span></li>
<li>Click <span style="color: #008000;">Start </span>and watch the progress bar and timer, wait untill <span style="color: #008000;">PASS</span> message appear on <span style="color: #008000;">Message</span> box.</li>
<li>The phone will restart and you will get the rooted Eclair with helixlauncher default home.</li>
</ol>
<table border="0">
<tbody>
<tr>
<td><img class="alignleft" style="padding-right:5px" title="Android 2.1 Spica" src="http://londatiga.net/images/flashingspica/01-eclair.jpg" alt="" width="200" height="300" /></td>
<td><img class="alignleft" title="Android 2.1 Spica" src="http://londatiga.net/images/flashingspica/02-eclair.jpg" alt="" width="200" height="300" /></td>
</tr>
<tr>
<td><img class="alignleft" title="Android 2.1 Spica" src="http://londatiga.net/images/flashingspica/03-eclair.jpg" alt="" width="200" height="300" /></td>
<td><img class="alignleft" title="Android 2.1 Spica" src="http://londatiga.net/images/flashingspica/04-eclair.jpg" alt="" width="200" height="300" /></td>
</tr>
<tr>
<td><img class="alignleft" title="Android 2.1 Spica" src="http://londatiga.net/images/flashingspica/05-eclair.jpg" alt="" width="200" height="300" /></td>
<td><img class="alignleft" title="Android 2.1 Spica" src="http://londatiga.net/images/flashingspica/06-eclair.jpg" alt="" width="200" height="300" /></td>
</tr>
<tr>
<td colspan="2"><img class="alignleft" title="Android 2.1 Spica" src="http://londatiga.net/images/flashingspica/07-eclair.jpg" alt="" width="200" height="300" /></td>
</tr>
</tbody>
</table>
<p><strong>Usefull information about Samsung Firmware</strong></p>
<p><strong>Europe</strong><br />
XA = Austria, France, Germany, Italy, Netherlands, Switzerland, UK<br />
XB = Denmark, Norway, Sweden<br />
XC = Portugal, Spain<br />
XD = Croatia, Czech, Hungary, Slovakia<br />
XE = Bulgaria, Estonia, Kazakhstan, Latvia, Lithuania, Russia, Ukraine<br />
XF = Bulgaria, Croatia, Romania<br />
XP = Dutch, French, Italian, Spanish, Dutch, Polski, Portuguese, Turkish<br />
XW = UK, Italy, Germany, France, Australia, Netherlands, Belgium, Switzerland<br />
XX = Austria, Belgium, France, Germany, Hungary, Italy, Spain, United Kingdom</p>
<p><strong>Asia</strong><br />
DD = India<br />
DX = Indonesia, Malaysia, Philippines, Singapore, Vietnam<br />
ZC = China, Hong Kong<br />
ZH = Hong Kong</p>
<p><strong>Code = Year &#8211; Month</strong><br />
A = 2001 &#8211; January<br />
B = 2002 &#8211; February<br />
C = 2003 &#8211; March<br />
D = 2004 &#8211; April<br />
E = 2005 &#8211; May<br />
F = 2006 &#8211; June<br />
G = 2007 &#8211; July<br />
H = 2008 &#8211; August<br />
I = 2009 &#8211; September<br />
J = 2010 &#8211; October<br />
K = 2011 &#8211; Novermber<br />
L = 2012 &#8211; December</p>
<p>Example,</p>
<p>My Spica has firmware version I5700DXIL1<br />
DX = Indonesia, Malaysia, Philippines, Singapore, Vietnam<br />
I = 2009<br />
L = December<br />
1 = Version</p>
<p><span style="color: #008000;"><strong>Update May 17, 2010</strong></span> <span style="color: #000000;"> </span></p>
<p><span style="color: #000000;">1. DXJC4 (Asia) Firmware</span></p>
<p><span style="color: #000000;">If you have flashed to JCE and want to reflash it to DXJC4, flash with DXJB3 first (complete package) using Sameer&#8217;s guide than flash to DXJC4 as one package.</span></p>
<p><span style="color: #000000;">2. EXXJD1+ Lk2.02 modd<br />
</span></p>
<p><span style="color: #000000;"> </span> <span style="color: #000000;">If you are using JCE and want to upgrade to JD1, flash JD1 (complete package) using Sameer&#8217;s guide and then apply <a href="http://forum.samdroid.net/threads/624-Spica-v.LK2.02-Root-Recovery-Apps2SD-Busybox-Wifi-tether-etc-04-15-2010-EN" target="_blank">Leshak&#8217;s Lk2.02 mod</a>. </span></p>
<p><span style="color: #000000;">3. F0r Indonesian users that use Europe firmware (jce,jcf,jd1), to overcome problem with 3 and im2 simcard:</span></p>
<p><span style="color: #000000;">- For rooted device without Lk2.02:</span></p>
<ul>
<li><span style="color: #000000;">Download <a title="dxjc4 libsec-ril.so, fix 3 &amp; im2 problem" href="http://rapidshare.com/files/384383635/libsec-ril.zip" target="_blank">libsec-ril.so</a></span></li>
<li><span style="color: #000000;">Using ADB tool:</span></li>
<li><span style="color: #000000;">adb push libsec-ril.so /sdcard </span></li>
<li><span style="color: #000000;">adb shell<br />
</span></li>
<li><span style="color: #000000;">#</span>mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system</li>
<li>#cp /system/lib/libsec-ril.so /sdcard/libsec-ril.so.old (backup)</li>
<li>#cp /sdcard/libsec-ril.so /system/lib</li>
<li>#reboot</li>
</ul>
<p>- For rooted device with Lk2.02 (has recovery tools)</p>
<ul>
<li>Download<a title="fix 3 &amp; im2 problem" href="http://rapidshare.com/files/384383127/im2-3-update.zip" target="_self"> im2-3-update.zip</a></li>
<li>Using ADB tool:</li>
<li>adb push im2-3-update.zip /sdcard</li>
<li>adb shell</li>
<li>#reboot recovery</li>
<li>From recovery menu, choose &#8216;Apply any zip from SD&#8217;</li>
<li>Select im2-3-update.zip</li>
<li>Press &#8216;Home&#8217; for confirm</li>
<li>Reboot</li>
</ul>
<p>4. Install Nexus One boot animation (win 7 style)</p>
<p>Nexus one boot animation file (bootanimation.zip) was taken from <a href="http://forum.samdroid.net/threads/782-SamdroidMod-v-1.0.3-LK2.03.3-Root-more...-05-06-2010-EN" target="_blank">Leshak&#8217;s samdroid</a> mod</p>
<p>- For rooted device without Lk2.02</p>
<ul>
<li>Download <a href="http://rapidshare.com/files/384384528/bootanimation.zip" target="_blank">bootanimation.zip</a></li>
<li>Using ADB tool:</li>
<li>adb push bootanimation.zip /sdcard</li>
<li>adb shell</li>
<li><span style="color: #000000;">#</span>mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system</li>
<li>#cp /system/media/bootani.qmg /sdcard (backup)</li>
<li>#cp /system/etc/poweron.snd /sdcard (backup)</li>
<li>#rm /sytsem/etc/poweron.snd</li>
<li>#cp /sdcard/bootanimation.zip /system/media</li>
<li>#reboot</li>
</ul>
<p>- For rooted device with Lk2.02 (has recover tools)</p>
<ul>
<li>Download <a title="nexus one boot animation " href="http://rapidshare.com/files/384388781/nexusoneanim_update.zip" target="_blank">nexusoneanim_update.zip</a></li>
<li>Using ADB tool:</li>
<li>adb push nexusoneanim_update.zip /sdcard</li>
<li>adb shell</li>
<li>#reboot recovery</li>
<li>From recovery menu, choose &#8216;Apply any zip from SD&#8217;</li>
<li>Select nexusoneanim_update.zip</li>
<li>Press &#8216;home&#8217; for confirm</li>
<li>Reboot</li>
</ul>
<p>5. Install Samdroid Mod 1.o.3</p>
<p>Samdroid 1.0.3 can be applied to any 2.1 firmwares + lk2.02 installed and has two partitions on sdcard (one should be ext2 partition).</p>
<ol>
<li>Install Lk2.02 (Ref: <a href="http://forum.samdroid.net/threads/624-Spica-v.LK2.02-Root-Recovery-Apps2SD-Busybox-Wifi-tether-etc-04-15-2010-EN" target="_blank">samdroid</a>)
<ul>
<li>Download <a href="http://rapidshare.com/files/388346711/LK2-02-1_update.zip" target="_blank">LK2-02-1_update.zip</a> (rapid) | <a href="http://is.gd/deg2Z" target="_blank">LK2-02-1_update.zip</a> (mydropbox)</li>
<li>Copy it to root of sdcard (/sdcard)</li>
<li>Download <a href="http://rapidshare.com/files/388350982/i5700_LK2-02_PDA.tar" target="_blank">i5700_LK2-02_PDA.tar</a> (rapid) | <a href="http://is.gd/deg5k" target="_blank">i5700_LK2-02_PDA.tar</a> (mydropbox)</li>
<li>Flash it using odin as PDA file</li>
<li>Spica will reboot and enter into recovery mode</li>
<li>Select &#8216;apply any zip from SD&#8217;</li>
<li>Select LK2-02-1_update.zip then pres&#8217;s Home&#8217; to confirm</li>
<li>Wait until &#8216;Install from sd card complete&#8217; appears then reboot</li>
<li>Check phone</li>
</ul>
</li>
<li> Apply app2sd (Ref: <a href="http://forum.samdroid.net/threads/620-?p=8257&amp;viewfull=1#post8257" target="_blank">samdroid</a>)
<ul>
<li>Turn off the phone</li>
<li>Press &#8216;Volume down + Call/Answer + Power&#8217; key to enter into recovery mode OR</li>
<li>Using adb shell type &#8216;reboot recovery&#8217;</li>
<li>Select &#8216;Partition sd card&#8217;</li>
<li>Select the size of partition (256, 384 or 512) then press &#8216;Home&#8217; to confirm</li>
<li>Wait until &#8216;Format SDCARD complete&#8217; appears then reboot</li>
<li>Check phone</li>
</ul>
</li>
<li>Install samdroid (Ref: <a href="http://forum.samdroid.net/threads/782-SamdroidMod-v-1.0.3-LK2.03.3-Root-more...-05-06-2010-EN" target="_blank">samdroid</a>)
<ul>
<li>Download <a href="http://www.multiupload.com/LO8H0UV627" target="_blank">SamdroidMod-1_0_3-update.zip</a></li>
<li>Copy it to root of sdcard (/sdcard)</li>
<li>Turn off the phone</li>
</ul>
<ul>
<li>Press &#8216;Volume down + Call/Answer + Power&#8217; key to enter into recovery  mode OR</li>
<li>Using adb shell type &#8216;reboot recovery&#8217;</li>
<li>Select &#8216;wipe, choose what&#8217; -&gt; &#8216;data/cache&#8217;</li>
<li>Select &#8216;Apply any zip from SD&#8217; and choose &#8216;SamdroidMod-1_0_3-update.zip&#8217;</li>
<li>Press &#8216;Home&#8217; to confirm</li>
<li>It may take a long time for first time booting (it is normal, you&#8217;ll see nexus one boot animation)</li>
</ul>
</li>
</ol>
<p><strong>Buy me a coffee</strong></p>
<p>If you found this stuff useful to your work, please consider a donation.<br />
By doing this you will be helping me to keep improving this stuff and to continue to help anyone who needs, and maybe keep on helping you in the future.</p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input alt="PayPal - The safer, easier way to pay online!" name="submit" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" type="image" /> <img style="border-style: initial; border-color: initial;" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" border="0" alt="" width="1" height="1" /></form>
<p><span style="color: #000000;"> </span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.londatiga.net/it/samsung-i5700-galaxy-spica-android-2-1-flashing-guide/feed/</wfw:commentRss>
		<slash:comments>1157</slash:comments>
		</item>
		<item>
		<title>How to Setup Android Application Development on Eclipse</title>
		<link>http://www.londatiga.net/it/how-to-setup-android-application-development-on-eclipse/</link>
		<comments>http://www.londatiga.net/it/how-to-setup-android-application-development-on-eclipse/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 18:18:41 +0000</pubDate>
		<dc:creator>lorenz</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Featured Articles]]></category>
		<category><![CDATA[Information Technology]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[android adt]]></category>
		<category><![CDATA[android applications]]></category>
		<category><![CDATA[android development]]></category>
		<category><![CDATA[android device]]></category>
		<category><![CDATA[android IDE]]></category>
		<category><![CDATA[android on eclipse]]></category>
		<category><![CDATA[android phone]]></category>
		<category><![CDATA[android programming]]></category>
		<category><![CDATA[android tool]]></category>
		<category><![CDATA[eclipse]]></category>

		<guid isPermaLink="false">http://www.londatiga.net/?p=541</guid>
		<description><![CDATA[Android SDK provides the tools and APIs necessary to begin developing applications on the Android platform using the Java programming language. Android offers a custom plugin for the Eclipse IDE, called Android Development Tools (ADT), that is designed to give you a powerful, integrated environment in which to build Android applications.
This tutorial is intended for [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Android SDK" href="http://developer.android.com/sdk/index.html" target="_blank">Android SDK</a> provides the tools and APIs necessary to begin developing applications on the <strong>Android</strong> platform using the <a title="Java Programming Language" href="http://java.sun.com" target="_blank">Java </a>programming language. Android offers a custom plugin for the <a title="Eclipse IDE" href="http://eclipse.org" target="_blank">Eclipse IDE</a>, called <a title="ADT Android Development Tools" href="http://developer.android.com/sdk/adt-notes.html " target="_blank">Android Development Tools (ADT),</a> that is designed to give you a powerful, integrated environment in which to build Android applications.</p>
<div class="wp-caption aligncenter" style="width: 202px"><img title="Android 2.1 on Emulator" src="http://www.londatiga.net/images/android/android.jpg" alt="" width="192" height="289" /><p class="wp-caption-text">Android 2.1 on Emulator</p></div>
<p>This tutorial is intended for new developers that want to start developing Android applications using Eclipse IDE. To start develop, you have to install Java platform (JDK)  first and then  install the Eclipse,  Android SDK and the  Android Development Tool (ADT) plugin for Eclipse.</p>
<p><strong>Download and Install JDK</strong></p>
<p>Download and install the latest JDK (JDK 1.6 Update 18) from <a title="Download JDK" href="http://java.sun.com/javase/downloads/index.jsp" target="_blank">JDK download page</a></p>
<p><strong>Download and Install Eclipse IDE</strong></p>
<p>Download and install Eclipse Classic 3.5 (Galileo) from <a title="Download Eclipse" href="http://www.eclipse.org/downloads/" target="_blank">Eclipse download page</a>. You can also use the  Java or RCP version of Eclipse.</p>
<p><strong>Download and Install Android SDK Starter Package</strong></p>
<p>The Android SDK starter package includes only a single component, the latest version of the SDK Tools. Included in that component is a tool called <span style="color: #008000;">Android SDK and AVD Manager</span> that you can use to download other components from the SDK repository site.</p>
<ul>
<li>Download the latest Android SDK  starter package  from the <a title="Download Android SDK Starter Package" href="http://developer.android.com/sdk/index.html" target="_blank">SDK download page</a>.</li>
<li>Unpack the archive to a suitable location on your machine. By default, the SDK files are unpacked into a directory named  <span style="color: #008000;">android-sdk-&lt;machine-platform&gt;</span> . For example, on Windows platform the directory will be <span style="color: #008000;">android-sdk-windows.</span></li>
<p><div class="wp-caption alignnone" style="width: 439px"><img title="Android SDK " src="http://londatiga.net/images/android/sdk_tree.jpg" alt="Android SDK " width="429" height="108" /><p class="wp-caption-text">Android SDK</p></div></ul>
<p><strong>Add Android Platforms to Your SDK</strong></p>
<p>To add one or more Android platforms (for example, Android 1.6 or Android 2.1) to your SDK, use the <span style="color: #008000;">Android SDK and AVD Manager</span>, included in the SDK starter package. It is recommended  to download multiple platforms, so that you can build your application on the lowest version you want to support, but test against higher versions that you intend the application to run on.</p>
<ul>
<li>Launch the <span style="color: #008000;">Android SDK and AVD Manager </span>on Windows by executing <span style="color: #008000;">SDK Setup.exe</span> at the root of the SDK directory. On Mac OS X or Linux, execute the android tool in the<span style="color: #008000;"> /tools/ <span style="color: #000000;">folder</span></span>.</li>
<li>On<span style="color: #008000;"> Available Packages </span>menu, select the platforms to download (1.1 to 2.1).</li>
<p><img class="alignnone" title="Download android sdk component" src="http://londatiga.net/images/android/download_component.jpg" alt="" width="450" height="261" /></p>
<li> If you find error on HTTP SSL while fetching the repository url , try to use http instead of https by checking the <span style="color: #008000;">Force https://&#8230; sources to be fetched using http://&#8230; <span style="color: #000000;">option</span></span> on <span style="color: #008000;">Settings</span> menu.</li>
<p><img class="alignnone" title="Force HTTP download" src="http://londatiga.net/images/android/force_http.jpg" alt="" width="450" height="261" /></p>
<li>Click<strong> </strong><span style="color: #008000;">Install Selected </span> and then select Accept All to accept selected packages.</li>
<li>Click <span style="color: #008000;">Install Accepted</span> button to start download and install the selected packages.</li>
<p><img class="alignnone" title="Install Packages" src="http://londatiga.net/images/android/install_packages.jpg" alt="" width="450" height="299" /></ul>
<p><strong>Download and Install ADT Plugin</strong></p>
<p>To install  the ADT Plugin, you can take advantage of the Eclipse remote update feature. By setting up a remote update site, you can easily download, install, and check for ADT updates. Alternatively, you can download the latest ADT to your development computer as a local site archive.</p>
<ul>
<li>Launch Eclipse, then select <span style="color: #008000;">Help &#8211;&gt; Install New Software</span>.</li>
<p><img class="alignnone" title="Eclipse Help Menu" src="http://londatiga.net/images/android/help.jpg" alt="" width="232" height="254" /></p>
<li>In <span style="color: #008000;">Available Software</span> dialog, click <span style="color: #008000;">Add </span></li>
<li>Enter a name for the remote site (ex: Android Plugin) in the <span style="color: #008000;">Name</span> field and in the <span style="color: #008000;">Location</span> field, enter this URL:<br />
<span style="color: #0000ff;"> https://dl-ssl.google.com/android/eclipse/</span><br />
and then click OK. If you have trouble acquiring the plugin, you can try using &#8216;http&#8217;  instead of  &#8217;https&#8217;  in the URL.</li>
<p><img class="alignnone" title="Eclipse Add Site" src="http://londatiga.net/images/android/add_site.jpg" alt="" width="450" height="392" /></p>
<li>Select the checkbox next to <span style="color: #008000;">Developer Tools</span>, which will automatically select the nested tools <span style="color: #008000;">Android </span><span style="color: #008000;">DDMS</span> and <span style="color: #008000;">Android Development Tools </span>and then click <span style="color: #008000;">Next</span>.</li>
<p><img class="alignnone" title="Select Package" src="http://londatiga.net/images/android/add_site2.jpg" alt="" width="450" height="391" /></p>
<li>On the next dialog, click <span style="color: #008000;">Next</span> to read and accept the license agreement and install any dependencies, then click <span style="color: #008000;">Finish</span>.</li>
<li><span style="color: #000000;">Restart Eclipse</span></li>
<li><span style="color: #000000;">To check whether the ADT has been installed correctly, try to create a new project by select <span style="color: #008000;">File &gt; New &gt; Proje<span style="color: #008000;">c</span></span><span style="color: #008000;">t</span>., you shoud find Android Project listed on project wizard.</span></li>
<p><img class="alignnone" title="New Project" src="http://londatiga.net/images/android/newproject.jpg" alt="" width="450" height="446" /></ul>
<div><strong>Update March 12, 2010:</strong></div>
<div>On early March 2010, Android team has released<a title="Android SDK Tools r5" href="http://www.londatiga.net/it/android-sdk-tools-revision-5-r5-fixes-issue-on-fetching-repository-url-using-ssl-https/" target="_blank"> SDK Tools Revision 5 (r5) </a>that fixes problem on fetching repository using SSL (https). It is also highly recommended to use ADT Plugin version 0.9.6  because SDK Tools r5 is designed for use with ADT 0.9.6 and later.</div>
]]></content:encoded>
			<wfw:commentRss>http://www.londatiga.net/it/how-to-setup-android-application-development-on-eclipse/feed/</wfw:commentRss>
		<slash:comments>45</slash:comments>
		</item>
	</channel>
</rss>

