tag:blogger.com,1999:blog-74352583043962422062024-03-08T21:39:00.671+00:00Pete Cole from IntermorphicThoughts from the programmer behind Intermorphic (Liptikl, Noatikl, Mixtikl, the Intermorphic Sound System), and SSEYO (miniMIXA and the Koan music engine)Pete Colehttp://www.blogger.com/profile/04463588527112443658noreply@blogger.comBlogger118125tag:blogger.com,1999:blog-7435258304396242206.post-73901005729447139292012-12-18T19:27:00.002+00:002012-12-18T19:31:48.887+00:00Tiklbox<div class="separator" style="clear: both; text-align: center;">
<a href="http://www.intermorphic.com/tiklbox/images/tiklbox-120.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://www.intermorphic.com/tiklbox/images/tiklbox-120.png" /></a></div>
<br />
I'm pleased to announce - finally! - the release of Tiklbox. <br />
<br />
You can get it here from iTunes for iOS: <br />
<br />
<a href="https://itunes.apple.com/app/id541582548">https://itunes.apple.com/app/id541582548</a><br />
<br />
There is more background on the Intermorphic website:<br />
<br />
<a href="http://www.intermorphic.com/tiklbox/index.html">http://www.intermorphic.com/tiklbox/index.html</a><br />
<br />
We worked very hard at the design of Tiklbox, to make it very easy to use, and as relaxing as possible. We also made it from the beginning for international users; Tiklbox is available from first release for many languages (English, Chinese, Dutch, French, German,
Indonesian, Italian, Japanese, Korean, Portuguese, Russian, Spanish)...<br />
<br />
The Android version is also written, but not fully debugged; we're planning to release that version in January (Android 2.3+).Pete Colehttp://www.blogger.com/profile/04463588527112443658noreply@blogger.com0tag:blogger.com,1999:blog-7435258304396242206.post-88342092995012134222012-09-26T16:05:00.002+01:002012-09-26T16:05:19.649+01:00XVim - XCode plug-in for Vim!What a great thing to have discovered - a Vim plug-in for Xcode. :)<br />
<br />
<br />
https://github.com/JugglerShu/XVim<br />
<br />
That is, quite simply, tremendous. :)<br />
Pete Colehttp://www.blogger.com/profile/04463588527112443658noreply@blogger.com0tag:blogger.com,1999:blog-7435258304396242206.post-69473899756427435152012-07-19T16:09:00.002+01:002012-07-19T16:09:40.391+01:00Android NDK debugging - on the Mac<div>
I've been very busy the past couple of days, figuring-out how to track-down a bug in some JNI code.</div>
<div>
</div>
<div>
I've installed a new Google "NDK Plugins" tool for Eclipse... that works rather well, and is well worth investigating if you need to debug Android JNI code from Mac, Windows or Linux.</div>
<div>
<br />
</div>
http://tools.android.com/recent/usingthendkplugin<br />
<br />
I had to install Eclipse 3.7 (I had been using 3.6...), and made sure to select the NDK Plugins option when installing the Android tools.<br />
<br />
I also had to: <br />
- turn-off all C++ building and code analysis from the Eclipse side<br />
- set android:debuggable="true" in the AndroidManifest.xml<br />
- right click project, select Debug -> Android Native...<br />
- The breakpoints aren't hit; but I DO get the debugger fire-in when the code goes wrong!<br />
<br />
PetePete Colehttp://www.blogger.com/profile/04463588527112443658noreply@blogger.com0tag:blogger.com,1999:blog-7435258304396242206.post-60773318966631852192012-05-18T13:32:00.000+01:002012-05-18T13:33:34.387+01:00Noatikl 2 now on the Mac App StoreNoatikl 2 has now arrived on the Mac App Store, which is great news of course! You can find it here..<br />
<br />
<a href="http://itunes.apple.com/us/app/id469613273?mt=12&u1=webmac&affId=1860684">http://itunes.apple.com/us/app/id469613273?mt=12&u1=webmac&affId=1860684</a><br />
<br />
We now have four products on the Mac App Store - Noatikl, Mixtikl, Mixtikl Free and Liptikl - thanks to Apple for providing this distribution channel!Pete Colehttp://www.blogger.com/profile/04463588527112443658noreply@blogger.com0tag:blogger.com,1999:blog-7435258304396242206.post-19737702781223629502012-05-15T10:38:00.002+01:002012-05-15T11:01:01.473+01:00XCode and static libraries - auto-archiving the .a files for iOS and MacI was scratching my head figuring-out how to copy-out the .a files from an XCode static library build for iOS, so that I could distribute the static library variants easily to my customers.
<p/>
For example, I had builds both for iOS and Simulator, and they were both going somewhere like this:
<p/>
<pre>
/Users/me/Library/Developer/Xcode/DerivedData/mylib_blahblahblahblah/Build/Intermediates/...
...ArchiveIntermediates/mylib/IntermediateBuildFilesPath/UninstalledProducts/libmylib.a
</pre>
<p/>
... which is a bit tricky to deal with!
<p/>
The solution for me was to create a Run Script entry in the Build Phases for my Target under the XCode project/target settings...:
<p/>
<pre>
mkdir -p /Users/me/myfolder/$CONFIGURATION-$PLATFORM_NAME
cp -p $TARGET_BUILD_DIR/libmylib.a /Users/me/myfolder/$CONFIGURATION-$PLATFORM_NAME
if [ $CONFIGURATION eq Release ]
then
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip -S \
/Users/me/myfolder/$CONFIGURATION-$PLATFORM_NAME/libmylib.a
fi
</pre>
<p/>
Note the strip command, which is essential as the script is always run before XCode's normal strip behaviour!
<p/>
Note also that to generate a library for Release, for both iOS and simulator, you need to Build for Profile.
<p/>
Here is the command-line I use to build it all automatically!
<pre>
xcodebuild -project mylib.xcodeproj Release -sdk iphonesimulator clean
xcodebuild -project mylib.xcodeproj Release -sdk iphoneos clean
xcodebuild -project mylib.xcodeproj Release -sdk iphonesimulator
xcodebuild -project mylib.xcodeproj Release -sdk iphoneos
</pre>
<p/>
To configure an app to link-in the appropriate version of the (copied!) static library to match your app's Release/Debug configuration and target (iOS/Simulator), simply put this in the Other Linker Flags section of your app...:
<pre>
/Users/me/myfolder/$CONFIGURATION-$PLATFORM_NAME/libmylib.a
</pre>
<p/>Pete Colehttp://www.blogger.com/profile/04463588527112443658noreply@blogger.com0tag:blogger.com,1999:blog-7435258304396242206.post-76701818787909996662012-05-13T22:18:00.004+01:002012-05-13T22:18:49.574+01:00Noatikl 2 launched!Noatikl 2 - we've finally launched it!
What a huge chunk of work this has been.
<p></p>
<a href="http://www.intermorphic.com/tools/noatikl/index.html">http://www.intermorphic.com/tools/noatikl/index.html</a>
<p></p>
I'm pretty pleased with the way that the network editor works, together with the pop-up Synth and Effects editors. The cross-integration of our code base is working well!
<p></p>
Next step: the mobile versions for both iOS and Android. That'll take quite a lot more work, but the GUI changes already in place in Noatikl 2 have taken us a long way down that road.
<p></p>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://www.intermorphic.com/tools/noatikl/doc/images/noatikl2-screen.jpg" imageanchor="1" style="margin-left:1em; margin-right:1em"><img border="0" height="341" width="451" src="http://www.intermorphic.com/tools/noatikl/doc/images/noatikl2-screen.jpg" /></a></div>Pete Colehttp://www.blogger.com/profile/04463588527112443658noreply@blogger.com0tag:blogger.com,1999:blog-7435258304396242206.post-45376628206653130202012-04-24T11:04:00.001+01:002012-04-24T13:01:26.995+01:00Noatikl 2 - getting close!The initial version of <a href="http://www.intermorphic.com/tools/noatikl/index.html">Noatikl 2</a> is now very close to release!<br />
<br />
We have just got a couple of things to tweak, and some documentation to check.<br />
<br />
Hopefully Noatikl 2 will "go live" in just a few weeks...!Pete Colehttp://www.blogger.com/profile/04463588527112443658noreply@blogger.com0tag:blogger.com,1999:blog-7435258304396242206.post-5325658282450737992012-03-12T11:14:00.002+00:002012-03-12T11:15:52.804+00:00Debugging JNI/C++ code under Android/Eclipse is now easy!At long last: debugging JNI/C++ code under Android/Eclipse is now easy!<br />
<br />
All I had to do was to get this amazing software for Eclipse - thank you ARM ! ...:<br />
<br />
<a href="http://www.arm.com/products/tools/software-tools/ds-5/community-edition/ds-5-community-edition-debug.php">http://www.arm.com/products/tools/software-tools/ds-5/community-edition/ds-5-community-edition-debug.php</a><br />
<br />
Because I'm using a Mac, I had to install under a Linux VM on my Mac...<br />
<br />
The only obscure thing I found when following the install/configure instructions, was that I in order for the new DB-5 Debugger Debug Configuration to find my device, I first to do this:<br />
<br />
sudo ln -s <path adb="" to=""> /usr/bin/adb</path><br />
<br />
<path adb="" to="">Brilliant!!</path><br />
<br />
<path adb="" to="">Pete</path>Pete Colehttp://www.blogger.com/profile/04463588527112443658noreply@blogger.com0tag:blogger.com,1999:blog-7435258304396242206.post-68445756703949125652012-02-29T10:13:00.001+00:002012-02-29T10:14:23.673+00:00Android - handling rotation/orientation in an Activity - the easy way!As I've been asked a few times about the easy way to handle rotation in an Android Activity, I thought I'd outline what you need to do here. It is really easy when you know how!<br />
<br />
Firstly, you need to ensure that you create your layouts such that they resize easily. See this post for more details:<br />
<a href="http://sseyod.blogspot.com/2010/09/art-of-scalable-android-layouts.html">http://sseyod.blogspot.com/2010/09/art-of-scalable-android-layouts.html</a><br />
<br />
Secondly, if you find that you need a different layout for your Activity (say in Landscape mode), create it in a parallel folder to your portait layout like this...:<br />
<code><br />
res/layout/fred.xml<br />
res/layout-land/fred.xml<br />
</code><br />
<br />
In your mainfest xml activity... block, make sure you put this:<br />
<code><br />
android:configChanges="orientation|keyboardHidden"<br />
</code><br />
<br />
In your Activity's onCreate() method implementation, pretty much all you need to do is call this method:<br />
<code><br />
myConfigureUI();<br />
</code><br />
<br />
Create the following override method in your Activity (this is called when the orientation changes as your Activity is rotated):<br />
<code><br />
@Override<br />
public void onConfigurationChanged(Configuration newConfig) {<br />
<br />
// Copy current item values from all your UI gadgets...!<br />
String myvalue = myitem.toString();<br />
// etc...<br />
<br />
// Call the method that re-orients and re-creates the gadget bindings<br />
myConfigureUI();<br />
<br />
// Restore the gadget values to the post-rotation UI:<br />
myitem.setText(myvalue);<br />
}<br />
</code><br />
<br />
Finally, you can create your new method, which makes your Activity use the correct layout to suit your orientation, and which looks-up all the gadgets, prepares their data and sets-up their event handlers (remember: this is called both at creation time, and whenever a rotation event occurs!):<br />
<br />
<code><br />
private void myConfigureUI() {<br />
<br />
/*<br />
// Can check the orientation of the screen...<br />
if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {<br />
setContentView(R.layout.main_landscape);<br />
} else {<br />
setContentView(R.layout.main);<br />
}<br />
*/<br />
<br />
// This will automatically pick-up the landscape layout or portrait layout...<br />
setContentView(R.layout.main);<br />
<br />
// Look-up new items etc. ... mySpinner is an instance variable in this example...<br />
mySpinner = (Spinner) findViewById(R.id.spinnerx);<br />
<br />
mySpinner .setOnItemSelectedListener(new OnItemSelectedListener() { ...<br />
...}<br />
// etc. ...<br />
}<br />
</code>Pete Colehttp://www.blogger.com/profile/04463588527112443658noreply@blogger.com6tag:blogger.com,1999:blog-7435258304396242206.post-19852383183223308102012-01-23T16:16:00.000+00:002012-01-23T16:16:35.565+00:00Noatikl 2We've been working very hard on Noatikl 2, and it is going to be a huge improvement on Noatikl 1.x!<br />
<br />
Noatikl 2 will include built-in support for the Partikl synth that has already been featured in Mixtikl (in addition to all of Noatikl's traditional MIDI I/O options).<br />
<br />
When Noatikl 2 launches later this year, it will be available directly from the Mac App Store in standalone form (Windows versions and Mac Plug-in variants will be on the Intermorphic web store as usual). We're also planning to bring it to both iOS and Android at some point this year. :)<br />
<br />
PetePete Colehttp://www.blogger.com/profile/04463588527112443658noreply@blogger.com0tag:blogger.com,1999:blog-7435258304396242206.post-2913305093495293632011-12-24T16:34:00.000+00:002011-12-24T16:34:14.803+00:00Mixtikl on Kindle Fire!I got hold of a Kindle Fire via a re-seller on eBay UK, so we could make sure that Mixtikl worked fine on there.<br />
<br />
This being Android, Mixtikl worked first time! I installed Mixtikl using "adb install", having first configured adb to recognise the Kindle Fire. <br />
<br />
I changed just a couple of things to make it "Kindle Fire friendly". Those being:<br />
- I had to increase the audio latency a bit to prevent audio break-up; that took just a few minutes...<br />
- I had to account for Kindle Fire's taking-up the bottom 20 pixels to display the soft menu bar, which was also very easy...<br />
<br />
I must say that Mixtikl works *really* well on the Kindle Fire. The Mixtikl icon doesn't display at the moment; but I have read that is because the icon is downloaded only when you purchase the app from the Amazon Kindle App Store.<br />
<br />
I should say that I'm really very impressed with the Kindle Fire! It is a really nice size, fabulous for reading books (thanks to the touch screen, which isn't on the older Kindle of course). It seems very fast, with a lovely clear display and it is very responsive. Will I like it more than my iPad 1? Well, I prefer the size of the Kindle Fire, and like the stereo speakers; and I like that it was so easy to get our app running on it. :) The iPad has the advantage of having lots of good quality games for it... but it is *very* much more expensive ... if the Kindle Fire had more storage space, it'd make quite a nice MP3 player.<br />
<br />
It's a pain that the Amazon App store is US-only at the moment, but I'm sure they'll roll that out worldwide soon enough. I think they're going to sell huge numbers of Kindle Fires!<br />
<br />
I also want to mention that so far, the Amazon developer support team have been *incredibly* responsive to the questions I've had; I'm genuinely impressed!<br />
<br />
PetePete Colehttp://www.blogger.com/profile/04463588527112443658noreply@blogger.com6tag:blogger.com,1999:blog-7435258304396242206.post-74657909174230759092011-12-19T09:16:00.002+00:002011-12-20T21:44:21.004+00:00Mixtikl on Android - repriseThe port of <a href="http://www.intermorphic.com/tools/mixtikl/index.html">Mixtikl</a> to Android is now complete.<br />
<br />
I thought I'd share how I ended-up porting Mixtikl to Android, as this has been a long road!<br />
<br />
When I first started looking at porting Mixtikl to Android, there were a couple of blocking issues;<br />
- no support for C++ template library (though eventually STLPort arrived!)<br />
- the original Mixtikl made heavy use of Modal code for dialog handling<br />
Both of those two items made a port with Android a non-starter.<br />
<br />
However, when Airplay (now renamed to Marmalade) added Android support, we were able to attempt a port of Mixtikl; as Airplay contained both C++ template library support, and supported modal code.<br />
Ultimately however, the audio had too many problems (very, very high latency, mono only etc.) and this made the Airplay-based port too low quality to allow us to release.<br />
<br />
Time moves on however, and a while back, Google added full support for the C++ standard template library to the Android NDK. And, critically, they added support for both OpenSL (to Android 2.3), and 32-bit ARM code generation (via armeabi-v7a). Given those changes, we spend a month or so removing all the modal code from Mixtikl (not an easy undertaking: you have to bear in mind that Mixtikl is > 500K lines of C++ code!).<br />
<br />
So, given those changes in both the Android NDK and Mixtikl's own internal architecture, we were able to start and complete a full native port of Mixtikl to Android. <br />
<br />
The bulk of Mixtikl remains in C++; all the graphics are drawn via the same C++-based graphics engine we use on all platforms. The interaction with Java is just a thin JNI layer that looks after drawing primitives and some native dialog interfacing. The OpenSL support is just a thin adaptor layer between our audio engine and OpenSL.<br />
<br />
Mixtikl performs brilliantly on Android in my opinion; though as noted elsewhere the Android OpenSL implementation is missing a big trick in regards latency management; and we have to configure Mixtikl to run with slightly higher latency that we would like in order to avoid any potential audio break-up.<br />
<br />
I should note that debugging C++ code on Android remains a pain, you have to rely on trace statements, though it is at least possible now to use gdb and the bt command to trap crashes when they happen and see where the code died in the call stack. The good news is that Mixtikl is very solid as 99% of the code is cross-platform and very well tested, so I've hardly had to touch gdb!Pete Colehttp://www.blogger.com/profile/04463588527112443658noreply@blogger.com2tag:blogger.com,1999:blog-7435258304396242206.post-11674355611775704452011-12-06T09:26:00.000+00:002011-12-06T09:26:48.295+00:00Android - how to reduce the audio latencyI been approached a few times recently about how to write low-latency audio latency apps in Android, and I point such queries to OpenSL and say "look how much better it is that it used to be" (provided you use C++ of course)...<br />
<br />
But the bottom line is that the Android audio APIs - and that includes OpenSL - still miss the basic trick, which is to be able to offer a programmatic contract that is as simple as this:<br />
<br />
App : what sets of audio rates and formats do you support?<br />
(API responds, maybe only 22Khz stereo, for sake of simplicity here)<br />
App asks: how many audio blocks do I need to keep prepared and primed in the queue to guarantee no break-up, at this rate/format, with minimal latency?<br />
(API responds, maybe 2 blocks of 512 sample frames each).<br />
App prepares the first 2 blocks, submits, and gets "block delivery" callbacks; it runs a separate thread to keep internal queues topped-up ready to deliver to the callbacks.<br />
<br />
With that sort of contract, every app can run at minimal latency dictated by the underlying audio device (through the driver layer), on any device. Without that sort of contract, every app developer is kept guessing, and has to assume a worst case that works on all devices available for testing. :)<br />
<br />
I implemented this scheme nearly a decade ago in the intent Sound System (I had the luxury of designing and implementing a complete audio architecture for mobile devices from scratch!). It is a piece of cake to do, and IMO audio developers for Android are screaming for it. Intent was focused on ultra-low audio latency for games / multimedia and musical instruments...<br />
<br />
I should note, Apple have also missed the same trick - they've been able to get away with it however, as the offer a fixed range of hardware....Pete Colehttp://www.blogger.com/profile/04463588527112443658noreply@blogger.com1tag:blogger.com,1999:blog-7435258304396242206.post-30274037197852529422011-12-04T00:36:00.004+00:002011-12-05T22:24:22.236+00:00Android - high performance audio - how to do itI've just been through a very interesting period of work, sorting-out a high-performance audio interface for the Android port of Mixtikl. I've learned quite a few things - here are the highlights.<br />
<br />
Firstly, target Android 2.3 or later. This allows you to use OpenSL ES, which is the only realistic approach for low-latency audio on Android. The audio allows you to delivery audio with pretty low latency, and totally avoids any problems of garbage collection blocking you. This of course assumes that all your audio code is written in C++!<br />
<br />
As you're using OpenSL ES, and assuming you have some very heavy audio DSP going-on (like in Mixtikl!), you'll need to use a separate Posix thread to keep your audio callbacks pumped-up. Basically, if your OpenSL ES audio block callbacks take much time at all, then your audio will break-up. So, use a worker thread to keep sufficient audio pre-processed and ready to be picked-up and delivered via your callbacks!<br />
<br />
Finally, and believe me this is important (!): make sure you target armeabi-v7a, and that you use the right compiler flags to generate 32-bit ARM7 code. If you on the other hand use the default settings, you'll generate Thumb code for armeabi - and your code will run staggeringly slower (!!), and audio break-up is inevitable if you're doing anything serious. So: don't bother targeting armeabi devices... and Thumb code is a no-no.<br />
<br />
Follow my advice, and you can create sophisticated audio software. Don't follow it, and you're going to find things tough! ;)<br />
<br />
I should note that support for armeabi-v7a *emulator* targets arrived in the Android 4.0 SDK... which makes things a lot easier as well... something worth knowing!<br />
<br />
Finally... here is a useful resource on the background to OpenSL ES on Android...:<br />
<a href="http://mobilepearls.com/labs/native-android-api/opensles/index.html">http://mobilepearls.com/labs/native-android-api/opensles/index.html</a>Pete Colehttp://www.blogger.com/profile/04463588527112443658noreply@blogger.com13tag:blogger.com,1999:blog-7435258304396242206.post-52888556686780449352011-10-21T14:26:00.002+01:002011-10-24T09:21:09.737+01:00gdb with the Android NDK - now easy with ddd wrapping ndk-gdb!<span style="font-family: inherit;">You might already know this, but android debugging from gdb is now really, really easy - if you can stomach gdb!<br />
<br />
See Android/ndk6/docs/NDK-GDB.html in your NDK documentation.<br />
<br />
Basically, the app's libs/armeabi folder must have a gdbserver in it... which is put there automatically by the ndk-build command (remember not to ship your app with gdbserver in it!):<br />
<br />
So...: build your app, install with e.g.:<br />
<br />
adb install -r myfile.apk<br />
<br />
Start your app directly from the Android UI, and in a terminal, change to your product's jni folder, and you're ready to debug!</span><br />
<span style="font-family: inherit;"><br />
</span><br />
<span style="font-family: inherit;"><b><u>Using command-line gdb</u></b><br />
</span><br />
<span style="font-family: inherit;">If you prefer command-line gdb, type this:<br />
<br />
<b>ndk-gdb com.example.myproject</b><br />
<br />
You'll find that ndk-gdb will break as your app attaches. Set a breakpoint if you want (optional!), e.g.:<br />
<br />
b Java_com_example_hellojni_HelloJni_stringFromJNI<br />
<br />
Enter "cont" to continue...<br />
<br />
And the debugger will now hit your breakpoints - use normal gdb commands to control it!</span><br />
<span style="font-family: inherit;"></span><br />
<span style="font-family: inherit;"></span><br />
<span style="font-family: inherit;"></span><br />
<span style="font-family: inherit;"></span><br />
<span style="font-family: inherit;"></span><br />
<br />
<span style="font-family: inherit;"><b><u>Using the graphical ddd debugger</u></b><br />
</span><br />
<br />
<span style="font-family: inherit;">If, like me, you prefer to use a graphical debugger, it is really easy to use ddd as a wrapper around gdb!</span><br />
<span style="font-family: inherit;"></span><br />
<span style="font-family: inherit;">Many thanks to a blog reader for this suggestion!</span><br />
<span style="font-family: inherit;"><br />
It is really easy to use ddd instead... here are the steps!</span><br />
<span style="font-family: inherit;"><br />
</span><br />
<span style="font-family: inherit;"></span><br />
<u><span style="font-family: inherit;">Preparation:</span></u><br />
<span style="font-family: inherit;"><br />
1. Install ddd ...!<br />
2. Modify your ndk-gdb shells script, to simply comment-out the "exit 1" call when an unexpected argument is passed<br />
</span><br />
<span style="font-family: inherit;"></span><br />
<span style="font-family: inherit;"><br />
<u>Running ddd </u></span><br />
<span style="font-family: inherit;"><br />
</span><br />
<span style="font-family: inherit;">Start your app from Eclipse</span><span style="font-family: inherit;"><br />
</span><br />
<span style="font-family: inherit;">In a terminal window, change to your project's jni folder (if you're not there already!)</span><span style="font-family: inherit;"></span><br />
<span style="font-family: inherit;">Run ddd like this - and that is all there is to it!</span><br />
<span style="font-family: inherit;"><br />
<b>ddd --debugger ndk-gdb</b></span><br />
<span style="font-family: inherit;"><br />
</span><br />
<b><u><span style="font-family: inherit;">Eclipse</span></u></b><br />
<span style="font-family: inherit;"><br />
Using gdb for JNI/NDK from Eclipse is way too painful - I wouldn't bother. :)</span><br />
<span style="font-family: inherit;"><br />
</span><br />
<u><b><span style="font-family: inherit;">Run-time breakpoints</span></b></u><br />
<span style="font-family: inherit;"><br />
</span><br />
<span style="font-family: inherit;">On a final note, you can use this code to force a breakpoint at runtime...</span><br />
<span style="font-family: inherit;"><br />
</span><br />
<span style="font-family: inherit;"> #define BREAKPOINT __asm__ ("bkpt 0")<br />
printf ("Hitting breakpoint!");</span><br />
<span style="font-family: inherit;"> BREAKPOINT;<br />
printf ("Gone past breakpoint!");<br />
<br />
</span>Pete Colehttp://www.blogger.com/profile/04463588527112443658noreply@blogger.com4tag:blogger.com,1999:blog-7435258304396242206.post-88239784020885582602011-09-23T08:20:00.000+01:002011-09-23T08:20:40.138+01:00Mixtikl 5... iOS/Mac/WindowsWork on Mixtikl 5 is keeping me very busy... we've decided that Mixtikl 5 will be the first version we release for Android. However, we'll focus first on finishing-off the iOS / Mac /Windows versions...Pete Colehttp://www.blogger.com/profile/04463588527112443658noreply@blogger.com0tag:blogger.com,1999:blog-7435258304396242206.post-2577906410519043152011-09-02T10:08:00.001+01:002011-09-02T10:09:09.967+01:00Android - using findbugs from outside of EclipseI've been using findbugs to help track-down issues in Java code. A great tool, and very easy to use. However, the Eclipse-based plug-in keeps crashing for me with a NullPointerException on certain projects.<br />
<br />
The work-around to this is to run the findbugs UI directly.<br />
<br />
To use findbugs on Windows, get the latest findbugs distribution from <a href="http://findbugs.sourceforge.net/downloads.html">http://findbugs.sourceforge.net/downloads.html</a>, and then create a shortcut along the following lines (note the -X argument, as the JVM might require quite a bit of memory to avoid failing for big projects!):<br />
<blockquote><myjavabinfolder>\java.exe -Xmx1024m -jar C:\findbugs-1.3.9\lib\findbugs.jar -gui</myjavabinfolder></blockquote><br />
On Mac, simply run something like this directly:<br />
<blockquote>java -Xmx1024m -jar ~/findbugs-1.3.9/lib/findbugs.jar -gui &</blockquote><br />
It is really use to use - just select File -> New Project, add your class folders to the top pane, your source folders to the bottom pane, and let it run!<br />
<br />
<br />
<br />
<br />
<br />
<br />
Pete Colehttp://www.blogger.com/profile/04463588527112443658noreply@blogger.com0tag:blogger.com,1999:blog-7435258304396242206.post-64034735730924835242011-08-30T09:05:00.000+01:002011-08-30T09:05:16.721+01:00Upgrade to XCode 4.1 - problems with VALID_ARCHS for iOS Simulator buildsNow that I've taken the plunge and moved to XCode 4.x from XCode 3.x ... I had a really weird problem trying to build my iOS projects for the simulator.<br />
<br />
The builds failed with an error related to the i386 architecture. I simply couldn't figure-out how to solve this directly with the XCode IDE.<br />
<br />
Luckily, I did manage to figure-out a fix: my solution was to edit the project.pbxproj files by hand with vim, and remove a handul of fixed definitions of <span id="thread_subject_site">VALID_ARCHS ... which presumably were legacies from previous XCode versions. This is not the first time that I've been forced to fix XCode projects by hand!</span>Pete Colehttp://www.blogger.com/profile/04463588527112443658noreply@blogger.com0tag:blogger.com,1999:blog-7435258304396242206.post-22178906906660415442011-08-29T13:43:00.001+01:002011-08-29T13:44:06.193+01:00Mac - how to build installs the easy wayI was having some issues getting my Mac installers (using packagemaker) working with the latest XCode.<br />
<br />
Surfing-around, I found an amazing free tool called Packages. The link is here:<br />
<br />
<a href="http://s.sudre.free.fr/Software/Packages/about.html">http://s.sudre.free.fr/Software/Packages/about.html</a><br />
<br />
I've changed our own installers to use this, and all my Mac install problems have disappeared with an hours work. :)<br />
<br />
PetePete Colehttp://www.blogger.com/profile/04463588527112443658noreply@blogger.com0tag:blogger.com,1999:blog-7435258304396242206.post-1635018093642325292011-08-10T09:15:00.001+01:002011-08-10T09:15:47.518+01:00Audio and MIDI Visualization in iOS and AndroidI've spent the past month focused mainly on Intermorphic's Audio/MIDI visualizer framework, dusting-down the work I did (in the main) several years ago, and bringing it all up-to-date.<br />
<br />
I've recently experimented with lots of stuff, 2D and 3D, on iOS (UIKit ,Quartz, Core Animation and OpenGL ES) and Android (Canvas and OpenGL ES), and have learned a lot about performance differences between these approaches. I've also learned that OpenGL ES is a truly horrible API in which to get things done. :)<br />
<br />
Anyways - things are coming on nicely: the next update for Mixtikl should be another good one!<br />
<br />
<br />
Pete Colehttp://www.blogger.com/profile/04463588527112443658noreply@blogger.com0tag:blogger.com,1999:blog-7435258304396242206.post-58677374366344749772011-08-03T11:53:00.000+01:002011-08-03T11:53:25.565+01:00Android - turn key events into UTF8As I've been asked a few times how to turn Android key events into UTF8 data, I figured it might be a good idea to share this info in my blog! It is actually really easy:<br />
<br />
@Override<br />
public boolean onKeyDown(int keyCode, KeyEvent event) {<br />
int [] unicodePoints = new int[1];<br />
unicodePoints[0] = event.getUnicodeChar();<br />
String x = new String(unicodePoints, 0, 1);<br />
byte utf8Bytes[];<br />
try {<br />
utf8Bytes = x.getBytes("UTF-8");<br />
// Do something with your UTF-8 data here!<br />
// ....<br />
// ...<br />
} catch (UnsupportedEncodingException e) {<br />
Log.e(TAG, "Failed to key event to UTF8");<br />
Throw(e);<br />
}<br />
return true;<br />
}Pete Colehttp://www.blogger.com/profile/04463588527112443658noreply@blogger.com0tag:blogger.com,1999:blog-7435258304396242206.post-46226916092205546932011-07-26T20:29:00.000+01:002011-07-26T20:29:00.895+01:00Mixtikl on Android - with the NDK and C++Mixtikl is now around 95% complete on Android.<br />
<br />
I've actually ported directly with the NDK/C++, without using Juce, as my 2d portability layer for Mixtikl is so highly developed. The port only took around a week (having already done a lot of background work in the previous few months laying the ground for this and possibly other ports!).<br />
<br />
The Audio drivers have caused some fun; I've ended-up implementing support for AudioTrack and AudioRecord in native code with pthreads. Audio support in Android really is very poor...<br />
<br />
The biggest headache is the basic problem of debugging C++ code on Android; I'm reduced to using trace statements. It helps that 99% of the code in Mixtikl is cross-platform and fully debugged on other platforms!<br />
<br />
That said, the latest NDK (R6) is much improved with STL support and what have you; there is no longer any need to use Crystax.<br />
<br />
I'm still very likely to use Juce for the Liptikl and Noatikl ports to Android, of course!Pete Colehttp://www.blogger.com/profile/04463588527112443658noreply@blogger.com3tag:blogger.com,1999:blog-7435258304396242206.post-90912606635576338932011-06-30T08:37:00.000+01:002011-06-30T08:37:36.159+01:00Juce, C++ and AndroidI've been experimenting with using the fabulous Juce to create programs for Android using C++.<br />
<br />
You can find out about Juce here: <a href="http://www.rawmaterialsoftware.com/juce.php">http://www.rawmaterialsoftware.com/juce.php</a> <br />
<br />
If you haven't used Juce yet - give it a go! I've been using it for years now to create cross-platform programs for Mac and Windows...Pete Colehttp://www.blogger.com/profile/04463588527112443658noreply@blogger.com0tag:blogger.com,1999:blog-7435258304396242206.post-25277093730409558872011-01-31T10:27:00.000+00:002011-01-31T10:27:18.227+00:00SourceTree - git app for MacI've started using <a href="http://www.sourcetreeapp.com/">SourceTree</a> for painlessly reviewing historical changes in my Mac's git repository.<br />
<br />
Steve (the SourceTree developer) has just added a feature which easily allows you to visualise changes between arbitrary versions of any given file, which is far easier than trying to do with the git command-line tools!<br />
<br />
Give it a try - its a really nice tool!Pete Colehttp://www.blogger.com/profile/04463588527112443658noreply@blogger.com0tag:blogger.com,1999:blog-7435258304396242206.post-64178260807721073052010-11-01T11:40:00.000+00:002010-11-01T11:40:38.405+00:00How to debug Android NDK code using EclipseThis looks very useful, though I have yet to try it!<br />
<br />
<a href="http://www.eclipse.org/sequoyah/documentation/native_debug.php">http://www.eclipse.org/sequoyah/documentation/native_debug.php</a>Pete Colehttp://www.blogger.com/profile/04463588527112443658noreply@blogger.com0