Sunday, May 30, 2010

DIY iPad Horizontal Stand for $3

I figured out a way to adapt an existing iPad dock to allow horizontal viewing. Target, Walmart, and other places sell these great wall hooks...

I bought a set of the small wire hooks for $2.94 from Target. Adjusted the angle of the hook to match the ipad dock angle and attached them to the back of my iPad dock.

They work great! Plus its not permanent! Check out the pics and leave a comment if you end up using this.


Friday, January 22, 2010

Drupal for iPhone app Update - Upload Images to Drupal from iPhone

This one took a while to figure out...

Step 1) Create the File.Save Service
Drupal will accept your image encoded as base64 and dump into an actual file.

Step 2) The iPhone will take a picture and then encode it as base64. I figured out that although the CocoaXMLRPC library will send the XMLRPC response with < base64 > tags, drupal doesn't know what to do with the info in those tags. This created a lot of 0 byte files.
The solution is to comment out the < base64 > tag in the CocoaXMLRPC and substitute < string > tag.

If everything works, you'll get a File ID (fid) back.

So construct your XMLRPC Request like you would with a text content type. Then set your Imagedata as one of the PostParams with the forkey 'file' and the method

Drupal for iPhone app Update - NSSCanner no more

I figured out that the Cocoa XMLRPC library was already doing the work of parsing out the XMLRPC responses. Basically after you get the XMLRPC response, create a NSDictionary and retrieve the key/value pair. Here's some sample code

//So you could put this in the - (void)viewDidLoad
NSString *drupalurl = @"";

//XMLRPC request
XMLRPCRequest *reqUserInfo = [[XMLRPCRequest alloc] initWithHost:[NSURL URLWithString:drupalurl]];
[reqUserInfo setMethod:@"system.connect" withObjects:[NSArray arrayWithObjects: nil]];
XMLRPCResponse *Response = [XMLRPCConnection sendSynchronousXMLRPCRequest:reqUserInfo];

//Whole XMLRPC response dumped into dictionary.
NSMutableDictionary *dict = [Response object];

//Anonymous sessid retrieved from the dictionary
NSString *anonsessid = [dict objectForKey:@"sessid"];


Friday, October 9, 2009

Drupal iPhone Appers - Take a look at this link

Thanks for visiting! I really appreciated the comments.

I found a great tutorial which may help you out.
Check out Integrate Drupal with iPhone

This really seems to be a helpful lead. I was able to download his iPhone app example. (You need to use git) and upload the various modules to my drupal website.

I almost got it working. I can get nodes to load, but the OAuth part isn't.

Using the Rest Server with OAuth, I think will be a great way of authenticating and even uploading files images etc.

I'll post more when I get this working...
Thanks again!

Tuesday, June 30, 2009

Drupal for Iphone app - Source code

This is for Peter and anyone else who is trying to use Drupal with their iPhone using XMLRPC.

Drupal for Iphone App
Here are some brief notes.

Make sure to upload drupal's Services modules and set the module permissions.

I added a Settings Bundle for the iPhone app.
For the URL put
Put in your drupal username and password

Then goto the App.
Click Login
Down in the Results screen. You should see xml code.
If you don't see errors then you're fine.
For the content field, put in a content type, blog, page, whatever.
Put in a title and body and hit submit.
You should see a confirmation as xml code in the result field.
The camera button and the Tab bar controller don't work.
If you want your user picture to show up then change the code in MyViewController.

I think that's about it.
Please post back here and let me know if you try my code out.


Thursday, April 2, 2009

Progress on Drupal for Iphone App

Well, I've made a good deal of progress. I'm also having a lot of fun playing with Xcode and Objective C. I added a settings bundle and had the app access those settings. Just a few minutes ago, I figured out how to load a user's profile image from the drupal website! I added a tab bar, but I'm still figuring that out. Anyways, Loads of fun...Check it out.

Thursday, March 26, 2009

Drupal for iPhone app

So I've been programming a Drupal for iPhone app using XMLRPC. I got it working, yeh!

It's a little rough around the edges but things users can do so far...
- Input any drupal website. The drupal services module needs to be installed. Well at least I haven't tested it without the services module. The session module needs sessid checked.

- Login with your drupal username/password.

- Post a title and story to your drupal website.

- Logout.

- The list of features I want to add is pretty long, but at least this basic part is working.