Derek

May 122012
 

I started working on an iPad app just after Christmas and have today started the process of getting it into the Apple store. I’m not sure if Apple will approve it, since it breaks one of their cardinal rules. Applications may not include cross-compilers. My app is an Arduino simulator. The Arduino is a low-cost open source micro controller. The physical board is about 3×2 inches in size, has a 8 bit processor and 32 KB of usable program space. One of these costs about $60 here in NZ. It has a number of ports that can be connected to digital or analog devices.

This is what an Arduino looks like


The controller can be programmed using a cut down version of C++. I’ve set one of these up with a temperature and humidity sensor as well as an ethernet card. This setup updates a database with the current temperature, then I have an iPhone app that displays the current temperature.

My app includes some UI to draw an Arduino and a circuit board that can hold LEDs and wires to link the components and the Arduino model’s ports. I’ve written simple route tracking code that toggles the state of an LED when a wire is live. I’ve also written my own C compiler that takes a program just as you would write for the Arduino itself and I compile this to my own assembly language. I have a virtual machine that executes the assembly and sets the digital ports on the Arduino model to ‘on’ or ‘off’, then I track the wires and light up the LEds.

This is what the app looks like:


The question is, will Apple allow this app on the App Store? It has an embedded cross-compiler, but it’s all sandboxed, the C code that makes up the program can only blink the LEDs on the UI, though it would be interesting to allow the C code to call a web service.

BTW. Have already had suggestions that I port this to the Android platform. Probably won’t happen; writing a C compiler and VM in Java is a bit beyond me ;-)

 Posted by at 4:00 pm
Mar 072011
 

This is probably an obvious one. but it’s possible to shorten your OpenID URL. Use your URL shortener of choice. Assuming you’re using TinyURL, type your OpenID, which might be something like http://myopenid.com/itsmereally and generate a TinyUrl for it (the TinyURL would look something like http://tinyurl.com/ABC123). When entering your OpenId in a web-site you can now type the shortened URL. OK in this example it doesn’t gain you much, but if you have your own domain and have tied your OpenID to that you would have an OpenID like http://openid.mydomain.com/itsmereally, which can benefit from shortening

Mar 052011
 

I’ve been experimenting for a while integrating OpenID (Wikipedia) with an iOS application. The iOS application uses a split view controller, though that shouldn’t matter.

I started by registering with MyOpenId. In fact I did this a week or so ago. I’ve linked my OpenID with a few other sites that I use (StackOverflow, Toodledo etc). OpenID is an implementation of a decentralized authentication mechanism, which means users of my application would be able to authenticate using their OpenID credentials rather than needing to have special credentials for my application.

MyOpenId is partnered with Janrain, whose product Janrain Engage allows you to integrate OpenID with various application platforms. I registered with Janrain – using their Basic package, since I’m just trialling the mechanism for now. My Janrain registration is tied to my OpenID. I registered a new application there too, which has an application Id that I will use from my iApp. Janrain produce an Objective C library that I cloned from github.

It was a simple task to clone the github repository and include it in my application. I then modified my AppDelegate header to include the JREngage header and added a function that would make an authentication call:


JREngage *jrEngage = [JREngage jrEngageWithAppId:@"abcdefghijklmnopqrst"
andTokenUrl:nil
delegate:self];
[jrEngage setCustomInterfaceDefaults:customInterface];
[jrEngage showAuthenticationDialog];

I linked this code to a login button. I also provided the necessary JREngageDelegate functions, specifically jrAuthenticationDidSucceedForUser.

The application now starts up with a blank screen, and the user must select Login. In the login action function I make a call to the jrEngage library. This pops up a dialog and asks for an OpenID provider. I select MyOpenID and type my OpenID. I’m then redirected to the MyOpenID page and asked to type in my MyOpenID password. The result of this is sent back to the jrAuthenticationDidSucceedForUser function in my application. Here I verify that the user information that MyOpenID have sent back corresponds to a user who’s allowed to use my application, and I render my applications UI. To check the OpenId matches one of my users, I’d maintain a list of users for my system and the OpenId for each one. I can visualise how I’d set up new users; I’d take the OpenId information returned by MyOpenID (this contains an email address and an OpenID); I’d ask the user to sign up for my application, and send a validation email – maybe it would contain a secret code that they’d have to type into my app. I would not be holding any passwords, since I’d be authenticating people based on their OpenID credentials