<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4059562360294499378</id><updated>2012-02-01T14:18:49.017-08:00</updated><category term='command line'/><title type='text'>Android Tricks</title><subtitle type='html'>Tips &amp;amp; Tricks on Android</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://android-tricks.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4059562360294499378/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://android-tricks.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Nirnimesh .</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-w8-xXZ7kEvY/AAAAAAAAAAI/AAAAAAAANhk/vNEvgAjQnfM/s512-c/photo.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>12</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4059562360294499378.post-8475310143834678905</id><published>2009-06-20T22:21:00.000-07:00</published><updated>2009-06-20T22:22:00.447-07:00</updated><title type='text'>Ringtones Location</title><content type='html'>There are 2 locations from which G1 can pick ringtones.&lt;br&gt;&lt;br&gt;1. &lt;b&gt;On SDCard&lt;/b&gt;. /sdcard/Music/ringtones&lt;br&gt;2. &lt;b&gt;On filesystem&lt;/b&gt;. /system/media/audio/ringtones&lt;br&gt;  (You need to &lt;a href="http://android-tricks.blogspot.com/2009/01/mount-filesystem-read-write.html"&gt;mount /system read-write&lt;/a&gt;)&lt;br&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4059562360294499378-8475310143834678905?l=android-tricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://android-tricks.blogspot.com/feeds/8475310143834678905/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://android-tricks.blogspot.com/2009/06/ringtones-location.html#comment-form' title='48 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4059562360294499378/posts/default/8475310143834678905'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4059562360294499378/posts/default/8475310143834678905'/><link rel='alternate' type='text/html' href='http://android-tricks.blogspot.com/2009/06/ringtones-location.html' title='Ringtones Location'/><author><name>Nirnimesh .</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-w8-xXZ7kEvY/AAAAAAAAAAI/AAAAAAAANhk/vNEvgAjQnfM/s512-c/photo.jpg'/></author><thr:total>48</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4059562360294499378.post-8924458759012725452</id><published>2009-03-10T04:31:00.001-07:00</published><updated>2009-03-10T04:31:50.414-07:00</updated><title type='text'>Flashing the Android Dev Phone 1</title><content type='html'>So far it was not super easy to flash your ADP1 to factory settings if you manage to corrupt something or break the OS. People have used hacky ways and images but no official ADP1 build was available.&lt;br&gt;&lt;br&gt;This has changed now. The OS images along with flashing instructions for restoring your android dev phone to factory image is available &lt;a href="http://www.htc.com/www/support/android/adp.html"&gt;here&lt;/a&gt;.&lt;br&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4059562360294499378-8924458759012725452?l=android-tricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://android-tricks.blogspot.com/feeds/8924458759012725452/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://android-tricks.blogspot.com/2009/03/flashing-android-dev-phone-1.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4059562360294499378/posts/default/8924458759012725452'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4059562360294499378/posts/default/8924458759012725452'/><link rel='alternate' type='text/html' href='http://android-tricks.blogspot.com/2009/03/flashing-android-dev-phone-1.html' title='Flashing the Android Dev Phone 1'/><author><name>Nirnimesh .</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-w8-xXZ7kEvY/AAAAAAAAAAI/AAAAAAAANhk/vNEvgAjQnfM/s512-c/photo.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4059562360294499378.post-4956187811685972404</id><published>2009-02-25T01:16:00.001-08:00</published><updated>2009-02-25T01:24:07.531-08:00</updated><title type='text'>Hello World C program using Android Toolchain</title><content type='html'>I had reported earlier how I had gotten a C Hello World &lt;a href="http://android-tricks.blogspot.com/2009/02/hello-world-in-c-on-android.html"&gt;statically-linked program running&lt;/a&gt; on my Android phone using CodeSourcery's toolchain (on linux). Today I got a dynamically-linked Hello World program running on the phone, compiled using Android's prebuilt toolchain from the &lt;a href="http://source.android.com/download"&gt;source&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;It's well known that Android uses a stripped down version of libc, called bionic. When you compile your program with static linking, you don't use bionic because well, you linked statically. This is non-ideal. You want to use the bionic library on the phone, and besides you want to compile using Android's prebuilt cross-compiler &lt;b&gt;&lt;span style="font-family:courier new,monospace;"&gt;arm-eabi-gcc&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;If you are anxious to get things working, use &lt;a href="http://plausible.org/andy/agcc"&gt;agcc&lt;/a&gt;, a perl wrapper over &lt;b&gt;&lt;span style="font-family:courier new,monospace;"&gt;arm-eabi-gcc &lt;/span&gt;&lt;/b&gt;that sets up everything for you so that you can just:&lt;br /&gt;&lt;b&gt;&lt;span style="font-family:courier new,monospace;"&gt;$ agcc hello.c -o hello&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;and the resulting binary (&lt;b&gt;&lt;span style="font-family:courier new,monospace;"&gt;hello&lt;/span&gt;&lt;/b&gt;) just works. Of course you should have the directory containing &lt;b&gt;&lt;span style="font-family:courier new,monospace;"&gt;arm-eabi-gcc &lt;/span&gt;&lt;/b&gt;in your PATH for &lt;b&gt;&lt;span style="font-family:courier new,monospace;"&gt;agcc&lt;/span&gt;&lt;/b&gt; to work.&lt;br /&gt;&lt;br /&gt;Let's explore a bit deeper. But let me first simplify my hello program to contain just a main&lt;br /&gt;&lt;b&gt;&lt;span style="font-family:courier new,monospace;"&gt;$ cat hello.c&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;int main(int argc, char* argv[]) {&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new,monospace;"&gt;    return 0;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new,monospace;"&gt;}&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;The minimal set of flags to pass to arm-eabi-gcc to get this working is:&lt;br /&gt;&lt;b&gt;&lt;span style="font-family:courier new,monospace;"&gt;$ arm-eabi-gcc -o hello hello.c &lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;        -Wl,-rpath-link=/Users/nirnimesh/NIR/android/mydroid/cupcake/out/target/product/generic/obj/lib &lt;/span&gt; &lt;span style="font-family:courier new,monospace;"&gt;        -L/Users/nirnimesh/NIR/android/mydroid/cupcake/out/target/product/generic/obj/lib &lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;        -nostdlib &lt;/span&gt; &lt;span style="font-family:courier new,monospace;"&gt;        /Users/nirnimesh/NIR/android/mydroid/cupcake/out/target/product/generic/obj/lib/crtbegin_dynamic.o  &lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;        -lc&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Here &lt;b&gt;&lt;span style="font-family:courier new,monospace;"&gt;/Users/nirnimesh/NIR/android/mydroid/cupcake&lt;/span&gt;&lt;/b&gt; is the root of my Android source.&lt;br /&gt;&lt;b&gt;&lt;span style="font-family:courier new,monospace;"&gt;&lt;br /&gt;$ file hello&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;span style="font-family:courier new,monospace;"&gt;hello: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), not stripped&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Note that the executable binary is dynamically linked.&lt;br /&gt;&lt;br /&gt;If you leave out &lt;b&gt;&lt;span style="font-family:courier new,monospace;"&gt;-Wl,-rpath-link=/Users/nirnimesh/NIR/android/mydroid/cupcake/out/target/product/generic/obj/lib&lt;/span&gt;&lt;/b&gt; you get&lt;br /&gt;&lt;span style="font-family:courier new,monospace;"&gt;/Users/nirnimesh/NIR/android/mydroid/cupcake/prebuilt/darwin-x86/toolchain/arm-eabi-4.2.1/bin/../lib/gcc/arm-eabi/4.2.1/../../../../arm-eabi/bin/ld: warning: libdl.so, needed by /Users/nirnimesh/NIR/android/mydroid/cupcake/out/target/product/generic/obj/lib/libc.so, not found (try using -rpath or -rpath-link)&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;/Users/nirnimesh/NIR/android/mydroid/cupcake/out/target/product/generic/obj/lib/libc.so: undefined reference to `dl_unwind_find_exidx'&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;collect2: ld returned 1 exit status&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If you leave out &lt;b&gt;&lt;span style="font-family:courier new,monospace;"&gt;-L/Users/nirnimesh/NIR/android/mydroid/cupcake/out/target/product/generic/obj/lib&lt;/span&gt;&lt;/b&gt; you get&lt;br /&gt;&lt;span style="font-family:courier new,monospace;"&gt;/Users/nirnimesh/NIR/android/mydroid/cupcake/prebuilt/darwin-x86/toolchain/arm-eabi-4.2.1/bin/../lib/gcc/arm-eabi/4.2.1/../../../../arm-eabi/bin/ld: cannot find -lc&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;collect2: ld returned 1 exit status&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If you leave out &lt;b&gt;&lt;span style="font-family:courier new,monospace;"&gt;-nostdlib&lt;/span&gt;&lt;/b&gt; you get&lt;br /&gt;&lt;span style="font-family:courier new,monospace;"&gt;/Users/nirnimesh/NIR/android/mydroid/cupcake/prebuilt/darwin-x86/toolchain/arm-eabi-4.2.1/bin/../lib/gcc/arm-eabi/4.2.1/../../../../arm-eabi/bin/ld: crt0.o: No such file: No such file or directory&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;collect2: ld returned 1 exit status&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If you leave out &lt;b&gt;&lt;span style="font-family:courier new,monospace;"&gt;/Users/nirnimesh/NIR/android/mydroid/cupcake/out/target/product/generic/obj/lib/crtbegin_dynamic.o&lt;/span&gt;&lt;/b&gt; you get&lt;br /&gt;&lt;span style="font-family:courier new,monospace;"&gt;/Users/nirnimesh/NIR/android/mydroid/cupcake/prebuilt/darwin-x86/toolchain/arm-eabi-4.2.1/bin/../lib/gcc/arm-eabi/4.2.1/../../../../arm-eabi/bin/ld: crt0.o: No such file: No such file or directory&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;collect2: ld returned 1 exit status&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;And finally, f you leave out &lt;b&gt;&lt;span style="font-family:courier new,monospace;"&gt;-lc&lt;/span&gt;&lt;/b&gt; your compilation fails with:&lt;br /&gt;&lt;span style="font-family:courier new,monospace;"&gt;/Users/nirnimesh/NIR/android/mydroid/cupcake/out/target/product/generic/obj/lib/crtbegin_dynamic.o: In function `_start':&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;bionic/libc/arch-arm/bionic/crtbegin_dynamic.S:(.text+0x10): undefined reference to `__libc_init'&lt;/span&gt; &lt;span style="font-family:courier new,monospace;"&gt;collect2: ld returned 1 exit status&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;So far we've been able to compile C programs using Androids toolchain and run on the phone.&lt;br /&gt;To summarize, it's the most convenient to use &lt;b&gt;&lt;span style="font-family:courier new,monospace;"&gt;agcc&lt;/span&gt;&lt;/b&gt; as the compiler so you don't have to bother.&lt;br /&gt;&lt;b&gt;&lt;span style="font-family:courier new,monospace;"&gt;&lt;/span&gt;&lt;/b&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4059562360294499378-4956187811685972404?l=android-tricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://android-tricks.blogspot.com/feeds/4956187811685972404/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://android-tricks.blogspot.com/2009/02/hello-world-c-program-on-using-android.html#comment-form' title='22 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4059562360294499378/posts/default/4956187811685972404'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4059562360294499378/posts/default/4956187811685972404'/><link rel='alternate' type='text/html' href='http://android-tricks.blogspot.com/2009/02/hello-world-c-program-on-using-android.html' title='Hello World C program using Android Toolchain'/><author><name>Nirnimesh .</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-w8-xXZ7kEvY/AAAAAAAAAAI/AAAAAAAANhk/vNEvgAjQnfM/s512-c/photo.jpg'/></author><thr:total>22</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4059562360294499378.post-8333839727310578381</id><published>2009-02-20T17:55:00.001-08:00</published><updated>2009-02-20T17:55:38.024-08:00</updated><title type='text'>cp on Android</title><content type='html'>The Android Dev Phone (and G1, by extension) does not have the &lt;b&gt;cp&lt;/b&gt; command in the &lt;b&gt;&lt;span style="font-family: courier new,monospace;"&gt;adb shell&lt;/span&gt;&lt;/b&gt; prompt. Since you can compile and &lt;a href="http://android-tricks.blogspot.com/2009/02/hello-world-in-c-on-android.html"&gt;run C code&lt;/a&gt; on the phone, you could in theory also compile the &lt;b&gt;&lt;span style="font-family: courier new,monospace;"&gt;cp&lt;/span&gt;&lt;/b&gt; program but that&amp;#39;s probably a stretch. Alternatively, you can:&lt;br&gt; &lt;b&gt;&lt;span style="font-family: courier new,monospace;"&gt;cat &lt;i&gt;source_file&lt;/i&gt; &amp;gt; &lt;i&gt;dest_file&lt;/i&gt;&lt;/span&gt;&lt;/b&gt;&lt;br&gt;&lt;br&gt;This works because the phone has a full-featured shell which supports stream redirection.&lt;br&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4059562360294499378-8333839727310578381?l=android-tricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://android-tricks.blogspot.com/feeds/8333839727310578381/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://android-tricks.blogspot.com/2009/02/cp-on-android.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4059562360294499378/posts/default/8333839727310578381'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4059562360294499378/posts/default/8333839727310578381'/><link rel='alternate' type='text/html' href='http://android-tricks.blogspot.com/2009/02/cp-on-android.html' title='cp on Android'/><author><name>Nirnimesh .</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-w8-xXZ7kEvY/AAAAAAAAAAI/AAAAAAAANhk/vNEvgAjQnfM/s512-c/photo.jpg'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4059562360294499378.post-7262832336315226880</id><published>2009-02-20T13:01:00.001-08:00</published><updated>2009-02-20T13:01:02.244-08:00</updated><title type='text'>Screenshots on Android</title><content type='html'>If you want to report something about your phone over email, a screenshot goes a long way.&lt;br&gt;&lt;br&gt;To take a screenshot you need to download the &lt;a href="http://developer.android.com/sdk/1.1_r1/index.html"&gt;Android SDK&lt;/a&gt; for your machine. It includes a tool called ddms which is the dalvic debug monitor. Dalvic is the Java runtime powering all the apps on your android phone.&lt;br&gt; &lt;br&gt;Connect the phone to your machine, run &lt;b style="font-family: courier new,monospace;"&gt;ddms&lt;/b&gt; from the terminal and go to &lt;span style="font-family: arial narrow,sans-serif;"&gt;Device &amp;gt; Screen Captur&lt;/span&gt;e (or Ctrl-S) for taking a screenshot.&lt;br&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4059562360294499378-7262832336315226880?l=android-tricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://android-tricks.blogspot.com/feeds/7262832336315226880/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://android-tricks.blogspot.com/2009/02/screenshots-on-android.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4059562360294499378/posts/default/7262832336315226880'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4059562360294499378/posts/default/7262832336315226880'/><link rel='alternate' type='text/html' href='http://android-tricks.blogspot.com/2009/02/screenshots-on-android.html' title='Screenshots on Android'/><author><name>Nirnimesh .</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-w8-xXZ7kEvY/AAAAAAAAAAI/AAAAAAAANhk/vNEvgAjQnfM/s512-c/photo.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4059562360294499378.post-5535121815045465324</id><published>2009-02-20T00:10:00.001-08:00</published><updated>2009-02-20T00:10:27.914-08:00</updated><title type='text'>Hello World in C on Android</title><content type='html'>If you&amp;#39;ve been following the Android world, you&amp;#39;d know that Android&amp;#39;s SDK requires you to write apps in Java. Ever since I got my phone I&amp;#39;ve been dying to run a Hello World C program, but I&amp;#39;ve been unable to get the right cross compiler for it.&lt;br&gt; &lt;br&gt;Today I finally managed to do it using CodeSourcery&amp;#39;s cross compiler on linux. A cross compiler is something which allows you to compile on one architecture (the host) and run the executable binary on another (the target). In this case, the host is the linux machine where we&amp;#39;ll install the toolchain (linux intel x86) and android phone is the host (arm).&lt;br&gt; &lt;ol&gt;&lt;li&gt;Download CodeSourcery&amp;#39;s toolchain &lt;a href="http://www.codesourcery.com/sgpp/lite/arm/portal/subscription?@template=lite"&gt;installer for GNU/Linux target for IA32 host&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Install it: &lt;b&gt;&lt;span style="font-family: courier new,monospace;"&gt;sh arm-2008q3-72-arm-none-linux-gnueabi.bin&lt;/span&gt;&lt;/b&gt;&lt;/li&gt; &lt;li&gt;The toolchain provides the cross compiler arm-none-linux-gnueabi-gcc. You need to put it&amp;#39;s directory in your $PATH. Once you have the toolchain, you can easily compile your hello world program: &lt;b style="font-family: courier new,monospace;"&gt;arm-none-linux-gnueabi-gcc -o hello -static hello.c&lt;/b&gt;&lt;/li&gt; &lt;li&gt;&lt;span style="font-family: courier new,monospace;"&gt;&lt;font face="arial,helvetica,sans-serif"&gt;Copy the binary to your phone and run it from an &lt;b&gt;&lt;span style="font-family: courier new,monospace;"&gt;adb shell&lt;/span&gt;&lt;/b&gt; prompt: &lt;b style="font-family: courier new,monospace;"&gt;./hello&lt;/b&gt;&lt;/font&gt;&lt;/span&gt;&lt;/li&gt; &lt;/ol&gt;Voila!&lt;br&gt;&lt;br&gt;Points to note:&lt;br&gt;&lt;ul&gt;&lt;li&gt;The above binary is static, that is it does not use the phone&amp;#39;s libc libraries. Android ships with its own trimmed down version of libc, called bionic. Next I&amp;#39;ll be trying to compile and run using bionic libc, so that I don&amp;#39;t have to compile statically&lt;/li&gt; &lt;li&gt;The above steps do not use the toolchain in the android source code. I&amp;#39;ll try later to cross compile using that.&lt;br&gt;&lt;/li&gt;&lt;/ul&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4059562360294499378-5535121815045465324?l=android-tricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://android-tricks.blogspot.com/feeds/5535121815045465324/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://android-tricks.blogspot.com/2009/02/hello-world-in-c-on-android.html#comment-form' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4059562360294499378/posts/default/5535121815045465324'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4059562360294499378/posts/default/5535121815045465324'/><link rel='alternate' type='text/html' href='http://android-tricks.blogspot.com/2009/02/hello-world-in-c-on-android.html' title='Hello World in C on Android'/><author><name>Nirnimesh .</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-w8-xXZ7kEvY/AAAAAAAAAAI/AAAAAAAANhk/vNEvgAjQnfM/s512-c/photo.jpg'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4059562360294499378.post-3745359267270311730</id><published>2009-02-18T18:15:00.001-08:00</published><updated>2009-02-18T18:17:06.211-08:00</updated><title type='text'>Installing non-Market Apps on Android Phone</title><content type='html'>If you own an Android Dev phone, at some point you'd probably want to create and try your own apps (or apps from your friends).&lt;br /&gt;&lt;br /&gt;To ensure that you do not break your phone by installing malicious apps, Android has a couple of safety features built in. So you need to specifically instruct android to be able to install unsigned / non-market apps.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial narrow,sans-serif;"&gt;Menu &amp;gt; Settings &amp;gt; Applications &amp;gt; Unknown Sources&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Check "&lt;span style="font-family:arial narrow,sans-serif;"&gt;Unknown Sources&lt;/span&gt;" to allow install of non-Market applications. While developing, you most likely also want to enable "&lt;span style="font-family:arial narrow,sans-serif;"&gt;Stay awake&lt;/span&gt;" in &lt;span style="font-family:arial narrow,sans-serif;"&gt;Menu &amp;gt; Settings &amp;gt; Applications &amp;gt; Development&lt;/span&gt; so that your screen does not go to sleep every often.&lt;br /&gt;&lt;br /&gt;Now you can install any app (including malicious ones) the usual way either by browsing to the app using the browser or using &lt;span style="font-family:courier new,monospace;"&gt;adb install&lt;/span&gt; command.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4059562360294499378-3745359267270311730?l=android-tricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://android-tricks.blogspot.com/feeds/3745359267270311730/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://android-tricks.blogspot.com/2009/02/installing-non-market-apps-on-android.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4059562360294499378/posts/default/3745359267270311730'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4059562360294499378/posts/default/3745359267270311730'/><link rel='alternate' type='text/html' href='http://android-tricks.blogspot.com/2009/02/installing-non-market-apps-on-android.html' title='Installing non-Market Apps on Android Phone'/><author><name>Nirnimesh .</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-w8-xXZ7kEvY/AAAAAAAAAAI/AAAAAAAANhk/vNEvgAjQnfM/s512-c/photo.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4059562360294499378.post-8628592987415482408</id><published>2009-01-19T03:27:00.001-08:00</published><updated>2009-01-19T03:27:04.147-08:00</updated><title type='text'>Mount a filesystem read-write</title><content type='html'>Very often when you want to write files to a particular partition on ADP1, you will get a &amp;quot;Permission Denied&amp;quot; if the partition is mounted read-only.&lt;br&gt;To get around this, you need to mount the partition read-write. Typically this is done with /system partition&lt;br&gt; &lt;br&gt;$ &lt;b style="font-family: courier new,monospace;"&gt;adb shell&lt;/b&gt;&lt;br&gt;$ &lt;b&gt;&lt;span style="font-family: courier new,monospace;"&gt;su&lt;/span&gt;&lt;/b&gt;&lt;br&gt;$ &lt;b style="font-family: courier new,monospace;"&gt;mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system&lt;/b&gt;&lt;br&gt; &lt;br&gt;(Replace &lt;b style="font-family: courier new,monospace;"&gt;/dev/block/mtdblock3&lt;/b&gt; &amp;amp; &lt;b&gt;&lt;span style="font-family: courier new,monospace;"&gt;/system&lt;/span&gt;&lt;/b&gt; with appropriate device path and mount point, as obtained from &lt;b style="font-family: courier new,monospace;"&gt;cat /proc/mounts&lt;/b&gt;)&lt;br&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4059562360294499378-8628592987415482408?l=android-tricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://android-tricks.blogspot.com/feeds/8628592987415482408/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://android-tricks.blogspot.com/2009/01/mount-filesystem-read-write.html#comment-form' title='33 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4059562360294499378/posts/default/8628592987415482408'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4059562360294499378/posts/default/8628592987415482408'/><link rel='alternate' type='text/html' href='http://android-tricks.blogspot.com/2009/01/mount-filesystem-read-write.html' title='Mount a filesystem read-write'/><author><name>Nirnimesh .</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-w8-xXZ7kEvY/AAAAAAAAAAI/AAAAAAAANhk/vNEvgAjQnfM/s512-c/photo.jpg'/></author><thr:total>33</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4059562360294499378.post-2705766067801004489</id><published>2009-01-18T17:30:00.001-08:00</published><updated>2009-02-18T15:35:24.523-08:00</updated><title type='text'>Android Dev Phone 1 Button Combinations</title><content type='html'>&lt;p&gt;The following are the ADP1 / G1 button combinations for booting in various modes.&lt;/p&gt; &lt;p&gt;&lt;b&gt;Regular mode:&lt;/b&gt; Power button&lt;/p&gt;&lt;p&gt;&lt;b&gt;Fastboot mode:&lt;/b&gt; Power on with Camera + Power button. Wait until Android on skateboard image appears with text "SERIAL0", and press Back button. It'll enter FASTBOOT mode.&lt;/p&gt;&lt;p&gt;Alternatively, Power + Back button takes you directly to fastboot mode&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;b&gt;Recovery mode:&lt;/b&gt; Power on with Home + Power button.&lt;br /&gt;In recovery mode,&lt;br /&gt;Alt + L - toggle log text display&lt;br /&gt;Alt + s - apply sdcard:update.zip&lt;br /&gt;Alt + W - wipe data/factory reset&lt;/p&gt;&lt;p&gt;&lt;b&gt;Safe mode&lt;/b&gt;: Power + Menu button&lt;/p&gt;&lt;p&gt;The 3-button salute (Call + Menu + Hangup) causes a reboot in any of the above modes.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4059562360294499378-2705766067801004489?l=android-tricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://android-tricks.blogspot.com/feeds/2705766067801004489/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://android-tricks.blogspot.com/2009/01/android-dev-phone-1-button-combinations.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4059562360294499378/posts/default/2705766067801004489'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4059562360294499378/posts/default/2705766067801004489'/><link rel='alternate' type='text/html' href='http://android-tricks.blogspot.com/2009/01/android-dev-phone-1-button-combinations.html' title='Android Dev Phone 1 Button Combinations'/><author><name>Nirnimesh .</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-w8-xXZ7kEvY/AAAAAAAAAAI/AAAAAAAANhk/vNEvgAjQnfM/s512-c/photo.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4059562360294499378.post-3483320728075771632</id><published>2009-01-18T00:17:00.001-08:00</published><updated>2009-01-18T00:17:17.888-08:00</updated><title type='text'>Using ADP1 without sim card</title><content type='html'>You know that Android Dev Phone 1 is fully unlocked.&amp;nbsp; But if you&amp;#39;ve just opened your box and don&amp;#39;t have a sim with a working data plan, you&amp;#39;ll be greeted with a &amp;quot;No sim card&amp;quot; &amp;quot;Emergency dial&amp;quot; screen on first boot. Now, if you had a sim card with a working data plan, it&amp;#39;d allow you to go ahead and and sign in with your Google account, but you don&amp;#39;t. So you cannot do anything at the &amp;quot;No sim card&amp;quot; screen.&lt;br&gt; &lt;br&gt;There&amp;#39;s a workaround, however. You can use wifi to setup your account. It requires you to use the &lt;b style="font-family: courier new,monospace;"&gt;adb&lt;/b&gt; tool available from the &lt;a href="http://code.google.com/android/download.html"&gt;android sdk&lt;/a&gt;.&lt;br&gt; &lt;ul&gt;&lt;li&gt;Connect the device to your computer using the USB cable. You should be able to see a listing for your device if you run &lt;b&gt;&lt;span style="font-family: courier new,monospace;"&gt;adb devices&lt;/span&gt;&lt;/b&gt;. Then execute the following commands.&lt;/li&gt; &lt;li&gt;$&amp;nbsp; &lt;b style="font-family: courier new,monospace;"&gt;adb shell&lt;/b&gt;&lt;/li&gt;&lt;li&gt;$ &lt;b&gt;&lt;span style="font-family: courier new,monospace;"&gt;su&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;&lt;li&gt;$ &lt;b style="font-family: courier new,monospace;"&gt;cd /data/data/com.android.providers.settings/databases&lt;/b&gt;&lt;/li&gt; &lt;li&gt;$ &lt;b&gt;&lt;span style="font-family: courier new,monospace;"&gt;sqlite3 settings.db&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;&lt;li style="font-family: courier new,monospace;"&gt;&lt;b&gt;INSERT INTO system (name, value) VALUES (&amp;#39;device_provisioned&amp;#39;, 1);&lt;/b&gt;&lt;/li&gt; &lt;li style="font-family: courier new,monospace;"&gt;&lt;b&gt;.exit&lt;/b&gt;&lt;/li&gt;&lt;li&gt;$ &lt;b&gt;&lt;span style="font-family: courier new,monospace;"&gt;reboot&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;After reboot:&lt;br&gt;&lt;ul&gt;&lt;li&gt;$ &lt;b style="font-family: courier new,monospace;"&gt;adb shell&lt;/b&gt;&lt;/li&gt; &lt;li style="font-family: courier new,monospace;"&gt;&lt;b&gt;am start -a android.intent.action.MAIN -n com.android.settings/.Settings&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;Go ahead and setup your wifi and then sign up using your Google account.&lt;br&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4059562360294499378-3483320728075771632?l=android-tricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://android-tricks.blogspot.com/feeds/3483320728075771632/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://android-tricks.blogspot.com/2009/01/using-adp1-without-sim-card.html#comment-form' title='63 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4059562360294499378/posts/default/3483320728075771632'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4059562360294499378/posts/default/3483320728075771632'/><link rel='alternate' type='text/html' href='http://android-tricks.blogspot.com/2009/01/using-adp1-without-sim-card.html' title='Using ADP1 without sim card'/><author><name>Nirnimesh .</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-w8-xXZ7kEvY/AAAAAAAAAAI/AAAAAAAANhk/vNEvgAjQnfM/s512-c/photo.jpg'/></author><thr:total>63</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4059562360294499378.post-4682848272599601127</id><published>2009-01-16T01:23:00.000-08:00</published><updated>2009-01-16T01:32:13.325-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='command line'/><title type='text'>IP Address</title><content type='html'>To find the WiFi IP address on the android dev phone, you can:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;1. From the phone&lt;/span&gt;&lt;br /&gt;Follow &lt;span style="font-family:courier new;"&gt;Settings &lt;span style="font-weight: bold;"&gt;&gt;&gt;&lt;/span&gt; Wireless Controls &lt;span style="font-weight: bold;"&gt;&gt;&gt;&lt;/span&gt; Wi-Fi settings&lt;/span&gt; and tap on the network you are connected to. It'll pop up a dialog with network status, speed, signal strength, security type and IP address.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;2. Using &lt;/span&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;adb&lt;/span&gt;&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;&lt;span style="font-style: italic;"&gt;(from command-line)&lt;/span&gt;&lt;br /&gt;Assuming you have the android SDK installed on your computer, do:&lt;br /&gt;$ &lt;span style="font-family:courier new;"&gt;adb shell ifconfig tiwlan0&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;tiwlan0&lt;/span&gt; is the name of the wi-fi network interface on the device.&lt;br /&gt;&lt;br /&gt;The command will show the IP address, netmask and other interface parameters like up/down state, broadcast or not, and so on.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4059562360294499378-4682848272599601127?l=android-tricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://android-tricks.blogspot.com/feeds/4682848272599601127/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://android-tricks.blogspot.com/2009/01/ip-address.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4059562360294499378/posts/default/4682848272599601127'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4059562360294499378/posts/default/4682848272599601127'/><link rel='alternate' type='text/html' href='http://android-tricks.blogspot.com/2009/01/ip-address.html' title='IP Address'/><author><name>Nirnimesh .</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-w8-xXZ7kEvY/AAAAAAAAAAI/AAAAAAAANhk/vNEvgAjQnfM/s512-c/photo.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4059562360294499378.post-8524313136122309119</id><published>2009-01-16T01:13:00.000-08:00</published><updated>2009-01-16T01:22:54.515-08:00</updated><title type='text'>My Dream Phone</title><content type='html'>I received my brand new, unlocked Android Dev Phone 1 yesterday.&lt;br /&gt;I had registered as a developer and ordered the phone for $399 + taxes + $25 registration fee.&lt;br /&gt;&lt;br /&gt;&lt;div class="rightCol"&gt;       &lt;div class="rightColtext"&gt;     &lt;h3&gt;Hardware Features&lt;/h3&gt;     &lt;ul&gt;&lt;li&gt;Touch screen&lt;/li&gt;&lt;li&gt;Trackball&lt;/li&gt;&lt;li&gt;3.2 Megapixel camera with auto focus&lt;/li&gt;&lt;li&gt;Wi-Fi&lt;/li&gt;&lt;li&gt;Bluetooth v2.0      &lt;ul&gt;&lt;li&gt;Handsfree profile v1.5&lt;/li&gt;&lt;li&gt;Headset profile v1.0&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;3G WCDMA (1700/2100 MHz)&lt;/li&gt;&lt;li&gt;Quad-band GSM (850/900/1800/1900 MHz)&lt;/li&gt;&lt;li&gt;GPS-enabled&lt;/li&gt;&lt;li&gt;QWERTY slider keyboard&lt;/li&gt;&lt;li&gt;Includes 1GB MicroSD card (Can be replaced with up to 16GB card)&lt;/li&gt;&lt;li&gt;Included in the box       &lt;ul&gt;&lt;li&gt;HTC Android Dev Phone 1&lt;/li&gt;&lt;li&gt;USB Cable&lt;/li&gt;&lt;li&gt;AC Adapter (with US plug)&lt;/li&gt;&lt;li&gt;Stereo Hands-Free Headset&lt;/li&gt;&lt;li&gt;Battery&lt;/li&gt;&lt;li&gt;Getting Starting Guide&lt;/li&gt;&lt;li&gt;1G Micro SD Card (inserted into Device)&lt;/li&gt;&lt;/ul&gt;      &lt;/li&gt;&lt;/ul&gt;       &lt;/div&gt;      &lt;/div&gt;&lt;br /&gt;So far the experience on this phone has been amazing for me. I'm going to use this blog to record my findings as I learn the exciting new platform.&lt;br /&gt;&lt;br /&gt;I've downloaded the android SDK from:&lt;br /&gt;&lt;a href="http://code.google.com/android/download.html"&gt;http://code.google.com/android/download.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This includes many important tools, most notably &lt;span style="font-family: courier new; font-weight: bold;"&gt;adb&lt;/span&gt; - android debug bridge, which allows me to run all kinds of commands on the device directly from my computer, ie without typing on the device. It also eliminates the need to run telnet or ssh server on the device.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4059562360294499378-8524313136122309119?l=android-tricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://android-tricks.blogspot.com/feeds/8524313136122309119/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://android-tricks.blogspot.com/2009/01/my-dream-phone.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4059562360294499378/posts/default/8524313136122309119'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4059562360294499378/posts/default/8524313136122309119'/><link rel='alternate' type='text/html' href='http://android-tricks.blogspot.com/2009/01/my-dream-phone.html' title='My Dream Phone'/><author><name>Nirnimesh .</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-w8-xXZ7kEvY/AAAAAAAAAAI/AAAAAAAANhk/vNEvgAjQnfM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry></feed>
