Archive for the ‘Misc’ category

Drag and drop install APK script

September 30th, 2010

Update April 5th 2011: since the latest Android SDK, the adb tool has been moved to the platform-tools folder. I updated the script to point to the correct directory.

If you want to be able to just drag and drop your APK file onto a CMD file, and let it be installed on the connected device automatically, use something like this (simply copy this to your *.cmd file):

New:

:: Just some debug output:
echo Attempting to install file: %1
 
:: Enter drive letter:
d:
 
:: Enter path to adb here:
cd D:\android_sdk on 10.17.1.205\platform-tools
 
:: Install file:
adb install -r %1
PAUSE

Old:

:: Just some debug output:
echo Attempting to install file: %1
 
:: Enter drive letter:
d:
 
:: Enter path to adb here:
cd D:\androidsdk\tools
 
:: Install file:
adb install -r %1
PAUSE

PS: Of course one could use set varNAme=__PATH__ instead of the cd-ing, but my path has some spaces and that leads to troubles.

Simulate incoming call with Android emulator

September 14th, 2010

First be sure that an emulator is running.
Then open up the console with Start >> Run (or press Windows + ‘r’) and type in ‘cmd‘.
This will bring you to something like:

 

Like shown above, type in ‘telnet‘ and press enter. The result will look like:

 

Here type in ‘o localhost 5554‘ as shown here:

 

This will establish a connection to the emulator.
You can see the port number to be entered in the title bar of the emulator window.
If this succeeds, it will open the Android Console:

 

Here you can use all kinds of commands.
To simulate a call, type ‘gsm call 066712345‘:

 

The result is an incoming call at the emulator:

 

To cancel the call, type ‘gsm cancel 066712345‘.
See http://developer.android.com/guide/developing/tools/emulator.html#telephony for more information about gsm operations.

Use ‘exit‘ to exit the Android Console and ‘quit‘ to quit telnet.
Hope that helps!

Android & Eclipse “Could not find *.apk”

August 21st, 2010

If you’re using Eclipse to develop Android applications and get the error:

[2010-08-16 19:56:41 - xxx] ------------------------------
[2010-08-16 19:56:41 - xxx] Android Launch!
[2010-08-16 19:56:41 - xxx] adb is running normally.
[2010-08-16 19:56:41 - xxx] Could not find xxx.apk!
[2010-08-16 19:58:04 - xxx] ------------------------------

after importing a project (maybe doing some reconfiguring), just remove the project (only the project from Eclipse, not from disk!).
Then simply re-import it and it should work again!

Update March 14th: according to Sean, you can get this error also by having the emulator already running and changing the project SDK. The solution then is to close the emulator and run it again from eclipse. Thanks for the info!

I am on twitter now…

August 10th, 2010

For a long time, I tried to not use it…but as with most trendy things, it sooner or later catches up to you. So I’m on twitter now: hr_zog – Follow me if you like! I might also implement a retweet function to my blog posts.

Fable III

August 7th, 2010

Fable III has a really nice intro video:

I also stumbled over this interview.
Wow! If only part of this is true, I can’t wait for it to be released! Unfortunately, the PC release seems to be delayed and a new date has not yet been announced.