Posts Tagged ‘Tutorials’

MASH-up

May 25th, 2011

Today we released the first iteration of MASH, the “Modern Alchemists ShiVa Libs”:

Modern Alchemists ShiVa Libs is a bundle of custom written ShiVa addons. All projects rely on ShiVa 1.9 and UAT 1.2 beta 7. This doesn’t mean it won’t work with older versions, but the docs might refer to code hockups which weren’t present back then.

All code is under LGPL License. If you like our work, tell us! If not, tell us even more! Got a code fix? Tell us… you get the idea ;)

It features:

  • MASS: In-App-Purchase for iOS and Android
  • MAOF: OpenFeint for iOS and Android
  • Mortar (TBA): automating the world!

You can get all the files/code either from the download section or via SVN at  google code: http://code.google.com/p/ma-sh/

Android: Could not reserve enough space for object heap

April 15th, 2011

If you ever get an error like
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.

or
BUILD FAILED
...ant_rules_r3.xml:361: The following error occurred while executing this line:
...ant_rules_r3.xml:174: apply returned: 1
,
don’t let yourself get fooled about some threads found on google.

The answer why your VM crashes is, that the heap space trying to be allocated is not free in physical memory.

That means: try to decrease the setting for max heap space in the file android-sdk-windows/platform-toolsdx.bat to smaller value. I had to change it to 512M instead of 1024M, meaning:
set defaultMx=-Xmx512M

And tada, off you go!

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!

Configuring Notepad++ for pbelevel format

March 23rd, 2010

I use Notepad++ for viewing my *.pbelevel files, and always had to do the extra clicking “Language >> XML” to configure it, to display the file with XML highlighting. I now found out, how one can configure Notepad++ to do this automatically: locate the langs.xml in your Notepad++ install directory and add the following line:

<Language name="xml"  ext="pbelevel"></Language>

And tada – you’re off to go!